How to delete the “site” in your asm disks without recreating theirs diskgroups

 

(First of all, I would like to thank the help from my BIG friend Óscar, he created the script with awk for doing the change)

 

In a Grid Infrastructure 12.2 version, we have configured the AFD (asm filter driver) and some diskgroups created with normal redundancy. They belong, by mistake, to some sites, it was configured a extended cluster but they are not using them but the voting disks and the ocr.

On these diskgroups are created some volumes and on the top of these, some filesystems, obviously if you want to change this information, you’d have to recreate everything from scratch for creating a new diskgroups without the “site” definition.

So we are going to try it with less work 😉

You can pay attention to the column “site_name”:

 

As we are deleting this information, not changing it or adding it, we are not using the kfed’s option:

 

We create a directory where dump the files with the metadata information (orig), and another directory where we modify them (mod), so we have a backup for reversing the changes to their original data in case of problems 😉

 

We create the script which generate the dumps, except for the diskgroups with the ocr and voting disks (in our case the 8) because these have to have them configured (in our case):

 

The output of this script will be something like this (putting the output in the directory “orig”):

 

We create the script which upload the modified data in the disks again (important to notice that the directory is “mod”!!)

 

The output from this script will create some lines like these:

 

We check the newly created files:

 

We run as ‘root’ the script which will generate the dump files with the information inside of our asm disks (with the kfed operation ‘read’ you don’t need to stop the afd):

 

If you compare the output from a disk without the “site” configured with one that does have it, you can realize the difference between the last two numbers in each line which have to coincide with the siteGUID from the command “crsctl query cluster site -all” (in our case”37c347fd2c83ffb9bf127d0aca787ca9″):

0x37 0xc3 0x47 0xfd 0x2c 0x83 0xff 0xb9 0xbf 0x12 0x7d 0x0a 0xca 0x78 0x7c 0xa9

 

You can pay attention at the column before the “;” which it would be “0” if you compare it with another disk without the “site” configured:

 

 

Now, we create a copy from the dump files generated and substitute the numbers beforely said (the column before “;” and the last two numbers in each line) and put the results into the “mod” directory:

 

You can compare the differences among the old files and the new files created with the information modified:

 

Now, we stop de clusterware in all nodes that belong to the cluster:

 

And we disable the AFD in one of our nodes (it is necessary for doing the kfed ‘write’ operation and let to write on the asm disks):

 

We upload the modified information with the new files into the asm disks:

 

We enable the AFD in the node:

 

And start the cluster in all the nodes that belong to the cluster:

 

And now, we have removed the information about “sites” in the asm disks without recreate the diskgroups!!!:

 

 

Adding value with Arumel!!

 

%d bloggers like this: