Operating System - HP-UX
1826658 Members
2339 Online
109695 Solutions
New Discussion

vgimport to vPar from VM guest

 
Shibin_2
Honored Contributor

vgimport to vPar from VM guest

Hi,

I was trying to recreate a VG from a HP-UX VM Guest to vPar. But, when I tried to do vgimport @ vPar, it shows the following error.

root@hrv87:(lvmconf)> vgimport -s -v -m /etc/lvmconf/vgsap3.map /dev/vgsap3
Beginning the import process on Volume Group "/dev/vgsap3".
Couldn't access the list of physical volumes for volume group "/dev/vgsap3".


Can we recreate VG from VM Guest to vPar? I mean, by doing vgexport at VM Guest and vgimport at vPar ?

I have recreated the VGs from vPar to vPar or other physical servers. Never encountered a problem like this.
Regards
Shibin
19 REPLIES 19
SoorajCleris
Honored Contributor

Re: vgimport to vPar from VM guest

Hi Shibin,

May I understand the requirement?

I am not able to understand the logic!!!

Regards,
Sooraj
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
Shibin_2
Honored Contributor

Re: vgimport to vPar from VM guest

Hi Sooraj,

We have created a VG in VMguest. But later stage, application team requested this need to be moved to another machine, which is a vPar. Since the size of VG and LV and other details are not changing, except the disks, thought to use vgexport on VM guest and vgimport on vPar.

While doing vgimport, as you can see, we received the errors.

Hope you could now understand.
Regards
Shibin
SoorajCleris
Honored Contributor

Re: vgimport to vPar from VM guest

Hi,

===> I hope you have mapped the Disks belongs to the VG directly from HPVM host to guest. ( not LVs/or files).

If you map like this also the disk device which detects in VM Guests will have different hardware path.

Thats why it is giving error.

Are you assigning the same LUN to the new server ? or moving the same disks from VM host to the new server ?

Regards,
Sooraj

"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
Shibin_2
Honored Contributor

Re: vgimport to vPar from VM guest

Hi Sooraj,

You are correct. we have have mapped the Disks belongs to the VG directly from HPVM host to guest. ( not LVs/or files).

After done the vgexport, removed these maps and removed the LUNs from VM host and assigned to vPar.

I guess, the point you have highlighted is correct. Since, the hardware path / driver of the disks in VM guests and vPar are different.

Is that the reason?

Btw, I had to create the VG manually on the vPar, due to the urgency.
Regards
Shibin
Kapil Jha
Honored Contributor

Re: vgimport to vPar from VM guest

I think it would work perfectly all you have to do is

1) get map file
2) export and remove PVs from VM.
3) move PVs to vpar.
4) create directories and make sure those disks are accessible to vPar.(this is imp)
5) vgimport

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Aneesh Mohan
Honored Contributor

Re: vgimport to vPar from VM guest

Hi Shibin,

>>> Couldn't access the list of physical volumes for volume group "/dev/vgsap3"

vgimport with "-s" is not depened on the disk hardware path ,it will scan the disks with vgid ,and imports the disks they are matching.

The problem could be all disks which were in the volume group might not be presented/detected in the vpar machine (where you are doing vgimport)

if you are sure all the disks are available in the vpar,then please confirm the vgid`s of the disks using

# echo 0x2010?2D | adb /dev/dsk/c2t0d0

Aneesh

Shibin_2
Honored Contributor

Re: vgimport to vPar from VM guest

Kapil,

The same way what you were telling, was followed.

Aneesh,

I agreed, the -s need to use, only when you are sharing the disks in the scenario like cluster environment.

A doubt come on this. I guess, when we moved, we have done the pvcreate on these disks. Could that be the issue?

Also, what I can understand, if the disks moving from VM hosts to vPar, and to import the VG, need to use the following way:

vgimport -vm

Is this the correct way we need to use? Anyway, I can't try it out now. But we can discuss on it.
Regards
Shibin
Aneesh Mohan
Honored Contributor

Re: vgimport to vPar from VM guest

>>A doubt come on this. I guess, when we moved, we have done the pvcreate on these disks. Could that be the issue?


If you did pvcreate with force option "-f" to the pv`s, then the lvm layout of the pv got wipped,offcourse vgimport will throw error.

Aneesh
Aneesh Mohan
Honored Contributor

Re: vgimport to vPar from VM guest

one more thing

a) vgimport -vm

b) vgimport -v -s m

See the difference of the above commands, in (b) you don`t need to specify disks explicitly .For doing this you may need to export vg with "-s" option.


Aneesh
Torsten.
Acclaimed Contributor

Re: vgimport to vPar from VM guest

>>A doubt come on this. I guess, when we moved, we have done the pvcreate on these disks. Could that be the issue?

The pvcreate kills your data and delete the old VG configuration. They are just new and blank disks now.

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!   
Shibin_2
Honored Contributor

Re: vgimport to vPar from VM guest

Aneesh,

Option a) (without -s ), I mentioned, can be used if I do pvcreate on these disks?

What if option b) if I exported with -s and didn't do pvcreate ?

Regards
Shibin
Torsten.
Acclaimed Contributor

Re: vgimport to vPar from VM guest

If you really used pvcreate there is nothing to import anymore.

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!   
Aneesh Mohan
Honored Contributor

Re: vgimport to vPar from VM guest

Hi Shibin,

Option a) (without -s ), I mentioned, can be used if I do pvcreate on these disks?


No.If you did pvcreate on the disks , then old vg configuration has wipped ,you cannot import it.



What if option b) if I exported with -s and didn't do pvcreate ?
Simple,you should not do pvcreate while vgexport/vgimport operations.

Using vgexport/vgimport operation ,you are using lvm information from the disks to remap ,if you do pvcreate in between then the lvm information from the disk is lost.


Please see more information about vgexport/vgimport links below.

Incorrect use of vgexport/vgimport.
----------------------------------

http://www13.itrc.hp.com/service/cki/docDisplay.do?docLocale=en&docId=emr_na-c00929337-3


Prepare LVM for hardware / disk / lun changes
--------------------------------------------
http://www13.itrc.hp.com/service/cki/docDisplay.do?docLocale=en&docId=emr_na-c00931856-5



Aneesh
Kapil Jha
Honored Contributor

Re: vgimport to vPar from VM guest

after pvcreate everything is gone, no way u can get the data except from backup.
So recreate VG/LVs and restore data.

I have one question to Gurus!!
[you can hit me is its irrelevent].

In this case if we have done pvcreate and we have a full dd of initial blocks.
Can we get LVM configuration back.
Never got chance to try it, but as per me it should work.

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Torsten.
Acclaimed Contributor

Re: vgimport to vPar from VM guest

I would assume (not tested) that a vgcfgrestore would bring it back.

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!   
Kapil Jha
Honored Contributor

Re: vgimport to vPar from VM guest

HI Shibin,

you can try vgcfgrestore if you have time.
vgcfgrestore -f /tmp/vg00.backup /dev/rdsk/c0t4d0

man vgcfgrestore

and let us know if that worked, m not sure if you have backup of LVM config.

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Aneesh Mohan
Honored Contributor

Re: vgimport to vPar from VM guest

Hi,

yes and no

Yes:-
If you are doing pvcreate -f ..then after vgcfgrestore to a disk ,you can get back the structure and data .

No:--
If you are doing pvcreate -fB to a disk that wasn`t previously bootable then you may not able to get it back as previous.


Aneesh
SoorajCleris
Honored Contributor

Re: vgimport to vPar from VM guest

Yes , as aneesh told it you made if bootable, you have a tough time.

I do remember long back once I did dd first 1 MB and used vgcfgrestore, it was working fine..

* Never play with customers data disk :P

Regards,
Sooraj
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
Shibin_2
Honored Contributor

Re: vgimport to vPar from VM guest

The discussion was enriched my knowledge. Thanks to all of you, who participated.
Regards
Shibin