How to set up a new Logical Volume Manager service group in VERITAS Cluster Server

book

Article ID: 100016987

calendar_today

Updated On:

Resolution

1. Make sure VERITAS Cluster Server (VCS) is up and running:

    # hastatus-sum

   -- SYSTEMSTATE
   --System              State                Frozen

   A  system1              RUNNING              0
   A  system2              RUNNING              0

   --GROUP STATE
   --Group          System               Probed    AutoDisabled    State

   B  cfs            system1              Y          N              ONLINE
   B  cfs            system2              Y          N              ONLINE
   B  cvm            system1              Y          N              ONLINE
   B  cvm            system2              Y          N              ONLINE



2. Make sure that the Cluster Server bundled agents are already installed:

   #swlist -l product VRTSvcsag


3. Standard Logical Volume Manager (LVM)

  a. Create an LVM volume group:

    # mkdir/dev/vg01
   # ll/dev/*/group             (check which minor numbers are already in use)
    #mknod /dev/vg01/group c 640x020000
   # pvcreate/dev/rdsk/c0t4d5
   #vgcreate /dev/vg01 /dev/dsk/c0t4d5


    b.Create lvols and mountpoints on nodesystem1:

    # lvcreate -l 100/dev/vg01
   # lvcreate -l600 /dev/vg01
   # newfs-F vxfs/dev/vg01/rlvol1
   #newfs -F vxfs -o largefiles/dev/vg01/rlvol2
   #mkdir /my_lvol1
   # mkdir/my_lvol2


    c. Deactivate vg01 on nodesystem1:

    # vgchange -a nvg01


    d. Create a map file and change/etc/lvmrc:

    # vgexport -v -p -s-m /vg01.map /dev/vg01

This performs an export of the volume group, but in preview mode,  and stores the information to the map filevg01.map.
 
If using the standard HP-UX LVM naming conventions[lvolX],  then this is not necessary.
 
If using/dev/vg01/oracle_lvol,  then this step is necessary or the import will rename them back to the standard naming conventions.


Note: Every time a logical volume is created within the volume group that belongs to the cluster, it has to be populated to other nodes using the vgexport/vgimport[mapfile] commands. If these commands are not used, it will not be seen, and therefore it will not be able to be mounted on the other nodes. It is possible to check this by looking in the /dev/vg01 directory on all the nodes.

Important: To avoid a 'split brain' scenario, it is necessary to make sure that the volumes under Cluster Server control are not started at boot up, and that all nodes in the cluster have been changed in the/etc/lvmrc file:

Set AUTO_VG_ACTIVATE=0 in this file and modify the custom_vg_activation() routine


    e. Import the volume group on node system2, but do not activate it

If you activate the volume group to verify if the configuration looks fine, you have to deactivate it afterwards before you start the service group:

    # mkdir/dev/vg01
   # mknod/dev/vg01/group c 640x020000
   # rcpsystem1:/vg01.map/tmp
   # vgimport -m/tmp/vg01.map -s/dev/vg01
   # vgchange -an vg01


    f. Create mountpoints on nodesystem2:

    # mkdir/my_lvol1
   # mkdir/my_lvol2




4. For VERITAS Volume Manager and VERITAS Cluster Server -- adding vg01 to the cluster configuration

    a. Restart vxconfigd on all nodes:

    # vxconfigd -k -menable


    b. Open the database for write operations:

    # haconf-makerw


    c. Create a service group called lvm_vg and modify it:

   # hagrp-add lvm_vg
   # hagrp-modify lvm_vg SystemList system1 0 system21
   # hagrp -modifylvm_vg AutoStartList system1


    d. Create a volume group resource and modify the attributes:

    # hares -addvg_vg01 LVMVolumeGrouplvm_vg
   # hares -modifyvg_vg01 VolumeGroup vg01


    e. Create logical volume resources and modify their attributes:

   # hares -addlvol_lvol1 LVMLogicalVolumelvm_vg
   # hares -modifylvol_lvol1 LogicalVolumelvol1
   # hares -modifylvol_lvol1 VolumeGroupvg01
   # hares -addlvol_lvol2 LVMLogicalVolumelvm_vg
   # hares -modifylvol_lvol2 LogicalVolumelvol2
   # hares -modifylvol_lvol2 VolumeGroup vg01


    f. Link the logical volume resources to the volume group resource:

    # hares -linklvol_lvol1 vg_vg01
   # hares -link lvol_lvol2 vg_vg01


    g. Create mount resources and modify their attributes:

    # hares -addmnt_lvol1 Mountlvm_vg
   # hares -modifymnt_lvol1 MountPoint/my_lvol1
   # hares-modify mnt_lvol1 BlockDevice/dev/vg01/lvol1
   # hares-modify mnt_lvol1 FSTypevxfs
   # hares -modifymnt_lvol1 FsckOpt%-y

    # hares -addmnt_lvol2 Mountlvm_vg
   # hares -modifymnt_lvol2 MountPoint/my_lvol2
   # hares-modify mnt_lvol2 BlockDevice/dev/vg01/lvol2
   # hares-modify mnt_lvol2 FSTypevxfs
   # hares -modifymnt_lvol2 FsckOpt %-y
   #hares -modify mnt_lvol2 MountOptlargefiles


    h. Link the mount resource to the logical volume resource:

    #hares -link mnt_lvol1lvol_lvol1
   # hares-link mnt_lvol2 lvol_lvol2


    i. Enable all new created resources:

    # hares-modify vg_vg01 Enabled1
   # hares -modifylvol_lvol1 Enabled 1
   #hares -modify lvol_lvol2 Enabled1
   # hares -modifymnt_lvol2 Enabled 1
   #hares -modify mnt_lvol1 Enabled 1


    j. Close the database:

    # haconf -dump -makero



5. Verify if all resources belonging to service group lvm_vg are probed on both nodes:

    # hastatus-sum

   -- SYSTEMSTATE
   --System              State                Frozen

   A  system1              RUNNING              0
   A  system2              RUNNING              0

   --GROUP STATE
   --Group          System               Probed    AutoDisabled    State

   B  cfs            system1              Y          N              ONLINE
   B  cfs            system2              Y          N              ONLINE
   B  cvm            system1              Y          N              ONLINE
   B  cvm            system2              Y          N              ONLINE
   B  lvm_vg          system1              Y          N              OFFLINE
   B  lvm_vg          system2              Y          N              OFFLINE


   Service group lvm_vg should be OFFLINE on both nodes.



6. Start the newly created service group lvm_vg on system1:

    # hagrp-online lvm_vg -syssystem1

   # hastatus-sum

   -- SYSTEMSTATE
   --System              State                Frozen

   A  system1              RUNNING              0
   A  system2              RUNNING              0

   --GROUP STATE
   --Group          System               Probed    AutoDisabled    State

   B  cfs            system1              Y          N              ONLINE
   B  cfs            system2              Y          N              ONLINE
   B  cvm            system1              Y          N              ONLINE
   B  cvm            system2              Y          N              ONLINE
   B  lvm_vg          system1              Y          N              ONLINE
   B  lvm_vg          system2              Y          N              OFFLINE


   Service group lvm_vg is now ONLINE on node system1.


 
 

 

Issue/Introduction

How to set up a new Logical Volume Manager service group in VERITAS Cluster Server