1834935 Members
2221 Online
110071 Solutions
New Discussion

Re: LVM questions

 
Deepak Seth_1
Regular Advisor

LVM questions

i want to mount my snapshot to another host . How will i know which PV belongs to which VG .
Let say production host have 2 VG - vga , vgb
Each VG have 2 PV's . How will i know sitting on host B(backup host which uses snap) that this which PV belongs to which VG .
I want to script this so i don't know to hard code the VG/PV in some config file.

Did i confused yoou .
15 REPLIES 15
Tim Nelson
Honored Contributor

Re: LVM questions

You do not know...That is where the secret lies.

Typically the LUN number assignment of the snap to serverB is the clue. You will also need the map file from the vgexport -p on the first server and mountpoints unless you do not care about this stuff.
Deepak Seth_1
Regular Advisor

Re: LVM questions

but where do you get a LUN number of snap on host b ? I know i can find a LUN id using power path command on host b but unfortunately i don't have the power path on the host a . tell me some way to match the LUN id on host a and b .
Tim Nelson
Honored Contributor

Re: LVM questions

That would be the tough part.

While I was doing this on EMC systems with BCVs I used the symbcv command to ID the SYMID and relate it to a /dev/dsk/cxtxdx.

I do not currently use EVA snaps so I do not know the answer hopefully someone else will chime in.


Torsten.
Acclaimed Contributor

Re: LVM questions

There are special tools for almost each array family to find this kind of information, e.g. evainfo for EVA arrays.

But you can also calculate the LUN# from hardware path, see for example

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=985836

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Sandeep_Chaudhary
Trusted Contributor

Re: LVM questions

if u r using XP storage u can use Business Copy tool .
To get LUN info u can use "xpinfo -i" command

to create pair "paircreate"
to sync pair "pairsync"
split pair "pairsplit"

please download detailed document.
sreekanthtm
Trusted Contributor

Re: LVM questions

Hi,

Whats the status now?? Is the snapshot volume mounted in the production box?
Which storage array you are using?
Snapshot volume needs to be mounted just like any other LV. Create the map file (vgexport -p -v -s -m) then import the same in the other server. (vgimport). If you have a map file created with -p -s option, then no need to worry about the PV name. System will do a search in the storage pool using the VGID and include all the PV with the same VGID while importing the VG. Don't forget to run vgchgid Before activating the new(imported) VG.

Rgds
Sreekanth

Re: LVM questions

Thanks Sreekanth - I was going to ask why no-one had pointed out the obvious - create a map file using "vgexport -p -s ...", copy to the new machine and import using vgimport. You never really need to know which disks are which when LVM can figure it out for itself.

Although you only need to run vgchgid if attempting to mount on the same host as the original, or if the original copy was a cluster VG.

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Deepak Seth_1
Regular Advisor

Re: LVM questions

Thanks everybody for pitching in . I know about the vgexport -s option but always thought that we need to specify atleast a one disk. But i will give a try . Some how my epxerience using the vgimport command is mixed and sometime goving just a single PV works and some time you need to specify all the PV's (even if u create a map file with -s option ) . But that might be related to some LVM patch issues .


Deepak Seth_1
Regular Advisor

Re: LVM questions

I did a quick test

Host B - other Server .
copy the map file i created to Host B
=--------
(herhxp03 root):/tmp> more vgrd5.map
VGID 07b7c78e4880cacd
1 lvol1
-----
No PV specified - just used the map file which has the VGID
---------
(herhxp03 root):/tmp> vgimport -p -s -v -m vgrd5.map /dev/vgrd5-bvdb1
Beginning the import process on Volume Group "/dev/vgrd5-bvdb1".
Warning: Cannot determine block size of Physical Volume "/dev/rdsk/c18t0d3".
Assuming a default value of 1024 bytes. Continuing.
Warning: Cannot determine block size of Physical Volume "/dev/rdsk/c18t0d4".
Assuming a default value of 1024 bytes. Continuing.
Warning: Cannot determine block size of Physical Volume "/dev/rdsk/c20t0d3".
Assuming a default value of 1024 bytes. Continuing.
Warning: Cannot determine block size of Physical Volume "/dev/rdsk/c20t0d4".
Assuming a default value of 1024 bytes. Continuing.
Couldn't access the list of physical volumes for volume group "/dev/vgrd5-bvdb1".
------
Used the map file and specified the PV
----
(herhxp03 root):/tmp> vgimport -p -v -m vgrd5.map /dev/vgrd5-bvdb1 /dev/dsk/c18t0d1
Beginning the import process on Volume Group "/dev/vgrd5-bvdb1".
vgimport: Physical Volume "/dev/dsk/c18t0d1" contains no LVM information
Verification of unique LVM disk id on each disk in the volume group
/dev/vgrd5-bvdb1 failed.

