Archive

Posts Tagged ‘Multipath’

Expanding a multipath iSCSI storage on XenServer 6.2

February 7, 2015 Leave a comment

We have everyone been there. Running out of storage. So new disks are installed and the iSCSI LUN has been increased. But in XenCenter the SR still shows the old size. So, what next?

First step is to get the updated size in the iSCSI layer. By using the fdisk utility you get the size of the disks in you environment:

fdisk -l /dev/sd[bdcefghi] 3>&1 2>&3

Replace the content between the brackets with the matching disks from you system.
In this example, /dev/sdh is the drive being expanded (and /dev/sdi since we are on a multipath system).

After taking note of the current size, run iscsiadm to get the updated size:

iscsiadm -m node -R

Running fdisk again should now show the new updated size. If not, no need to carry on reading this article…

Then we need to update the multipath layer. First run:

mpathutil status

locate the disk you are expanding, and note the scsi id, looking something like “3600000e00d1100000011219400020000” and then run

multipathd -k”resize map [scsi_id]” 

Running the mpathutil again should give you the new size.

Now lets update the LVM layer. Get the UUID of the SR, either from XenCenter or running:

xe sr-list name-label”xxxx”

Then get the device-name by using

pvs | grep [uuid]

And then resize it:

pvresize [device-name]

In my environment the device name was “/dev/mapper/3600000e00d1100000011219400020000”

Finally doing a rescan in XenCenter should give you the new size.

Thanks to “White Rooms Labs

CentOS fibre channel multipath


1.
On the machine where you want to setup multipath you first need to find the WWN’s of the FC cards:

[root@admin ~]# cat /sys/class/scsi_host/host*/device/fc_host*/port_name
0x50014380029d41dc
0x50014380029d40b8
2.
Now I have the WWN’s i can add them to my multipath config  (/etc/multipathd.conf)
blacklist {
devnode "*"
}

blacklist_exceptions {
devnode "^sd[b-z].*"
}

defaults {
udev_dir                /dev
polling_interval        5
selector                "round-robin 0"
path_grouping_policy    failover
getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
prio_callout            /bin/true
path_checker            readsector0
rr_min_io               100
max_fds                 8192
rr_weight               priorities
failback                immediate
no_path_retry           fail
user_friendly_names     yes
}

multipaths {
multipath {
wwid                    0x50014380029d41dc
alias                   fc1
path_grouping_policy    multibus
path_checker            readsector0
path_selector           "round-robin 0"
failback                manual
rr_weight               priorities
no_path_retry           5
}
multipath {
wwid                    0x50014380029d40b8
alias                   fc2
}
}

3.
Now i have the default configuration I can do a dry run to see what devices would be created:

[root@admin ~]# /sbin/multipath -v2 -d

This will list all the mpath devices that would be created, you should see a line similar to:

: mpath4 (360000000000000000000000000000000)  HP,P2000 G3 FC

This ID can be used to create an alias to your volume:

multipath {
wwid                    360000000000000000000000000000000
alias                   myvolumename
}

Add this to the multipaths section of your multipath.conf file.

4.
Now make sure the multipathd service is on:

[root@admin ~]# chkconfig multipathd on

5.
Then start multipath:

[root@admin ~]# service multipathd start
Starting multipathd daemon

You should now have your multipath volume in /dev/mapper

or visible by doing

[root@admin ~]# fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
64 heads, 32 sectors/track, 152627 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         100      102384   83  Linux
/dev/sda2             101      152627   156187648   8e  Linux LVM

Disk /dev/sdd: 49.9 GB, 49999986688 bytes
64 heads, 32 sectors/track, 47683 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdd doesn't contain a valid partition table

Disk /dev/sdh: 49.9 GB, 49999986688 bytes
64 heads, 32 sectors/track, 47683 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdh doesn't contain a valid partition table

Disk /dev/sdl: 49.9 GB, 49999986688 bytes
64 heads, 32 sectors/track, 47683 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdl doesn't contain a valid partition table

Disk /dev/sdp: 49.9 GB, 49999986688 bytes
64 heads, 32 sectors/track, 47683 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdp doesn't contain a valid partition table

Disk /dev/dm-3: 49.9 GB, 49999986688 bytes
255 heads, 63 sectors/track, 6078 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

6.
Now you can see your new volume, in this case /dev/dm-3

Create new partition:

[root@admin ~]# fdisk /dev/dm-3

7.
once the new partition is created you can create filesystem

[root@admin ~]# mkfs.ext3 /dev/dm-3p1

8.
and finally mount your volume somewhere

[root@admin ~]# mount /dev/dm-3p1 /mnt/myvolume
Tags: ,
%d bloggers like this: