Operating System - HP-UX
1832978 Members
2772 Online
110048 Solutions
New Discussion

Re: lvcreate in Cluster aware vg of package without pkghalt

 
HP-UX admin
Occasional Advisor

lvcreate in Cluster aware vg of package without pkghalt

Hi,
Is it possible to lvcreate in Cluster aware vg of the package without doing pkghalt.So that adoptive node will aware of this LV.
Can I do it Online without halting Package or Cluster.
thanks.
9 REPLIES 9
sajeer_2
Regular Advisor

Re: lvcreate in Cluster aware vg of package without pkghalt


NO.You have to shutdown package.

You have the following steps

Halt package
In the primary node,
vgchange -a e /dev/vgXX
lvcreate -L sizeinMB -n name /dev/vgXX
vgexport -p -v -s -m vgXX.map /dev/vgXX
rcp vgXX.map node2:/vgXX.map

In other nodes,you have to export the vgXX configuration and import it.
vgexport /dev/vgXX
mkdir /dev/vgXX
mknod /dev/vgXX/group c 64 0x020000
vgimport -v -s -m /vgXX.map

Regards,
Sajeer



Frank de Vries
Respected Contributor

Re: lvcreate in Cluster aware vg of package without pkghalt

No you can do it perfectly online.

Please note in the previous answer
there is a contradiction.

(I have removed the halt pkg instruction)

In the primary node,
vgchange -a e /dev/vgXX
lvcreate -L sizeinMB -n name /dev/vgXX
vgexport -p -v -s -m vgXX.map /dev/vgXX
rcp vgXX.map node2:/vgXX.map

In other nodes,you have to export the vgXX configuration and import it.
vgexport /dev/vgXX
mkdir /dev/vgXX
mknod /dev/vgXX/group c 64 0x020000
vgimport -v -s -m /vgXX.map

Another remark:

It is a good idea to to a ls -lR > log.lst of the/dev/vgXX so you have a list of
all the minor node id's

Look before you leap
Gerardo Mora
Advisor

Re: lvcreate in Cluster aware vg of package without pkghalt

Hi,

I'm agree with Frank, I do that job periodically and it works fine, but also I have to add the new logical volume in package_name.ctrl file and copy that file to all nodes in the cluster.
share to learn
Kevin Wright
Honored Contributor

Re: lvcreate in Cluster aware vg of package without pkghalt

absolutely. Make sure the pkg control file is updated with your new lvol. vgexport/vgimport the VG.

Test at your next maint. window.
Kasper Hedensted
Trusted Contributor

Re: lvcreate in Cluster aware vg of package without pkghalt

You could test it right away on the adoptive node:

vgchange -a r
mount filesystem
umount filesystem
vgchange -a n

remember to "vgchange -a n" or else the package will not be able to failover at later time.

Cheers,
Kasper
Geoff Wild
Honored Contributor

Re: lvcreate in Cluster aware vg of package without pkghalt

Yes you can do it online!

See table 7.1:

http://docs.hp.com/en/B3936-90079/ch07s04.html

After that, you have to create a new map file on that node
vgexport -p -s -v -m /tmp/vgXX.map /dev/vgXX

copy that to adotive node,

on adoptive node, make note of the minor number:

ll /dev/vgXX/group

vgexport /dev/vgXX
mkdir /dev/vgXX
mknod /dev/vgXX/group c 64 0xHH0000

vgimport -s -v -m /tmp/vgXX.map /dev/vgXX


NOTE: XX= number of your vg
HH = hex value of minor number..

Example - vg05 should have group file 0x050000
vg10 should have group 0x0a0000

Now that isn't mandatory - but trust me - you want it that way.


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
HP-UX admin
Occasional Advisor

Re: lvcreate in Cluster aware vg of package without pkghalt

Thanks.

Some of u suggested to do vgchange -a e & add that LV in Package control script.
Why this is required?
nanan
Trusted Contributor

Re: lvcreate in Cluster aware vg of package without pkghalt

Hi! admin
The main reason why you have to do vgchange -a e is that just you can create lvols exclusive mode, i mean you can't create shared mode.
Cluster wide volumes should keep consistency for the access so when you configure your cluster using exclusive file system, the system which is handling those cluster filesystems have to open the vgs to exclusive mode.

Anyway, you can create cluster vgs online without haltpkg.
As previous stated, you have to do vgexport and vgimport

but you can't create cluster package using shared mode

Regards
nanan
Stephen Doud
Honored Contributor

Re: lvcreate in Cluster aware vg of package without pkghalt

If vgdisplay reports the status of the VG as:
available, exclusive
then it is possible to lvcreate a new volume in the VG while the package is running.
In order to know what must be done on a Serviceguard cluster to accommodate the lvcreate, you need to know that lvcreate modifies the VGDA (LVM structures on the disk) and does a couple of mknod's in the /dev/ directory. lvcreate does not modify the /etc/lvmtab file.
Once the new logical volume is created, you probably want to create a file system in i, and have the package control script mount it - correct?
Therefore, the following is necessary as a result of the lvcreate:
1) On the node where the lvcreate was performed, newfs a file system on the new lvol
2) Edit the package control script to reference the new file system, and copy the update to the other node.
3) On the other node, update /dev/ by either manually performing the mknod's to duplicate the new lvol/rlvol pair, or vgexport and re-import (vgimport) the VG.

All of this can be done while the VG is active and operating under control of Serviceguard, in a package.