LVM and VxVM

Exporting and importing volumes groupe to an other serveur

 
SOLVED
Go to solution
CSP_ALGERIA
Frequent Advisor

Exporting and importing volumes groupe to an other serveur



hello ,

we have two serveurs Hp9000 (rp8400) running under hpux 11i.
we use the first one as a principal serveur with diferent volumes groupes created using servral LUNs in a VA 7410 ( about 64 Lun ).

we wante to use the second serveur as a backup serveur if the first one fail ( with out using MC service guard ).

when we do an ioscan from the first serveur ,we have all devices files about all Luns .

And when we do an ioscan from the second serveur ( backup ) we have the same devices files about all those luns .

please give us all the steps to do a restore all the configuration and volumes groupes using the second serveur ( backup ) if the first one fail ,with out risks for the data costumer.

Using for example vgimport with a mapfile created before in the first serveur , or doing a vgcfgbackup with files in /etc/lvmconf existing in the first serveur .

thanks for the help.

best regards.
Nothing in the world can take the place of persistence.
10 REPLIES 10
James Murtagh
Honored Contributor
Solution

Re: Exporting and importing volumes groupe to an other serveur

Hi,

I can give you an example how to import one volume group to another server. However, note there are several other things you should consider:

Kernel parameters - make sure they are the same on both servers
/etc/fstab - this will need to be updated to reflect the new filesystems
Startup scripts - you will need any application scripts copied over and linked as normal

These are just things off the top of my head, there may be more.

This is an example of importing vg01 to another server. You wouldn't use vgcfgbackup/vgcfgrestore as you are talking about the same disks - they already have the LVM information on them!

1) Check the minor number of the group file on the primary server

# ll /dev/vg01/group

2) Create a map file and outfile of the disks, to save you entering them all in the vgimport

# vgexport -p -v -m /tmp/vg01.map -f /tmp/disks.map vg01

3) Transfer the mapfiles to the secondary server

4) Make the vg01 directory and group file

# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x010000

0x010000 should be the same as you found from step one, keeps everything aligned.

5) Import the VG

# vgimport -v -m /tmp/vg01.map -f /tmp/disks.map vg01

Regards,

James.
Pete Randall
Outstanding Contributor

Re: Exporting and importing volumes groupe to an other serveur

Just a couple of comments on James' well thought out and well documented procedure. In step 2, the export in preview mode, I would use the -s option rather than -f: "vgexport -p -s -m /tmp/vg01.map vg01". Then, in step 5, when you actually import the volumes, I would use the -s option again: "vgimport -s -m /tmp/vg01.map vg01".

It's a subtle difference but proven to work, for me, at least.


Pete

Pete
James Murtagh
Honored Contributor

Re: Exporting and importing volumes groupe to an other serveur

Hi Pete,

Yeah, wasn't sure if that only worked with S/G, the "Series 800 Only" warning in the man page put the suspicion in my mind! I also couldn't test on my workstation. I would go with that as it doesn't activate the VG.

Cheers,

James.
Pete Randall
Outstanding Contributor

Re: Exporting and importing volumes groupe to an other serveur

James,

It works like a charm, even in a non S/G environment!!

Cheers,
Pete

Pete
Pete Randall
Outstanding Contributor

Re: Exporting and importing volumes groupe to an other serveur

Oh yeah, we better add step 6, then: vgchange -a y vg01


Pete

Pete
Ravi_8
Honored Contributor

Re: Exporting and importing volumes groupe to an other serveur

Hi,

Pete

In the step 2 which James has given -p is only for preview. it wouldn't actually export.

you need to use the step 2 without -p.

and ofcourse as we all can see after importing,
another step is needed to activate vg (vgchange -a y vg01)
never give up
James Murtagh
Honored Contributor

Re: Exporting and importing volumes groupe to an other serveur

Hi Ravi,

We don't actually want to export it, just create the map file. We just need to get the lvmtab updated and device files created on the other host.

Regards,

James.
Ravi_8
Honored Contributor

Re: Exporting and importing volumes groupe to an other serveur

James

I agree with u
never give up
Pete Randall
Outstanding Contributor

Re: Exporting and importing volumes groupe to an other serveur

One more (hopefully final) thought:

You can probably do the vgimport ahead of time, leaving only the "vgchange -a y vg01" to be done at switchover, but you would want to be absolutely sure that the vgchange was NEVER run while the original server was still up and accessing the data.


Pete

Pete