File structure

A VM is composed of several files that typically reside on a datastore in the VMs folder. The VM settings are managed through vSphere Client, but you can also use the command line using PowerCLI, vCLI, or the vSphere Web Services SDK.
The core files that compose a VM are as follows:

  • .vmx: This is a plaintext file that stores the configuration of the VM. The file contains information related to the hardware that resides in the VM, such as the processor number, the amount of RAM, the disks, the MAC address, the virtual hardware version, the number of NICs connected, the virtual disk location, and other configurations of the virtual machine, as shown in the following example:
config.version = "8"
virtualHW.version = "14"
nvram = "Windows12.nvram"
pciBridge0.present = "TRUE"
svga.present = "TRUE"
floppy0.present = "FALSE"
svga.vramSize = "8388608"
memSize = "4096"
powerType.powerOff = "default"
powerType.suspend = "default"
powerType.reset = "default"
...

The .vmx file contains a list of keys and related values that identify the components configured in the selected VM. To determine, for example, the configured RAM or the installed OS in the VM, you need to scroll down the list and identify the keys, memSize, and guest OS, which indicate the requested information. The .vmx file is only the configuration file of the VM and doesn't store any data from the guest OS. The virtual hard disk file with a .vmdk extension is responsible for storing the actual data of the VM.

  • .vmdk: Identifies the virtual hard disk of the VM that holds the data of the guest OS instance. A VM can have one or more .vmdk files depending on the disks configured in the .vmx file. For instance, if you configure disks C: and D: in a VM running Windows OS, you will have two .vmdk files, one for each configured drive.

If you browse the datastore where the VM resides, you can see only a single .vmdk file (if the VM is configured with a single drive). Technically, the virtual hard disk is composed of two files with the same extension: a VMDK descriptor and a flat.VMDK file. Let's take a look at the roles of these files.
The .vmdk file is the descriptor file, a plaintext file that contains the configuration information and pointers to the flat file. Generally, the .vmdk descriptor file is a small file. -flat.vmdk is generally a large binary file that contains the actual data of the VM. Its size is defined in the .vmx configuration file. The .vmdk file can start from a few GB in size and can grow up to 62 TB (the maximum size supported in vSphere 6.7 ). To see both the .vmdk and -flat.vmdk files, you need to access the command line, navigate to the datastores folder where the VM resides, and run the ls -lah command, as shown in the following screenshot:

  • .nvram: This is a binary file that cannot be edited and contains the VM BIOS or EFI configuration. If you delete this file, it will be automatically recreated when the VM is powered on.
  • .log: This is saved in the same directory as the VM configuration files and contains the logs of the VM activities. It can be used for troubleshooting if you encounter a problem. A new .log file is created every time the virtual machine experiences a power cycle.
  • .vswp: For each powered-on VM, two files are used as swap files in case of RAM contentions. The biggest is usually the size of the vRAM of the VM minus the vRAM reservation.

Snapshot-related files will be described in the Managing VMs section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.93.221