ESXi

 View Only
Expand all | Collapse all

Unable to remove old snapshots

  • 1.  Unable to remove old snapshots

    Posted Feb 05, 2013 12:33 PM

    Hello all,

    Our backup software (BE), have left apprx 13 snapshots behind, I was able to find out

    first snapshot's .vmdk file is in lock state and more are filling up.

    They are not available in snapshot manager.

    as suggested on other forums, I have tried to restart vmware tools service - create new and delete all, but no help

    I have also unintsall BE remote agent and vmware tools but no help so far

    How can I commit those snapshots?

    Thanks in Advance

    Beadmin



  • 2.  RE: Unable to remove old snapshots

    Posted Feb 05, 2013 12:36 PM

    This is the exact error:

    Remove snapshot servername Unable to access file <unspecified filename> since it is locked

    I have shut dwn machine as well, create new one and delete all - with no help



  • 3.  RE: Unable to remove old snapshots

    Posted Feb 05, 2013 12:40 PM

    There is a file lock preventing snapshot removal.


    I suggest you to identify and remove that lock:

    http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=10051

    Greets!!



  • 4.  RE: Unable to remove old snapshots

    Posted Feb 09, 2013 07:03 AM

    - So far

    - I have unintsall Be remote agent \vmware tools

    -restart managment agent service on ESX host

    -made the following change : http://www.symantec.com/docs/TECH200709

    -Ran these:

    Check to see if the virtual machine has a snapshot with the command:

    # vmware-cmd /vmfs/volumes/4856df9c-c0f3e791-fa78-0019b9b7f228/dc3/dc3.vmx hassnapshot
    Result  was 0

    #vmware-cmd /vmfs/volumes/4856df9c-c0f3e791-fa78-0019b9b7f228/dc3/dc3.vmx getstate

    Result was "on"

    - unable to find error in  vmware.log /vkernel

    -now I have 18 delta files in there, I stopped machine and tried to copy all files in a folder delta file vmdk1 was locked.

    moved back all files and rebooted machine.

    Any suggestion how to get rid of these 18 delta files..



  • 5.  RE: Unable to remove old snapshots
    Best Answer

    Posted Feb 09, 2013 11:18 AM

    With multiple hosts, each of these host may hold the lock. Did you follow the KB article mentioned by LennieDH to find out who's locking the file? If you do have only a few hosts you may try to restart the management agents on all of them.

    If this still doesn't help you could clone the virtual disk (which merges all the snapshots to the cloned disk) and replace the VM's virtual disk with the cloned disk. To create the clone, shut down the VM, find out the virtual disk (.vmdk) name of the current snapshot and run

    vmkfstools -i vmname-0000xx.vmdk vmname-clone.vmdk

    André



  • 6.  RE: Unable to remove old snapshots

    Posted Feb 11, 2013 12:54 PM

    We have only one ESX host for this site, (its clusterred with other ESX host at another site, but not licensed for v-motion)

    We have never moved it to another host, so dont think any other might be keeping a lock.



  • 7.  RE: Unable to remove old snapshots

    Posted Feb 09, 2013 12:28 PM

    if you have a downtime window..then shutdown the VM and do a cloning.. then remove the entire...old VM foler from the datastore. This is simple...



  • 8.  RE: Unable to remove old snapshots

    Posted Feb 11, 2013 12:57 PM

    This VM is Domain controller for this site, will it be simple if I just bring it down - clone to new VM

    Turn on new VM..make sure all working good and then delete the orignal one.

    After cloning, I guess it would have new SID and UID, will it still be okay?



  • 9.  RE: Unable to remove old snapshots

    Posted Feb 11, 2013 06:39 PM

    With a DC you may want to preserve the VM's UUID, MAC address, ..., so you need to do some manual work. After either cloning the VM I suggest you unregister the current VM ("Remove from Inventory"), copy the VM's files except for the .vmdk files from the old to the new folder and edit the .vmx file to make the VM point to the newly created virtual disk. Then power on the VM and choose "I moved it" when you are asked whether you moved or copied it, this will preserve the UUID and MAC address. Instead of cloning the VM you could also use the command I provided bfore. Keep in mind that both option require the VM to be cleanly shut down.

    André



  • 10.  RE: Unable to remove old snapshots

    Posted Feb 12, 2013 06:22 AM

    Thanks Andre, This looks simpe, I would try it and let u know how it goes:

    If this still doesn't help you could clone the virtual disk (which merges all the snapshots to the cloned disk) and replace the VM's virtual disk with the cloned disk. To create the clone, shut down the VM, find out the virtual disk (.vmdk) name of the current snapshot and run

    vmkfstools -i vmname-0000xx.vmdk vmname-clone.vmdk
    -So I would shut dwn DC, connect ESX host with SSH (Putty) and run this:
    vmkfstools -i DC-000018.vmdk DC-clone.vmdk
    Once done, start the machine and no manual work in this way.


  • 11.  RE: Unable to remove old snapshots

    Posted Feb 12, 2013 07:50 AM
    vmkfstools -i DC-000018.vmdk DC-clone.vmdk

    Yes, if DC-000018.vmdk is the current virtual disk in the VM's configuration (.vmx) file.

    Once done, start the machine and no manual work in this way.

    You will have to edit the .vmx file to point to the new DC-clone.vmdk file. If you create the new virtual disk in the VM's current folder, you also need to either remove/add the VM from/to the inventory or reload it after editing the .vmx file (see http://kb.vmware.com/kb/1026043).

    André



  • 12.  RE: Unable to remove old snapshots

    Posted Mar 01, 2013 08:22 AM

    Thanks Man :smileyhappy: ,

    That worked just fine. (clone VMDK and point and re rejister).