TO CALCULATE DISK SPACE ON SERVER TO MOVE: awk '/sd[a-z]$/{printf "%s %8.2f GiB\n", $NF, $(NF-1) / 1024 / 1024}' /proc/partitions
The initiator name needs to match the server to the compellent
cat /etc/iscsi/initiatorname.iscsi
Send it to Debbie and Amy
Create a stub multipath.conf /etc/multipath.conf
defaults {
user_friendly_names yes
find_multipaths yes
}
devices {
device {
vendor "COMPELNT"
product "Compellent Vol"
features 0
path_selector "round-robin 0"
failback immediate
no_path_retry fail
}
}
blacklist {
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^hd[a-z]"
devnode "sda"
wwid "36000d3100126680100000000000000e2"
wwid "36000d3100126680100000000000000e1"
device {
vendor "COMPELNT"
product "Compellent Alu"
}
}
### ###################################################
### Get the WID for the aliased disk
### /sbin/multipath -l
###
### See info for the raw devices as well
### /sbin/multipath -ll
### ###################################################
### blacklist_exceptions {
### wwid ""
### }
### multipaths {
### multipath {
### wwid ""
### alias "cdb"
### }
### }
-- The following need to be on the server to config the COMPELLENT connection.
yum install lsscsi.x86_64
yum install device-mapper-multipath.x86_64 device-mapper-multipath-libs.x86_64
--- Also you will need to check and add if missingls -l /var/lib/iscsi/ifaces
iscsiadm -m iface -I eth2 --op=new
--- Make multipath seen and make sure it is running
systemctl enable multipathd
systemctl start multipathd
systemctl status multipathd
--- Some multipath|multipathd DEBUG commands
multipathd -k
multipathd> show paths
Ctrl D
dmsetup status
dmsetup ls
Do this with Caution
/sbin/multipath -f /dev/mapper/mpathc ### remove mpathc
--- Get VMTOOLs running if it is not
/root/VMTOOLS/vmware-tools-distrib/bin/vmware-config-tools.pl
Confirm that an /etc/sysconfig/networks-scripts/ifcfg-eth2 exists...
TYPE=Ethernet
BOOTPROTO=none
IPADDR=10.1.2.<supplied by VM>
PREFIX=24
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=eth2
ONBOOT=yes
HWADDR=ifconfig -a |grep eth2 |awk '{print $5}'
MTU=9000
NM:255.255.255.0
GW: 10.1.2.254
/etc/sysconfigure/network-scripts/ifcfg-Auto-eth2
MAYBE A reboot AT THIS POINT TO SEE IF THE NEW 10.1.2.??? eth2 APPEARS
run: service network restart
Do the iscsadm commands like ... /sbin/iscsiadm -m discovery -d 5 -t st -p 10.1.2.14:3260
/sbin/iscsiadm -m discovery -d 5 -t st -p 10.1.2.15:3260
Which should produce this ...
10.1.2.14:3260,0 iqn.2002-03.com.compellent:5000d31001266823
10.1.2.14:3260,0 iqn.2002-03.com.compellent:5000d31001266825
...then this.
10.1.2.15:3260,0 iqn.2002-03.com.compellent:5000d31001266824
10.1.2.15:3260,0 iqn.2002-03.com.compellent:5000d31001266826
/sbin/iscsiadm --mode node --targetname iqn.2002-03.com.compellent:5000d31001266823 -p 10.1.2.14:3260
/sbin/iscsiadm --mode node --targetname iqn.2002-03.com.compellent:5000d31001266824 -p 10.1.2.15:3260
/sbin/iscsiadm --mode node --targetname iqn.2002-03.com.compellent:5000d31001266825 -p 10.1.2.14:3260
/sbin/iscsiadm --mode node --targetname iqn.2002-03.com.compellent:5000d31001266826 -p 10.1.2.15:3260
cd /var/lib/iscsi/nodes
cd to each directory and then in the directory in that location ...
-- find . -name eth2 -print | awk '{print "vi " $1}' >/tmp/viem; sh /tmp/viem
vi eth2
Change manual to automatic
EX: vi /var/lib/iscsi/nodes/iqn.2002-03.com.compellent:5000d31001266823/10.1.2.14,3260,0/eth2
MIGHT NEED TO REBOOT HERE
/sbin/iscsiadm -m node --interface=eth2 -T iqn.2002-03.com.compellent:5000d31001266823 --login
/sbin/iscsiadm -m node --interface=eth2 -T iqn.2002-03.com.compellent:5000d31001266824 --login
/sbin/iscsiadm -m node --interface=eth2 -T iqn.2002-03.com.compellent:5000d31001266825 --login
/sbin/iscsiadm -m node --interface=eth2 -T iqn.2002-03.com.compellent:5000d31001266826 --login
/sbin/iscsiadm -m session -R
MIGHT NEED TO REBOOT HERE
Get the WID from the disk
/sbin/multipath -l
cdb (36000d310012668000000000000000023) dm-6 COMPELNT,Compellent Vol
size=2.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=0 status=active
|- 4:0:0:1 sdc 8:32 active undef unknown
`- 5:0:0:1 sdd 8:48 active undef unknown
Add that to the /etc/multipath.conf under the bit from above
blacklist_exceptions {
wwid "36000d310012668000000000000000023"
}
multipaths {
multipath {
wwid "36000d310012668000000000000000023"
alias "cdb"
}
{
If you have adding a new disk then put the new wwid ..
multipaths clause
blacklist_exceptions
blacklist_exceptions {
wwid "36000d310012668000000000000000023"
wwid "36000d310012668000000000000000048"
}
multipaths {
multipath {
wwid "36000d310012668000000000000000023"
alias "cdb"
}
multipath {
wwid "36000d310012668000000000000000048"
alias "cdc"
}
{
service multipathd restart
service multipathd status
--- OR ---
If you have added a new disk and a new WWWID to multipath.conf
dmsetup rename mpathc cdc
multipath -ll cdc
To clean up the mpath's that appear that are of no use ...
multipath -ll |egrep mpath |awk '{print $2}' |sed "s/)//g" |sed "s/(//g" |awk '{print "wwid \""$1"\""}'
Place those entries in the top of the /etc/multipath.conf file in the blacklist { section.
MIGHT NEED TO REBOOT HERE
# pvscan ### Get the /dev/disk name of attached media
__________________________________________________________________
# vgscan ### Get the name of the volume group
__________________________________________________________________
ls -l /dev/mapper/cdb
lrwxrwxrwx 1 root root 7 Mar 31 06:42 /dev/mapper/cdb -> ../dm-6
-- Make the new raw device from Compellent into a PhysicalVolume
# pvcreate /dev/mapper/cdb
Physical volume "/dev/mapper/cdb" successfully created.
-- Add the new PV into the existing Volume group
# vgextend <vol grp name> /dev/mapper/cdb
Volume group "<vol grp name>" successfully extended
# vgdisplay <vol grp name> -v | grep 'PV Name'
PV Name /dev/sdb
PV Name /dev/mapper/cdb
-- Move the data from the old device to the new device
(which will bring with it all the LVM meta data)
# pvmove -b /dev/<disc name> /dev/mapper/cdb
root 18150 1 0 11:34 ? 00:00:00 (lvm2) -b /dev/sdb /dev/mapper/cdb
# lvs -a
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
L01 <vol grp name> -wI-ao---- 10.00g
L02 <vol grp name> -wI-ao---- 10.00g
L05 <vol grp name> -wI-ao---- 60.00g
U01 <vol grp name> -wI-ao---- 40.00g
U02 <vol grp name> -wI-ao---- 200.00g
U03 <vol grp name> -wI-ao---- 10.00g
[pvmove0] <vol grp name> p-C-aom--- 330.00g /dev/sdd 64.81 (this is a floating point % done!)
root centos_rhel5-5 -wi-ao---- 35.47g
swap centos_rhel5-5 -wi-ao---- 4.00g
# pvs -a
PV VG Fmt Attr PSize PFree
/dev/<vol grp name>/L01 --- 0 0
/dev/<vol grp name>/L02 --- 0 0
/dev/<vol grp name>/L05 --- 0 0
/dev/<vol grp name>/U01 --- 0 0
/dev/<vol grp name>/U02 --- 0 0
/dev/<vol grp name>/U03 --- 0 0
/dev/centos_rhel5-5/root --- 0 0
/dev/centos_rhel5-5/swap --- 0 0
/dev/mapper/cdb <vol grp name> lvm2 a-- 350.00g 20.00g
/dev/sda1 --- 0 0
/dev/sda2 centos_rhel5-5 lvm2 a-- 39.51g 40.00m
/dev/sdd <vol grp name> lvm2 a-- 350.01g 20.01g
===> INSTALL NEW VMTOOLS <===
===> CLEANUP AND REMOVE OLD iSCSI PIECES <===
-- Now that all the data is moved from the original PV it is no longer needed
==>example: vgreduce Volgrp01 /dev/sdb1
# vgreduce <vol grp name> /dev/<disc name>
Removed "/dev/<disc name>" from volume group "<vol grp name>"
# pvs -a
PV VG Fmt Attr PSize PFree
/dev/<vol grp name>/L01 --- 0 0
/dev/<vol grp name>/L02 --- 0 0
/dev/<vol grp name>/L05 --- 0 0
/dev/<vol grp name>/U01 --- 0 0
/dev/<vol grp name>/U02 --- 0 0
/dev/<vol grp name>/U03 --- 0 0
/dev/centos_rhel5-5/root --- 0 0
/dev/centos_rhel5-5/swap --- 0 0
/dev/mapper/cdb <vol grp name> lvm2 a-- 350.00g 20.00g
/dev/sda1 --- 0 0
/dev/sda2 centos_rhel5-5 lvm2 a-- 39.51g 40.00m
/dev/sdd lvm2 --- 350.01g 350.01g
-- find the IQN names currently seen by the server and ID the EQLG IQN to be removed.
# iscsiadm -m node
10.1.2.14:3260,0 iqn.2002-03.com.compellent:5000d31001266823
10.1.2.14:3260,0 iqn.2002-03.com.compellent:5000d31001266825
10.1.1.1:3260,1 iqn.2001-05.com.equallogic:0-8a0906-944e08909-72d000e47a55193a-rhel5-5
10.1.2.15:3260,0 iqn.2002-03.com.compellent:5000d31001266824
10.1.2.15:3260,0 iqn.2002-03.com.compellent:5000d31001266826
-- logout from target and return to storage administrators
# iscsiadm -m node -T iqn.2001-05.com.equallogic:0-8a0906-944e08909-72d000e47a55193a-rhel5-5 -u
Logging out of session [sid: 5, target: iqn.2001-05.com.equallogic:0-8a0906-944e08909-72d000e47a55193a-rhel5-5, portal: 10.1.1.1,3260]
Logout of [sid: 5, target: iqn.2001-05.com.equallogic:0-8a0906-944e08909-72d000e47a55193a-rhel5-5, portal: 10.1.1.1,3260] successful.
/sbin/iscsiadm -m session -R
/sbin/iscsiadm -m discovery -t sendtargets -p 10.1.1.1:3260 -o delete
cd /var/lib/iscsi/nodes
rm -rf the old iscsi device directory.
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos_rhel5--5-root 36G 4.3G 32G 12% /
devtmpfs 7.9G 0 7.9G 0% /dev
tmpfs 7.9G 84K 7.9G 1% /dev/shm
tmpfs 7.9G 9.0M 7.9G 1% /run
tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup
/dev/sda1 497M 215M 283M 44% /boot
/dev/mapper/<vol grp name>-U01 40G 6.3G 32G 17% /u01
/dev/mapper/<vol grp name>-L02 9.8G 23M 9.2G 1% /l02
/dev/mapper/<vol grp name>-L01 9.8G 196M 9.1G 3% /l01
/dev/mapper/<vol grp name>-U03 9.8G 23M 9.2G 1% /u03
/dev/mapper/<vol grp name>-U02 197G 99G 89G 53% /u02
/dev/mapper/<vol grp name>-L05 59G 20G 37G 36% /l05
tmpfs 1.6G 16K 1.6G 1% /run/user/42
tmpfs 1.6G 0 1.6G 0% /run/user/0
'FREE' the network device:
ifconfig -a
tcpdump -v -i eth1
iptraf eth1
ifdown eth1
cd /etc/sysconfig/network-scripts
mv ifcfg-eth1 NIU-ifcfg-eth1