1 2 Previous Next 15 Replies Latest reply on Oct 18, 2020 2:27 AM by scott28tt

    How can find the VMDK's owner

    baber Expert

      I have a vmdk file but don't know which vm is using from this VMDK file . How can understand which virtual machine is using from this VMDK file or I can remove it ?

       

      BR

        • 1. Re: How can find the VMDK's owner
          IRIX201110141 Master

          IIRC RVtools have a "health" tab on the most right and list "Zombie" VMDKs which are not referrenced. Same for VMs which are not in the Inventory.

           

          Otherwise you have to scan (grep) each *.vmx on very Host/Datastore.

           

          If a VMDK is in use than you can query with vmkfstool which Host holds the lock. You cant remove a -flat.vmdk which is in use but you can remote the describtor i think.

           

          Regards,
          Joerg

          • 2. Re: How can find the VMDK's owner
            baber Expert

            Is that possible try to remove xx-flat.vmdk ? if this is using canot delete it . is that correct ?

            • 3. Re: How can find the VMDK's owner
              Nawals Expert

              Hi,

               

              You have to check the VMs disk from VM properties. Right click on VM and click "Edit settings" and you can see all the VMDKs are using by that VMs. Don't delete the xx-flat.vmdk  as you can loose the VM.

               

              If VM is locked you have to find the VM on which datastore residing. then run command #vmkfstools -D </vmfs/volumes/VMname/VM.vmx or xxx.vmdk> to see which host locked the VM.

               

              NKS
              Please Mark Helpful/correct if my answer resolve your query.
              • 4. Re: How can find the VMDK's owner
                baber Expert

                Thanks. but as I previously said I just have a vmdk file with name a.VMDK and a-flat.vmdk and there is not any vm with this name in my inventory. I think the vm's name has renamed and thee are many vm in the environment,

                now want to know how can find out which vm is using from this vmdk file ?

                 

                 

                the command is not useful return follow output:

                 

                [root@host13:/vmfs/volumes/5e3d185a-f3a1e080-8c0e-d06726b7acd0/testicdb] vmkfstools -D /vmfs/volumes/LUN-Low-2/a/a.vmdk

                Lock [type 10c00001 offset 322248704 v 85, hb offset 3604480

                gen 23549, mode 0, owner 00000000-00000000-0000-000000000000 mtime 43080130

                num 0 gblnum 0 gblgen 0 gblbrk 0]

                Addr <4, 25, 1>, gen 3, links 1, type reg, flags 0, uid 0, gid 0, mode 600

                len 450, nb 0 tbz 0, cow 0, newSinceEpoch 0, zla 4305, bs 65536

                affinityFD <4,24,1>, parentFD <4,24,1>, tbzGranularityShift 20, numLFB 0

                lastSFBClusterNum 0, numPreAllocBlocks 0, numPointerBlocks 0

                 

                 

                BR

                • 5. Re: How can find the VMDK's owner
                  Nawals Expert

                  OK. It look like zombie vmdk which is not in used. Before going to delete must verified. you need to manually verify if have few vms. If have more VMs then use RVtool to see the report. share the screenshot of those VMs if you are ok else rvtool report is fine. shared the out put that said VM is not locked by any host.

                  NKS
                  Please Mark Helpful/correct if my answer resolve your query.
                  • 6. Re: How can find the VMDK's owner
                    baber Expert

                    According to the output , how did you understand the vmdk is lock or not?

                    • 7. Re: How can find the VMDK's owner
                      IRIX201110141 Master

                      Because of the owner 0....0....0. Normaly you see the MAC of the Host there. But thats not 100% bulletproof.

                       

                      Again.... this vmdk can be assign to a VM which is shutdown and there for sure there is no lock.

                       

                      Again..... search for a.vmdk by using grep in every *.vmx.

                      • 8. Re: How can find the VMDK's owner
                        Nawals Expert

                        Mode 0 means not locked by any host. If Mode 1 you can see the MAC address of host.

                        NKS
                        Please Mark Helpful/correct if my answer resolve your query.
                        • 9. Re: How can find the VMDK's owner
                          baber Expert

                          As I have more than 300 vms thus there are very vmx files and as you said some of them are power.off now you said had to search in vmx file to see where is vmdk file using . Would you say how can do that in my datacenter ?

                          • 10. Re: How can find the VMDK's owner
                            baber Expert

                            Thanks. this is the output for other vm that I now is using and just mode changed to 1 but cannot find out which hosts or vm is using that

                             

                            Lock [type 10c00001 offset 426213376 v 70, hb offset 3473408

                            gen 64511, mode 1, owner 5f1818d1-cba711f6-4389-d06726b7a6e8 mtime 6091031

                            num 0 gblnum 0 gblgen 0 gblbrk 0]

                            Addr <4, 39, 12>, gen 29, links 1, type reg, flags 0x2, uid 0, gid 0, mode 600

                            len 53687091200, nb 51200 tbz 0, cow 0, newSinceEpoch 51200, zla 3, bs 1048576

                            affinityFD <4,52,0>, parentFD <4,52,0>, tbzGranularityShift 20, numLFB 100

                            lastSFBClusterNum 0, numPreAllocBlocks 0, numPointerBlocks 7

                            • 11. Re: How can find the VMDK's owner
                              Nawals Expert

                              The owner 5f1818d1-cba711f6-4389-d06726b7a6e8 indicates that the MAC address of the ESXi/ESX host locking the file is d0:67:26:b7:a6:e8

                              Now you can check the above MAC address and move the vm on that host which will release the locked.

                              NKS
                              Please Mark Helpful/correct if my answer resolve your query.
                              • 12. Re: How can find the VMDK's owner
                                baber Expert

                                Thanks but according that . this will be useful just vm is power.on while the vm is power.off  because if the vm is power.off certainly the mode will be show =0 . Is there any solution to understand the owners of the VMDK file if the machine ispower.off.

                                • 13. Re: How can find the VMDK's owner
                                  IRIX201110141 Master

                                  grep can work recursive. Writing a powershell script crawl through your complete datacenter. The one and only way it to check the vDisk filename and compare.

                                   

                                  Did you check RVtools?

                                   

                                  Regards,

                                  Joerg

                                  • 14. Re: How can find the VMDK's owner
                                    baber Expert

                                    According to RVtools it detected Zambie . but it detects few other vms as zaombie . How can it detect which vm is zambie ?

                                    1 2 Previous Next