1832891 Members
2462 Online
110048 Solutions
New Discussion

Add LV and VG to SG.

 
SOLVED
Go to solution
chapaya_1
Frequent Advisor

Add LV and VG to SG.

Hi ,
I have SG with 2 nodes and 2 packages .
I need to create new VG on the first package and a new LV on the second package , do i need to shutdown the cluster .

Give me pls the commands to do this task .

Bye.
11 REPLIES 11
Geoff Wild
Honored Contributor

Re: Add LV and VG to SG.

Nope - can be done online...

http://docs.hp.com/hpux/onlinedocs/B3936-90073/B3936-90073.html

Basically,


Create vg on first node:
mkdir /dev/vgXX
mknod /dev/vgXX/group c 64 0xHH0000
vgcreate -s 8 -p 128 /dev/vgXX /dev/dsk/cXtXdX

XX is vg number, HH is minor number in Hex.

Create a map file:

vgexport -s -v -p -m /tmp/vgXX.map /dev/vgXX

copy that file to other node.

Then on that node:
mkdir /dev/vgXX
mknod /dev/vgXX/group c 64 0xHH0000
vgimport -s -v -m /tmp/vgXX.map /dev/vgXX

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.
chapaya_1
Frequent Advisor

Re: Add LV and VG to SG.

Hi ,

Regards to new LV in existing VG :
do i need to shutdown the cluster ?
or package ? and to use cmapplyconf ?

BYE
Geoff Wild
Honored Contributor

Re: Add LV and VG to SG.

The cluster and package can remain up when adding a new lv to an existing vg.

That managing MC/SG doc is great for this and other questions.

You may also want to take the MC/SG Service Guard I class.

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.
Ashwani Kashyap
Honored Contributor

Re: Add LV and VG to SG.

Ragrding the new LV . no you don't have to shutdown the cluster . Just add the new LV as you would do normally , then export that VG on the primary in shred and preview mode abd import it back on the adoptive node as Geoff explained earlier .

after you have done everything i.e creating the new VG and LV , don't forget to update the cmclconf.ascii file and the package confing and control files .

The new VG can be made cluster aware by doing this :
vgchange -c y /dev/vg_name .
chapaya_1
Frequent Advisor

Re: Add LV and VG to SG.


still need more info about adding new LV to a package ...

BYE .
Ashwani Kashyap
Honored Contributor
Solution

Re: Add LV and VG to SG.

OK .

Identify the VG where you need to add the new LV . Make sure it has enough space for your new LV .

Now from the node where your package is running , do :

#lvcreate -n lv_name /dev/vg_name
#lvextend -L (LV_SIZE)MB /dev/vg_name/lv_name

create the file system on the new LV now :
#newfs -F vxfs -b 8192 -o largefiles /dev/vg_name/rlv_name

Note : If this fiel system is not being utilised by a databse , you can skip the -b option .

Create the mount point directory .
#mkdir /mount_point

Mount the newly created LV .
# mount /dev/g_name/lv_name /mount_point
Include whatever options you need here .



On the same node do :
#vgexport -p -s -m vg_name.map /dev/vg_name
ftp the file vg_name.map to the adoptive node in the cluster .

Noe on the adpative node do :

Remove the existing vg if ti exists .
#vgexport /dev/vg_name
Recreate the volume group files
#mkdir /dev/vg_name
#mknod /dev/vg_name/group c64 0xAA0000
Where AA should be same as your primary node .
#vgimport -s -m vg_name.map /dev/vg_name .

Thats it your are done .

The only thig you need now is to open the package control file in /etc/cmcluster/package_name add the new LV and the new mount point . Do the same on all nodes in the cluster .
Scott J. Showalter
Frequent Advisor

Re: Add LV and VG to SG.

FYI;
Here are a couple of links that point to documentation that shows what can and can't be done with the cluster/package in the running/halted states.

Cluster Configuration(see Table 2):
http://docs.hp.com/hpux/onlinedocs/B3936-90065/00/00/51-con.html

Package Configuration(see Table 3):
http://docs.hp.com/hpux/onlinedocs/B3936-90065/00/00/52-con.html

The whole manual(A.11.14) starts at:
http://docs.hp.com/hpux/onlinedocs/B3936-90065/00/00/1-con.html
This is a great resource.
In a world without fences, who needs Gates?
Sanjay_6
Honored Contributor

Re: Add LV and VG to SG.

Hi,

you don't have to shutdown the cluster to add a lv to an existing cluster vg for a package. Say the vgname is vg_name and the node this is being used on is node1.

on node1,

lvcreate lv, say lv_name. lvextend it and do newfs on it.
The do a ll for the device name and note down the major and minor numbers.

on node2
mknod /dev/vg_name/lvname b 64 0xnn0000
mknod /dev/vg_name/rlvm_name c 64 0xnn0000

now edit the package control file and add this lv into the list of lv's mounted for the package. Replicate the change on the other node too. Mount the filesystem manually on the node on which the package is active and you are all set.

You don't have to do a cmapplyconf or package shutdown for this.

Hope this helps.

Regds
chapaya_1
Frequent Advisor

Re: Add LV and VG to SG.

Hi Ashwani ,

Do i need to export the other node VG ? and then to import it ?
Do this proccess can hurt the other LVs that related to the VG ?

BYE.
G. Vrijhoeven
Honored Contributor

Re: Add LV and VG to SG.

Hi,

if you do an vgexport ( -p ) on node A and an vgimport on node B. All info will be imported, also lvol info of the volume group it conserns.
It does not effect orther lvol/vgs

Regards,

Gideon
Ashwani Kashyap
Honored Contributor

Re: Add LV and VG to SG.

Hello chapaya ,

yes , if the Vg exists on the other node the you have to export it before importing it .

No it will not effect any existing LV in that vg because they will be recreated during the import process as will be the new lv .