Loading

×Sorry to interrupt
CSS Error

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

Skip to main content

Products and Accounts

Support

Knowledge

Communities

Success

Learning

My Subscriptions

Loading

Knowledge Base

Growing, thinning, and shrinking virtual disks in ESXi (1002019)

Last Updated: 4/3/2023Categories: Best PracticesTotal Views: 177546Language:
Chinese (Simplified)JapaneseEnglishGerman

119 like this article

Subscribe to get an email
newsletter with new updates

119 people found this helpful Please provide article feedback:

Learn how VMware Skyline Advisor and Skyline Health Diagnostics work together to provide proactive intelligence and self-service log analysis.

Use Skyline Advisor to avoid issues before they occur across VCF, vSphere, vSAN, NSX, vROps & Horizon. Skyline Findings are based on top KBs, VMSAs/CVEs and design best practices.

Use Skyline Health Diagnostics to root cause vSphere & vSAN logs when an issue occurs. Skyline Health Diagnostic Findings are based on top KBs and VMSA/CVEs. You can use the Skyline Health Diagnostics tool in online or offline mode.

If you require additional help from technical support, please use Skyline Advisor to initiate a Log Assist to reduce time to upload logs. TSEs can also initiate logs to reduce effort.

Details

This article provides information on resizing of virtual disk files. You may find yourself in a situation where you need to either:

Expand a virtual disk to store more data

Thin an existing large virtual disk so it consumes less datastore space, without actually shrinking the virtual disk

Shrink a virtual disk, if it is too large

Decrease the size of a virtual disk

Solution

Currently, three major operations are supported by VMware Converter - Expanding, Thinning, and Shrinking.

Note: VMware vCenter Converter Standalone User Guide

Warning: An effective backup strategy should always be used before performing permanent changes to existing virtual disks.

Cloning, importing, and converting virtual disks should leave the source files unmodified.

In addition to the cloning, importing, and converting of a virtual disk, related source-disk snapshot files will be committed to the destination disk when cloning, importing, or converting. However, the original virtual disk and associated snapshots remains unmodified in the original directory.

Do not alter the base disk in any way without committing all snapshots first or they will be invalidated.

Changes cannot be made to a disk in use or locked.

Use VMware Converter, as it streamlines and simplifies the process, further, eliminating some areas where user error can occur.

Note: When using the VMware Converter wizard, you can perform operations on running virtual machines by treating them as physical machines. For more information, see the vCenter Converter Standalone Documentation .

Expanding Virtual Disk

Select a VM in the inventory and make sure VM doesn't have a snapshot

SSH into ESXi server

change the Directory to Virtual Machine directory

Example: cd /vmfs/volumes/VM-DIRECTORY/VIRTUAL-MACHINE

Virtual disks can be expanded using this ESXi command:

vmkfstools -X <new size> <virtual disk>.vmdk

For example, use this command to grow the virtual disk to 25GB in size:

vmkfstools -X 25g /vmfs/volumes/xxxx/vmname/vmname.vmdk

Changes are made to the disk and are almost instant

Partitions residing within the virtual disks will not resize and there will be unallocated space at the end of the disk. Third-party partitioning tools are required at this point to resize the primary partition to take advantage of the additional space

VMware Converter allows you to specify a new disk size in its conversion wizard. It will also take care of partition resizing for you.

Notes:

For more information about VMware Converter, see the vCenter Converter Standalone Documentation for your VMware product version.

Some virtual machine guest operating systems may require a reboot to detect changes to the size of the virtual disks.

Thinning

Virtual disks can be thinned so they consume only as much space as there is data residing in the .vmdk.

Thinning is currently possible using VMware Converter and hosted products, such as VMware Workstation. For more information, see the vCenter Converter Standalone Documentation for your VMware product version.

In the event that a thinned virtual disk continues to use more space than the operating system residing within it reports, old data in the volume still needs to be zeroed or removed.

Deletion of files in most file systems will not completely remove them; merely file tables will be altered. Use of freeware secure file deletion utilities are useful, such as Eraser or SDelete to zero out the space to 'zero' the free space on the volume, effectively clearing the free space of data. It is then, that the disk can be properly thinned. You can then use the vmkfstools -K command (ESXi/ESX 4.1 and later) to complete the block reclaim or use Storage vMotion to migrate the virtual machine to a datastore with different VMFS block size.

For process limitations and details, see Storage vMotion to thin disk does not reclaim null blocks (2004155).

Note: The preceding link was correct as of April 4th 2023. If you find the link is broken, provide feedback and a VMware employee will update the link.

Shrinking

Virtual disk shrinking is supported when using VMware Converter converting source virtual machine as a machine source (not as virtual to virtual).
Note: You cannot shrink virtual disks using vmkfstools in ESXi as the hypervisor is not aware of the file system layout and cannot ensure a safe shrink operation.

Before shrinking

Migrate the data away from the end of the disk consume to ensure the data is not lost (because the disk area is effectively removed). For example, in Windows GuestOS use Disk Management tool.

Shrink the partition residing within a disk before reducing the size of a virtual disk.

Non operating system disks users can also add a new smaller VMDK to the virtual machine and copy the data between the larger and new smaller disk using tools within the guest such as Robocopy.

Additional Information

For translated versions of this article, see:

日本語: VMware ESX および ESXi の仮想ディスクを拡張、縮小、および圧縮する (2092650)

简体中文: 扩展、精简和压缩 VMware ESX 和 ESXi 的虚拟磁盘 (2101443)

Deutsch: Vergrößern, Verschlanken und Verkleinern von virtuellen Festplatten für VMware ESX und ESXi (2145087)

Related Information

VMware Skyline Health Diagnostics for vSphere - FAQ

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
Chinese (Simplified)JapaneseEnglishGerman

Attachments

Additional Resources

No results for undefined

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware vSphere ESXi

Related Versions:

VMware vSphere ESXi 6.7

VMware vSphere ESXi 6.5

VMware vSphere ESXi 6.0

Take Our Survey

Was this article helpful?

YES

NO

Copyright © 2005-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.

Terms of Use

Your California Privacy Rights

Privacy

Accessibility

Cookie Settings

Support Assistant