Saturday, December 16, 2017

lspv shows newly assigned LUN as "VeritasVolumes" instead of "None"

Problem

AIX's lspv shows newly assigned LUN as "VeritasVolumes" instead of "None".
The problem was that the veritas volume manager package was already removed from the server level long back .veritas services were not configured at server level .

error :

test# extendvg -f datavg hdisk3
Disk hdisk3 is already in volume group VeritasVolumes

probable problem cause 


 lspv command reads the customized database . That means that output we are getting is  due to the  PV attributes defined in customized database.
it can be the case that earlier hdisk3 was part of veritas volume manager and  the proper procedure was not followed for removal of veritas volumes  and that caused in-consistencies
in customized database .


understanding the exact cause 


1)for understanding the exact issue , we tried to get the disk details from the customized database .We found that the PV attributes is set  as "VeritasVolumes" to the problematic disk ,which was not present for other  AIX LVM disks. we cross-checked all the disks and found the same issue . 

# odmget -q value=hdisk3 CuAt

CuAt:
        name = "VeritasVolumes"
        attribute = "pv"
        value = "hdisk3"
        type = "R"
        generic = ""
        rep = ""
        nls_index = 0

2)we removed the disk from the server level using rmdev command ,to figure out whether this attribute value is getting removed . but no luck rest all attributes were removed but this
 attribute was not removed . This gives us the impression that either this attribute need to be removed by correct VxVM command or need to be forcefully removed from customized ODM database.


Resolution


normally what we know is the below process to remove the disk from VxVM control,if it is configured.


1. to tell the vxconfigd deamon to enter enabled mode
 #vxdctl enable
2. check for the disk details .
# vxdisk -e list|grep hdisk3
test_aks0_1242 auto      -             -            online       hdisk3     std

3.uninitialise the device to remove the VxVM information:
# /etc/vx/bin/vxdiskunsetup -C test_aks0_1242

4.it will also have to be removed from VxVM's view:
# vxdisk rm test_aks0_1242

5.lspv  shows the device without the VeritasVolumes tag:
# lspv|grep hdisk3
hdisk3        none                                None


 when VxVM package is itself not present and it is not possible to remove the disk from VxVM control using any VxVM command .


step 1) validated the hdisk3 disk details
test# lspv | grep hdisk3
hdisk3          none                                VeritasVolumes

Step 2 ) removed the disk , to figure out that  ODM disk related PV attributes  information  of hdisk3 is getting cleared or not .

test# rmdev -Rdl hdisk3
hdisk3 deleted

Step 3) found that after removing the disk also the PV attribute of hdisk3 is not getting cleared .
test# odmget -q value=hdisk3 CuAt

CuAt:
        name = "VeritasVolumes"
        attribute = "pv"
        value = "hdisk3"
        type = "R"
        generic = ""
        rep = ""
        nls_index = 0
test# odmget -q name=hdisk3 CuAt
test# odmget -q name=hdisk3 CuDv
test# odmget -q value3=hdisk3 CuDvDr
test# odmget -q name=hdisk3 CuDep
test# odmget -q name=hdisk3 CuVPD

Step 4) removed the PV attribute  from customized ODM.

# odmdelete -q value=hdisk3 -o CuAt
0518-307 odmdelete: 1 objects deleted.

Step 5) ran cfgmgr to re-configure it  .

#cfgmgr
test# lspv | grep hdisk3
hdisk3          none                                none

Note : it is not required to remove the disk using rmdev , we can directly remove the ODM definitions