VMware Cloud Community
user9922
Enthusiast
Enthusiast
Jump to solution

vmdk optimization/maintenance (shrink/compact and defrag)

Is it possible to do some VM harddisk maintenance in the vSphere Host Client?

In VMware Workstation you have these nice features.....I haven't been able to find anything like it in the Host Client:

HDM.jpg

Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
user9922
Enthusiast
Enthusiast
Jump to solution

Okay....I think I found a way: vmkfstools

vmkfstools is embedded on the host and you can run it from the host CLI.

(I use PuTTY to access the host using SSH, and WinSCP as file/folder browser, also using SSH)


To shrink a disk use this command:

vmkfstools --punchzero /vmfs/volumes/datastore1/SR1/SRV1.vmdk

It seems you cannot use the command on the *flat.vmdk file.

View solution in original post

Reply
0 Kudos
4 Replies
Teddy092
Enthusiast
Enthusiast
Jump to solution

Hello user9922‌,

Honestly I haven't seen the features you described within VMware Workstation, however things are different in a vSphere environment.

In a vSphere infrastructure, storage resources are provided by storage arrays (SAN and/or NAS), so disk optimization are performed by the storage array.

Please note that you still can use the local disk of your hosts but we usually don't do that as that disk space is usually reserved to the ESXi OS but sometimes we add some ISO files on it as this can be useful.

Hope that answers your question.

If you found this or any other answer useful please consider the use of the Helpful or Correct buttons. Many thanks.
Reply
0 Kudos
user9922
Enthusiast
Enthusiast
Jump to solution

it has nothing to do with what storage system is in use on the host.

I'm talking about shrinking and defrag the vmdk files on the host.

I just renamed the title of this thread to be more clear.

When you do a OVF export of a VM the vmdk file is actually shrinked....would be nice to be able to do this directly, as you can do in Workstation.
I'm sure I can copy the VMDK file to my local PC and shrink it with Workstation and the upload it again, but that's a lot of steps.

Reply
0 Kudos
Teddy092
Enthusiast
Enthusiast
Jump to solution

OK it is more clear now.

However, you cannot extract vmdk or any other files from a OVA.

The only purpose of the OVA is to deploy VMs and not extract files from it. It is not like a ISO file where you can extract anything you want from it.

Sorry mate.

If you found this or any other answer useful please consider the use of the Helpful or Correct buttons. Many thanks.
Reply
0 Kudos
user9922
Enthusiast
Enthusiast
Jump to solution

Okay....I think I found a way: vmkfstools

vmkfstools is embedded on the host and you can run it from the host CLI.

(I use PuTTY to access the host using SSH, and WinSCP as file/folder browser, also using SSH)


To shrink a disk use this command:

vmkfstools --punchzero /vmfs/volumes/datastore1/SR1/SRV1.vmdk

It seems you cannot use the command on the *flat.vmdk file.

Reply
0 Kudos