VMware Cloud Community
ArshSingh2
Contributor
Contributor

Warnig Vm Disk Consolidation Needed

Hi All, 

I Have vCenter on my Environment getting warning VM disk consolidation Needed.

No Snapshot is Present.

Auto Snapshot deletion Active

I have taken the Snapshot and choose Option Delete all, warning Still There.

VM is in power On State

0 Kudos
8 Replies
LucianoPatrão

Hi,

Did you try to do the consolation disk?

Check the datastore where that VM is stored and check the files inside the VM folder. Are there any snapshot files? Like vmname-001.vmdk

Do you have any backup tool that creates snapshots for the backups?

If you create a new snapshot and then delete all, does it work?

Luciano Patrão

VCP-DCV, VCAP-DCV Design 2023, VCP-Cloud 2023
vExpert vSAN, NSX, Cloud Provider, Veeam Vanguard
Solutions Architect - Tech Lead for VMware / Virtual Backups

________________________________
If helpful Please award points
Thank You
Blog: https://www.provirtualzone.com | Twitter: @Luciano_PT
0 Kudos
HailegebriealA
Contributor
Contributor

Virtual disk consolidation is the process of merging virtual disk files created after taking VM snapshots. You can initiate disk consolidation on demand to avoid performance degradation and other issues.

Try to perform the following actions to fix this error.

  1. Restart management agents on the ESXi server on which the VM resides. Open ESXi shell or connect to the ESXi host via SSH and run the command as root:

services.sh restart

or

/etc/init.d/hostd restart

/etc/init.d/vpxa restart

You can also open the ESXi direct console, go to Troubleshooting Options, and select Restart Management Agents (press Enter to activate the needed option, then press F11 to confirm).

  1. Check the locked file with the command:

vmfsfilelockinfo -p /vmfs/volumes/vm_datastore/vm_name/vm_name.vmx

  1. Check the hostd log file if you need to identify the path on the datastore where the VM files are located.

cat /var/log/hostd.log |grep -i vm_name

  1. Go to the VM directory on the datastore when you know the VM files’ location:

cd /vmfs/volumes/datastore_name/vm_name

  1. Run the command to list ESXi hosts that are locking the VM files:

for i in `ls`; do vmfsfilelockinfo -p $i ;done|grep ‘is locked in\|Host owning the lock\|Total time taken’ | sed ‘s|Host owning the lock on file is||g’|sed ‘s|Total time|—|g’ | awk ‘{print $1}’ |uniq

  1. Restart ESXi management agents, including hostd and vpxa as explained above, or run these commands on the ESXi host locking the VM files:

/etc/init.d/hostd restart

/etc/init.d/vpxa restart

and finally try the disk consolidation.

0 Kudos
LucianoPatrão

Sorry @HailegebriealA, what? Why do you need to restart ESXi host services for a VM consolidation disk or delete snapshots?

Luciano Patrão

VCP-DCV, VCAP-DCV Design 2023, VCP-Cloud 2023
vExpert vSAN, NSX, Cloud Provider, Veeam Vanguard
Solutions Architect - Tech Lead for VMware / Virtual Backups

________________________________
If helpful Please award points
Thank You
Blog: https://www.provirtualzone.com | Twitter: @Luciano_PT
0 Kudos
ArshSingh2
Contributor
Contributor

Hello jail break

  • Yes, I tried to Consolidate disk, but it says Failed to lock.
  • yes, there are four files like 00001.vmdk 000002.vmdk up to 4.
  • Yes, we have Backup tool which create and delete snapshots.
  • Yes, Created Snapshot and deleted that is working.
0 Kudos
ArshSingh2
Contributor
Contributor

Its Production Environment I can do these. if you have any other suggestions let me know

0 Kudos
LisandrodeCuba
Enthusiast
Enthusiast

Have you tried shutting down the vm and take a new snapshot and then delete all snapshots?

@LucianoPatrão i think @HailegebriealA @is suggesting to restart management agents because of the lock

0 Kudos
LucianoPatrão

After the latest reply from the author, yes, it makes sense, not before. We should not propose that kind of task if it is not really needed, particularly when discussing production environments.

Ultimately, the responsibility for the tasks is always on the author, but we should always be aware that our recommendations can impact the environment.

Luciano Patrão

VCP-DCV, VCAP-DCV Design 2023, VCP-Cloud 2023
vExpert vSAN, NSX, Cloud Provider, Veeam Vanguard
Solutions Architect - Tech Lead for VMware / Virtual Backups

________________________________
If helpful Please award points
Thank You
Blog: https://www.provirtualzone.com | Twitter: @Luciano_PT
0 Kudos
LucianoPatrão

Hi,

What tool is doing your backups? The tool seems to create the snapshots and then is not deleting some.

If you have a lock file, you should try this: https://kb.vmware.com/s/article/10051 

Then you could try the delete snapshots and consolidation again.

Since this is a production environment, you will always need to have a maintenance window to do this work because of the lock file issue. You may need to reboot the host.

Luciano Patrão

VCP-DCV, VCAP-DCV Design 2023, VCP-Cloud 2023
vExpert vSAN, NSX, Cloud Provider, Veeam Vanguard
Solutions Architect - Tech Lead for VMware / Virtual Backups

________________________________
If helpful Please award points
Thank You
Blog: https://www.provirtualzone.com | Twitter: @Luciano_PT
0 Kudos