File structure

A VM is composed by several files that typically reside on a datastore in the VMs folder. Settings of VMs are managed through vSphere Client but you can also use the command line using PowerCLI, vCLI, or the vSphere Web Services SDK. PowerCLI and vCLI were discussed in Chapter 5, Configuring and Managing vSphere 6.5.

The core files that compose a VM are as follows:

  • .vmx: This is a plain-text file that stores the configuration of the VM. The file contains information related to the hardware that resides in the VM, such as processor number, amount of RAM, disks, MAC address, virtual hardware version, number of NICs connected, virtual disk location, and so on:
The .vmx file contains the configuration of the VM

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 guestOS, that 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. Responsible for storing actual data of the VM is the virtual hard disk file with a .vmdk extension.

  • .vmdk: This identifies the virtual hard disk of the VM that holds the data of the guestOS 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 are able to see only a single .vmdk file (if the VM is configured with a single drive). Technically, the virtual hard disk is composed by two files with the same extension—a VMDK descriptor and a VMDK flat. What is their role? Let's have a look.

The .vmdk file is the descriptor file, a plain-text file that contains the configuration information and pointers to the flat file. Generally, the .vmdk descriptor file is a small file in size. The -flat.vmdk is generally a large binary file that contains the actual data of the VM where its size is defined in the .vmx configuration file. The .vmdk file can start from a few GB in size and growing up to 62 TB (the maximum size supported in vSphere 6.5 Update 1). To see both .vmdk and -flat.vmdk files, you need to access the command line, navigating into the datastores folder where the VM resides and running the command ls -lh:

To identify the .vmdk and -flat.vmdk files you need to run the ls -lh command from the console

The flat file does not exist on a vSAN datastore.

  • .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.
  • .vswpFor each powered-on VM, there are two files that are used as swap files in case of huge RAM contentions. The biggest is usually the size of the vRAM of the VM minus the vRAM reservation.

Snapshot-related files will be described later.

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

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