VM disk consolidation failed with error

Unable to consolidate disk of VM. It's giving following error -

"Unable to access file <unspecified filename> since it is locked"

We are using VMware 5.0 version.
cbinayakAsked:
Who is Participating?
 
Richardson PortoConnect With a Mentor Senior Infrastructure SpecialistCommented:
Which VM? Anyway, if you're talking about the VM with the backup solution, you should remove the virtual disks from backup appliance using the Remove from Virtual Machine. Only restart may not help.
0
 
Richardson PortoSenior Infrastructure SpecialistCommented:
Do you use any backup solution like vSphere Data Protection to backup your virtual machines?
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
can you provide screenshots of your datastore VM folder ?

can you also provide screenshots of your VM disk settings
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
cbinayakAuthor Commented:
We are using Symantec NetBackup.

Error Screenshot
Error
VM Datastore Screenshot
VM Datastore
VM Disk Settings Screenshot
VM Disk1VM Disk2
0
 
Richardson PortoConnect With a Mentor Senior Infrastructure SpecialistCommented:
Take a look at the following VMware KB article: https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2017072 since looks like your backup solution is locking the file.
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
I need to see the disk settings.

Yes you have a snapshot....

Check that the Backup Job is still NOT IN USE and RUNNING.

and the current Symantec Appliance does not have the parent disk VM attached to it.
0
 
cbinayakAuthor Commented:
Will it be unlocked if I restart the VM?
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
No, you will need to turn off the Backup Appliance, and remove it (but not delete from disk)
0
 
cbinayakAuthor Commented:
Can you please help me about how to view "vmware.log" file? I want to get the locked file name.
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
did you look at the Backup Appliance ?

and check the disks attached to the Backup Appliance if any belong to this VM you cannot power on.

VMware.log is a text file, you can download and view using WinSCP.
0
 
cbinayakAuthor Commented:
Backup Appliance is not showing anything any locked file for this VM. However, our Backup Admin wants the name of the file that is locked so that he can do an advanced search in the Backup Appliance itself.

I am able to view the vmware.log file using vi editor. Please let me know where from I will get the locked file name.
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
The Backup Appliance WILL NOT show any locked file.

BUT does the appliance, have any disks attached to it, which do not belong to it!

the VMWARE.log file may not report on the locked file. search for the word "lock"

this could also be chasing a red hearing....and appliance may not be the device locking the file.

can you try the following:-

1. Take a new snapshot.
2. wait 1-2 minutes
3. select DELETE ALL....

does it create a new snapshot file, or remove the snapshots.

e.g. does it create a file -0006.vmdk

also is the name of the file currently -00005.vmdk in disk settings, I cannot see because you masked it out.
0
 
cbinayakAuthor Commented:
I migrated the vm to different host, took snapshot, waited 1-2 minutes, deleted all successfully. After that I tried to run Disk Consolidation but it fails with the same error.

I can see Hard Disk 1 is using "vmname_C-000006.vmdk" and Hard Disk 2 is using "vmname_E-000006.vmdk" but these two files are not there in the datastore.

The last two files that are there in the datastore are "vmname_C-000005.vmdk" and "vmname_E-000005.vmdk".
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
okay Consolidating and the method I asked you to do are the same, Consolidation is just VMware's easy method!

can you repeat...

1. Take a new snapshot.
2. wait 1-2 minutes
3. select DELETE ALL

but no running the consolidation process.

and check the datastore, any snapshots left ?

and what disks are in use ?

there is another method we can also try and thats CLONE.

CLONING the VM, will merge all current snapshots, and create a new VM without snapshots, and then you can continue to use this new VM.

BUT, if there is a lock on the parent vmdk, this is what is causing the issue. and either you will need to find the process causing the lock, or reboot the host, hosting the VM,
0
 
cbinayakAuthor Commented:
I did DELETE ALL after taking snapshots but all snapshot files are there in the datastore.

Now, the disks are pointing to _000007.vmdk which is there in the datastore.
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Okay, parent vmdk is locked.

hence delete-all snapshots and consolidation will not work it will fail, and just add another snapshot.

did you try CLONE ?

otherwise you will need to fine and remote the lock on parent vmdk.
0
 
cbinayakAuthor Commented:
I didn't try Clone. Will it resolve the issue if I clone the VM?

Do you mean to remove the lock on the parent vmdk? How to do that?
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
If you can CLONE the VM, the resulting VM will be free of snapshots, BUT if there is a lock on the parent VMDK, the CLONE will fail.

finding locks is often difficult.

see these Vmware KBs to assist you

Investigating virtual machine file locks on ESXi/ESX (10051)

Finding the lock owners of a VMDK or file on a VMFS datastore in VMware ESXi 5.5 P05 (2110152)
0
 
specialist MohamedSupport EngineerCommented:
Hello cbinayak,

How many ESXi hosts do we have ?

Can you try to migrate this VM to other hosts one by one and try to consolidate them on all hosts and check if that works ?

Not sure if VMKFSTOOLS works with 5.0. If it does, can you try the command below on all the VMDK files and help me with the output please ?
Take a putty to the ESXi host where the VM runs and change directory (CD) to VM's working directory and run the command below.

For example:
vmkfstools -D xxxxxxxx-000001.vmdk
vmkfstools -D xxxxxxxx-000002.vmdk
vmkfstools -D xxxxxxxx-000003.vmdk
vmkfstools -D xxxxxxxx-000004.vmdk
vmkfstools -D xxxxxxxx-000005.vmdk

Looking forward to hearing back.
0
 
cbinayakAuthor Commented:
I executed all commands. None of them is showing the owner of the respective disk.
vmkfstools Output
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
yes, this is often the problem, resulting in a restart of the Host.

and you are certain it's not locked by the Backup Appliance ?
0
 
cbinayakAuthor Commented:
I've asked backup team to look into this matter more deeply. In the meantime will restarting the ESXi host resolve this issue? I am asking this because I heard that backup of VM happens through ESXi host.
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
If the lock is by another process, and not the appliance, it should clear.

no backups will occur if the host is restarted.
0
 
cbinayakAuthor Commented:
It was Backup Server which locked the disk. Unlocking it resolved the issue.
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
glad you resolved your issue and now your Backup team understands how the Symantec Appliance works!

despite initial reports of no VM disk attached!
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Glad it's all resolved and your Backup Team know what to look for in the future despite reports of no VM disk attached!
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Glad it's all resolved and your Backup Team know what to look for in the future despite reports of no VM disk attached!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.