"ESXi"-Adjust VMDK files (expand, shrink, convert) @20210225

Problem Description

In the daily maintenance and management of virtual machines, we may encounter the following scenarios:

	Shrink: Allocate excessive VMDK space, and reclaim space in the future to prevent disk waste; 
	Expansion: Insufficient virtual disk space, need to expand; 
	Conversion: For virtual disks, switch between Thin and Thick types;

This article will gradually sort out (currently not perfect enough) solutions to related problems and methods of operation.

Precautions

VMware vCenter Converter Standalone

When I first used the tool, I found that there was no way to adjust the size, but many "articles" said it was OK. After investigation, it is found that the disk size adjustment is only applicable to Windows virtual machines. If it is a Linux virtual machine, it cannot be resized ("Because changing the parameters between booting will cause the system to fail to start"...I didn't understand this sentence). So, if you choose Linux virtual machine, you will not see the "Select volumes to copy" button.

Therefore, different types of virtual machines need to adopt different methods. This article will not sort out all the solutions, but only sort out the problems we encountered and the solutions to the problems.

#(Shrink) Use VMware vCenter Converter Standalone to shrink Windows disk

In this part, we will use VMware vCenter Converter Standalone to shrink the Windows disk. The operation is not complicated, but the following requirements must be met:

	(1) The virtual machine needs to be shut down; 
	(2) This method will copy the VMDK file instead of directly adjusting the size of the original VMDK file; 
	(3) It will adjust the size during the process of copying the VMDK file, so the target location needs to be sufficient Space for new files;

The following is a key screenshot, which contains the key steps of the operation:
pasted_image.png

The general operation steps are as follows (the difficulty is moderate, so a brief description):

	Connect to the source host, select the virtual machine => Next step => Connect to the destination host, select the location => Select the Select volumes to copy option in Destination Localtion/Data to Copy/Edit/Data copy type => Adjust the size in Destination Size

As mentioned in the "Notes" section, resizing with VMware vCenter Converter Standalone is only applicable to Windows hosts.

#(Shrink) General Method

-「SHRINK A VMWARE VIRTUAL MACHINE DISK (VMDK)

This method does not rely on tools, manual operation, directly modify the virtual machine configuration file. It is divided into two steps:

	(1) In the operating system, reduce the operating system disk space (this can be done in the operating system); 
	(2) Log in to the physical machine disk, find the virtual machine configuration directory, and modify the "RW xxxxx VMFS" in the *.vmdk file "xxx-flat.vmdk"'' line to modify the size; 
	(3) Power off for migration. After power on, you will find that the virtual machine disk has been reduced;

Note: This operation has a certain degree of risk, and data needs to be backed up before the operation.

Additional information

Thinning vs shrinking

1) Thinning is converting a disk to thin provision type. This will not release any space.
2) Shrinking is reducing the size of the disk.

Related Links

About VMware vCenter Converter Standalone User Guide

related articles

"ESXi"-make a USB boot (from official documents)
"Linux"-expand VMDK virtual disk (restart or dynamic)
"VMware ESXi"-the version of the virtual machine is not compatible with the version of the host "xxxx"

references

Unable to resize disks using VMware Converter
Thinning vs shrinking
Growing, thinning, and shrinking virtual disks for VMware ESX and ESXi (1002019)

Guess you like

Origin blog.csdn.net/u013670453/article/details/114094034