Avatar of cbinayak
cbinayak
Flag for India asked on

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

Avatar of undefined
Last Comment
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

8/22/2022 - Mon
Richardson Porto

Do you use any backup solution like vSphere Data Protection to backup your virtual machines?
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

can you provide screenshots of your datastore VM folder ?

can you also provide screenshots of your VM disk settings
cbinayak

ASKER
We are using Symantec NetBackup.

Error Screenshot
Error
VM Datastore Screenshot
VM Datastore
VM Disk Settings Screenshot
VM Disk1VM Disk2
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
SOLUTION
Richardson Porto

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

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

ASKER
Will it be unlocked if I restart the VM?
ASKER CERTIFIED SOLUTION
Richardson Porto

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

No, you will need to turn off the Backup Appliance, and remove it (but not delete from disk)
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
cbinayak

ASKER
Can you please help me about how to view "vmware.log" file? I want to get the locked file name.
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

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

ASKER
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.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

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

ASKER
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".
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

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,
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
cbinayak

ASKER
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.
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

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

ASKER
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?
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

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)
specialist Mohamed

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

ASKER
I executed all commands. None of them is showing the owner of the respective disk.
vmkfstools Output
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

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 ?
cbinayak

ASKER
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.
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

If the lock is by another process, and not the appliance, it should clear.

no backups will occur if the host is restarted.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
cbinayak

ASKER
It was Backup Server which locked the disk. Unlocking it resolved the issue.
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

glad you resolved your issue and now your Backup team understands how the Symantec Appliance works!

despite initial reports of no VM disk attached!
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

Glad it's all resolved and your Backup Team know what to look for in the future despite reports of no VM disk attached!
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

Glad it's all resolved and your Backup Team know what to look for in the future despite reports of no VM disk attached!