The administrator might have to change a virtual machine configuration, for example adding another virtual hard disk or adding another network adapter. The administrator can change all virtual machine settings while the virtual machine is powered off. However, some hardware changes can be made to the virtual machine even while the virtual machine is running, such as adding hard disks. The dialog also gives the administrator the possibility to remove virtual hardware and set options such as controlling the virtual machine’s CPU and memory.
The entire virtual machine configuration can be changed using the virtual machine’s Edit Settings dialog box. To display virtual machine’s properties, right-click the virtual machine in the inventory and click Edit Settings. You can use the Virtual Hardware tab to modify the virtual hardware of the virtual machine. It is also possible to use the legacy vSphere client for altering a virtual machine’s configuration. However, as it is not supported to configure the most recent virtual hardware features (introduced in VMHW 8 or higher), administrators should prefer vSphere Web Client.
Adding devices to a virtual machine
Adding or removing devices to physical server requires administrator to physically interact with the server in the data center. When using virtual machine, resources can be added or removed dynamically with zero loss in service. The administrator might need to shut down the virtual machine to remove virtual hardware, but he can reconfigure the virtual machine without being physically present at the data center.
To add a virtual hardware to a virtual machine, follow the next steps:
- Right-click the virtual machine and select Edit Settings.
- Select the Virtual Hardware tab in the Edit Settings dialog box.
- In the new device drop-down menu, select the hardware which you would like to add and click on Add.
The following screenshot shows some of the hardware that can be added to a virtual machine:
CPU and memory can also be added while the virtual machine is powered on. This feature is known as CPU Hot-Plug and Memory Hot-Add option. To use these features:
- VMware tools must be installed on the virtual machine
- Virtual machine must use hardware version 7 or later
- The guest operating system must support the CPU hot-plug and memory hot-add features
- The hot plug option must be enabled in VM options tab under the Edit Settings dialog box
Increasing the size of a virtual disk
The administrator can increase the size of a virtual disk attached to a virtual machine, while the virtual machine is powered on. Virtual machine disk size can be increased if the virtual machine is a flat virtual disk in persistent mode and virtual machine doesn’t have any snapshots. If the virtual hard disk is provisioned in Thick-Provision Eager-Zeroed mode, it will automatically become Thick-Provision Lazy-Zeroed after expanding the size. You can convert it back by migrating the appropriate disk using Storage vMotion, while specifying the Eager-Zeroed allocation mode.
To increase the size of a virtual disk, perform the following steps:
- Login into vCenter Server using vSphere Web Client.
- Right-click the virtual machine in the inventory and select Edit settings.
- Select the hard disk in the hardware list.
- Type the new size of the hard disk.
After the size of the disk is increased, the administrator must increase the size of the file system on this disk. The administrator should use the appropriate tool inside the guest operating system to enable the file system to use newly allocated disk space. For example, if administrator is using Windows 2003 or XP, he can use the disk part utility to increase the file system on the disk. For Windows 2008 and 7 onwards, these operating systems have inbuilt tools to expand the file system. For Linux systems, there are plenty tools available depending on the used file system such as resize2fs and xfs_growfs.
Inflating a thin provisioned disk
The administrator can inflate a thin provisioned disk; the inflated virtual disk occupies the entire datastore space originally provisioned to it. Inflating a Thin-provisioned disk converts a thin disk in a Thick-Provision format.
To inflate a thin provisioned disk, perform the following steps:
- Login using vSphere Web Client.
- Select the virtual machine from the inventory and click Edit Settings.
- Expand the virtual disk you want to inflate. Note that the Disk File field contains the datastore path to the virtual disk.
- Cancel the wizard and select the appropriate datastore path by selecting Related Objects and Datastores.
- Navigate to the path you discovered in the wizard.
- Right-click the VMDK file and select Inflate.
A more user-friendly way to convert Thin-provisioned disks into Thick-Provision format is to use Storage vMotion. We will cover this in the next section.