Both failed . I really like to see the first one successful as this will help me making a shell script without worrying about the PV's .

Ivan Krastev
Honored Contributor

Re: LVM questions

Are you sure that this LUN(s) are visible from both nodes?
vgimport command scan presented to the server LUNs for given VGID and add it to the group.
Check for CU:LDEV (or WWNID)settings of luns to find the correct ones.

regards,
ivan
Deepak Seth_1
Regular Advisor

Re: LVM questions

we have a clariion . I use the snap view to snap the source LUN with clariion LUN . Then i assign the snap LUN to Host B . I can see the snap LUN using ioscan or inq command .

inq output
------
/dev/rdsk/c2t8d0s3 :HP 146 G:ST3146855LC :HPC8 :3LN4HKD7 : 409600
/dev/rdsk/c18t0d0 :DGC :CX3-80WDR10 :HP03 :Ch2 CONT :209715200
/dev/rdsk/c18t0d1 :DGC :CX3-80WDR5 :HP03 :Ch2 CONT :31457280
/dev/rdsk/c18t0d2 :DGC :CX3-80WDR5 :HP03 :Ch2 CONT :10485760
80WDR10 :HP03 :Ch2 CONT :209715200
/dev/rdsk/c20t0d1 :DGC :CX3-80WDR5 :HP03 :Ch2 CONT :31457280
/dev/rdsk/c20t0d2 :DGC :CX3-80WDR5 :HP03 :Ch2 CONT :10485760
/dev/rdsk/c20t0d5 :DGC :CX3-
LUN with 314... and 104.. are the snap LUNS on host B.

Something is going on ...

did few more things . but still no luck .

powermt check
Warning: CLARiiON device path c18t0d3 is currently dead.
Do you want to remove it (y/n/a/q)? y
Warning: CLARiiON device path c18t0d4 is currently dead.
Do you want to remove it (y/n/a/q)? y
Warning: CLARiiON device path c20t0d3 is currently dead.
Do you want to remove it (y/n/a/q)? y
Warning: CLARiiON device path c20t0d4 is currently dead.
Do you want to remove it (y/n/a/q)? y
(herhxp03 root):/tmp> vgimport -p -s -v -m vgrd5.map /dev/vgrd5-bvdb1
Beginning the import process on Volume Group "/dev/vgrd5-bvdb1".
Couldn't access the list of physical volumes for volume group "/dev/vgrd5-bvdb1".
(herhxp03 root):/tmp> vgimport -p -v -m vgrd5.map /dev/vgrd5-bvdb1 /dev/dsk/c18t0d1
Beginning the import process on Volume Group "/dev/vgrd5-bvdb1".
vgimport: Physical Volume "/dev/dsk/c18t0d1" contains no LVM information
Verification of unique LVM disk id on each disk in the volume group
/dev/vgrd5-bvdb1 failed.


Deepak Seth_1
Regular Advisor

Re: LVM questions

kill me . my fault . forget to activate the snap copy . activating it resolve all the issues . no need to specify any PV if the map file is created with -s flag .
vgimport -p -s -v -m vgrd5.map /dev/vgrd5-bvdb1
Beginning the import process on Volume Group "/dev/vgrd5-bvdb1".
Logical volume "/dev/vgrd5-bvdb1/lvol1" has been successfully created
with lv number 1.
Volume group "/dev/vgrd5-bvdb1" has been successfully created.


thanks
Deepak Seth_1
Regular Advisor

Re: LVM questions

Thanks for everybody replies . I will continue to work on my shell script .
sreekanthtm
Trusted Contributor

Re: LVM questions

Encourage them, who worked along with you, please assign points...
Deepak Seth_1
Regular Advisor

Re: LVM questions

i do it all the time . thanks for the reminder.