VMware Cloud Community
Beadmin
Enthusiast
Enthusiast
Jump to solution

Unable to remove old snapshots

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

Reply
0 Kudos
1 Solution

Accepted Solutions
a_p_
Leadership
Leadership
Jump to solution

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é

View solution in original post

Reply
0 Kudos
11 Replies
Beadmin
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos
LennieDH
Enthusiast
Enthusiast
Jump to solution

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!!

If you find this information useful please mark it as "Helpful" or "Correct".
Reply
0 Kudos
Beadmin
Enthusiast
Enthusiast
Jump to solution

- 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..

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

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é

Reply
0 Kudos
Gkeerthy
Expert
Expert
Jump to solution

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...

Please don't forget to award point for 'Correct' or 'Helpful', if you found the comment useful. (vExpert, VCP-Cloud. VCAP5-DCD, VCP4, VCP5, MCSE, MCITP)
Reply
0 Kudos
Beadmin
Enthusiast
Enthusiast
Jump to solution

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.

Reply
0 Kudos
Beadmin
Enthusiast
Enthusiast
Jump to solution

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?

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

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é

Beadmin
Enthusiast
Enthusiast
Jump to solution

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.
Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

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é

Beadmin
Enthusiast
Enthusiast
Jump to solution

Thanks Man Smiley Happy ,

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

Reply
0 Kudos