we need to remove a file system from veritas cluster configuration.
/dev/vx/dsk/testdg/testvol
62G 38G 24G 62% /db/US41/data/test
we must check the resource dependency before starting to act.
root@river01# hares -dep testdb_orus41_test_mnt
#Group Parent Child
testsg testdb_US41_ora testdb_orus41_test_mnt
testsg testdb_orus41_test_mnt testdb_orus41_test_vol
and same way find dependency for Volume resource.
Method1: we can check the cluster configuration main.cf file and check resource dependency and further steps. But it becomes tediuos if cluster is complex like in my case.
so best bet is to try menthod2 in such case.
Method2:
1) Copy all cf files to /var/tmp
2) run hacf -cftocmd /var/tmp which will create a main.cmd file contains all the VCS historical commands while creating cluster configuration.
3) grep for the resource which you want to delete.
root@river01# grep testdb_orus41_test_mnt main.cmd
hares -add testdb_orus41_test_mnt Mount testsg
hares -modify testdb_orus41_test_mnt Critical 0
hares -modify testdb_orus41_test_mnt MountPoint “/db/US41/data/test”
hares -modify testdb_orus41_test_mnt BlockDevice “/dev/vx/dsk/testdg/testvol”
hares -modify testdb_orus41_test_mnt FSType vxfs
hares -modify testdb_orus41_test_mnt MountOpt “rw,delaylog,suid,convosync=direct,largefiles”
hares -modify testdb_orus41_test_mnt FsckOpt “%-n”
hares -modify testdb_orus41_test_mnt CkptUmount 1
hares -modify testdb_orus41_test_mnt SecondLevelMonitor 0
hares -modify testdb_orus41_test_mnt SecondLevelTimeout 30
hares -modify testdb_orus41_test_mnt Enabled 1
hares -link testdb_US41_ora testdb_orus41_test_mnt
hares -link testdb_orus41_test_mnt testdb_orus41_test_vol
Here we can see all the commands which were run while adding resource in the cluster. For removing we just need to follow reverse process. instead on link use unlink and for add use delete.
So the plan becomes:
1) Make cluster config RW
haconf –makerw
2) Unlink the dependency with volume resource
hares -unlink testdb_orus41_test_mnt testdb_orus41_test_vol
3) unlink the dependency with DB resource
hares -unlink testdb_US41_ora testdb_orus41_test_mnt
4) Bring resource offline on the system, SG will become partial now.
hares -offline testdb_orus41_test_mnt -sys river01
5) Disable the resource
hares -modify testdb_orus41_test_mnt Enabled 0
6) Remove the resource, SG becomes online now.
hares -delete testdb_orus41_test_mnt Mount testsg
7) Unlink volume resource with DG resource
hares -unlink testdb_orus41_test_vol testdbdb_dg
8) Disable volume resource
hares -modify testdb_orus41_test_vol Enabled 0
9) Remove volume resource
hares -delete testdb_orus41_test_vol Volume testsg
10) make configuration read only
haconf -dump –makero
Removing volume:
vxedit -g testdg -rf rm testvol
And thats all.
/dev/vx/dsk/testdg/testvol
62G 38G 24G 62% /db/US41/data/test
we must check the resource dependency before starting to act.
root@river01# hares -dep testdb_orus41_test_mnt
#Group Parent Child
testsg testdb_US41_ora testdb_orus41_test_mnt
testsg testdb_orus41_test_mnt testdb_orus41_test_vol
and same way find dependency for Volume resource.
Method1: we can check the cluster configuration main.cf file and check resource dependency and further steps. But it becomes tediuos if cluster is complex like in my case.
so best bet is to try menthod2 in such case.
Method2:
1) Copy all cf files to /var/tmp
2) run hacf -cftocmd /var/tmp which will create a main.cmd file contains all the VCS historical commands while creating cluster configuration.
3) grep for the resource which you want to delete.
root@river01# grep testdb_orus41_test_mnt main.cmd
hares -add testdb_orus41_test_mnt Mount testsg
hares -modify testdb_orus41_test_mnt Critical 0
hares -modify testdb_orus41_test_mnt MountPoint “/db/US41/data/test”
hares -modify testdb_orus41_test_mnt BlockDevice “/dev/vx/dsk/testdg/testvol”
hares -modify testdb_orus41_test_mnt FSType vxfs
hares -modify testdb_orus41_test_mnt MountOpt “rw,delaylog,suid,convosync=direct,largefiles”
hares -modify testdb_orus41_test_mnt FsckOpt “%-n”
hares -modify testdb_orus41_test_mnt CkptUmount 1
hares -modify testdb_orus41_test_mnt SecondLevelMonitor 0
hares -modify testdb_orus41_test_mnt SecondLevelTimeout 30
hares -modify testdb_orus41_test_mnt Enabled 1
hares -link testdb_US41_ora testdb_orus41_test_mnt
hares -link testdb_orus41_test_mnt testdb_orus41_test_vol
Here we can see all the commands which were run while adding resource in the cluster. For removing we just need to follow reverse process. instead on link use unlink and for add use delete.
So the plan becomes:
1) Make cluster config RW
haconf –makerw
2) Unlink the dependency with volume resource
hares -unlink testdb_orus41_test_mnt testdb_orus41_test_vol
3) unlink the dependency with DB resource
hares -unlink testdb_US41_ora testdb_orus41_test_mnt
4) Bring resource offline on the system, SG will become partial now.
hares -offline testdb_orus41_test_mnt -sys river01
5) Disable the resource
hares -modify testdb_orus41_test_mnt Enabled 0
6) Remove the resource, SG becomes online now.
hares -delete testdb_orus41_test_mnt Mount testsg
7) Unlink volume resource with DG resource
hares -unlink testdb_orus41_test_vol testdbdb_dg
8) Disable volume resource
hares -modify testdb_orus41_test_vol Enabled 0
9) Remove volume resource
hares -delete testdb_orus41_test_vol Volume testsg
10) make configuration read only
haconf -dump –makero
Removing volume:
vxedit -g testdg -rf rm testvol
And thats all.
No comments:
Post a Comment