Operating System - Linux
1827847 Members
2108 Online
109969 Solutions
New Discussion

multipath with lvm after vdisk snapclone not working

 
SOLVED
Go to solution
Oxiel Contreras
Occasional Contributor

multipath with lvm after vdisk snapclone not working

Hello Gurus.

BL465cg5 and EVA 4400, with four paths to same disk, installed RHEL5.3 with mpath and build / on LVM to a vdisk. Everything worked without problems.

/etc/fstab is:

/dev/mapper/mpath0p1 /boot ext3 defaults 1 2
/dev/vgsys/lvroot / ext3 defaults 1 1
/dev/vgsys/lvswap swap swap defaults 0 0

# pvs
PV VG Fmt Attr PSize PFree
/dev/mapper/mpath0p2 vgsys lvm2 a- 49.71G 0

If i make a snapclone (B) from the above original vdisk (A), and present (B) to a new blade, it boots fine, but the LVM does not see the mpath0p2 as PV, and complains about seeing various disks with the same PV and finally boots with the last disk+partition /dev/sdd2.

# pvs
Found duplicate PV mSN1J0OCzMd5cheNJvqT028dRry7nZsf: using /dev/sdb2 not /dev/sda2
Found duplicate PV mSN1J0OCzMd5cheNJvqT028dRry7nZsf: using /dev/sdc2 not /dev/sdb2
Found duplicate PV mSN1J0OCzMd5cheNJvqT028dRry7nZsf: using /dev/sdd2 not /dev/sdc2
PV VG Fmt Attr PSize PFree
/dev/sdd2 vgsys lvm2 a- 49.71G 0

There're no mpath* devices in /dev/mapper/ whith this new vdisk (B).

How can i make multipath work again with this vdisk (B) with LVM ?

Note: With previous multipath from QLogic/Emulex, had never this issue while presenting cloned vdisks.

Regards.
5 REPLIES 5
Matti_Kurkela
Honored Contributor
Solution

Re: multipath with lvm after vdisk snapclone not working

Does this RedHat Knowledge Base article match your situation?

http://kbase.redhat.com/faq/docs/DOC-17660

Is the /etc/multipath.conf file configured the same in both blades?

The EVA probably has some host-specific and/or HBA-specific settings. Are these configured identically for both blades?

MK
MK
Oxiel Contreras
Occasional Contributor

Re: multipath with lvm after vdisk snapclone not working

Thank you Matti.

That's right, the above link is the solution.

Do you know if it's possible to do it without booting from rescue CD; i've just tried to the same with debian-lenny x86_64, and there's no need to do nothing, it works just with booting the new cloned vdisk.

Closing the thread and assigning points.

Regards.
Matti_Kurkela
Honored Contributor

Re: multipath with lvm after vdisk snapclone not working

RedHat seems to be exceedingly conservative here. The mkinitrd script builds the initramfs system startup script ("/init" within initramfs) with commands like this:

if [ "$use_multipath" == "1" ]; then
emit "echo Creating multipath devices"
for wwid in $root_wwids ; do
emit "/bin/multipath -v 0 $wwid"
done
emit "dmsetup ls --target multipath --exec 'kpartx -a -p p'"
fi

This is apparently meant to maximize the preservation of the /dev/mapper/mpath* device names in case the root filesystem is on a multipathed disk without LVM.

(At this point, the system is working on a copy of /var/lib/multipath/bindings included in the initramfs. This copy may be older than the current version of the bindings file on the real filesystem.

Activating only the disks required for the root filesystem minimizes the chance that the system accidentally usurps a mpath "friendly name" that is already allocated to another WWID in the real bindings file.)

But *if* the system uses LVM for everything except /boot *and* we accept that the /etc/fstab line of the /boot filesystem may require sysadmin attention after a clone operation, this could be simplified to:

if [ "$use_multipath" == "1" ]; then
emit "echo Creating multipath devices"
emit "/bin/multipath -v 0"
emit "dmsetup ls --target multipath --exec 'kpartx -a -p p'"
fi

I think this modification would be enough to make the snapclone system come up at least to the single-user mode.

(Hmm... If the /boot filesystem is specified in /etc/fstab using a LABEL= or UUID= syntax and if the mount command will automatically prefer multipath devices over regular /dev/sd* whenever a LABEL/UUID specification can apply to multiple devices, the snapcloned system might even boot all the way up!)

Of course, this modification to mkinitrd and a re-generation of the initrd file must be done before snapcloning the system.

MK
MK
Oxiel Contreras
Occasional Contributor

Re: multipath with lvm after vdisk snapclone not working

Thank you Matti.

Will check the script to have a deeper understanding of what they do with initrd, great explanation.

Best regards.

Closing the thread.
Oxiel Contreras
Occasional Contributor

Re: multipath with lvm after vdisk snapclone not working

Found very good information and solutions to my question.