Files that make up a Virtual Machine:
A virtual machine in VMware consists of several files, either stored on a network datastore or on a local datastore on the ESXi host. The key virtual machine files are configuration file, virtual disk file, NVRAM setting file, and log files.
Below are the list of key files:
vm_name-flat.vmdk
Is an encrypted file used to store the content of virtual hard disk drives, its a non human readable file, this file is stored in the same directory as the .vmx file. This file is as big as your hard disk configured for the virtual machine, the vm_name-flat.vmdk is where the data live.
vm_name.vmx
Is the virtual machine configuration file, the is human readable and editable file, you can cat this file to read the virtual machine configuration. VMware administrators can use a text editor to modify the .vmx file to make virtual machine configurations if needed.
vm_name.vmxf
Additional virtual machine configuration files, this is a supplemental helper file.
vm_name.vmx~
This is a virtual machine auxiliary file, holds temporary configuration changes of virtual machine while the machine is on. When the machine is restarted, it will write to the .vmx configuration file and the auxiliary file disappears. This prevent from corruption of the .vmx file.
vm_name.vmx.lck
This is a virtual machine lock file, the file ensures virtual machine is registered with only one ESXi. Virtual machine can register/run on only one ESXi at any point of time, virtual machine does not have capability to take resources (memory, CPU, network) from two different ESXi. Lock files get created when the virtual machine is powered on, the size of the lock file is ‘0’ KB, when the virtual machine is powered off the lock file will go away.
vm_name.nvram
This file is responsible for virtual machine BIOS or EFI configuration, it contains the saved state of the BIOS of a virtual machine in a form similar to non-volatile memory. When you restart a virtual machine at the moment when the VMware logo flashes on your screen, if you hit delete key on your keyboard, you will be taken to the virtual BIOS, here you can change the boot order, this is given by .nvram file. Do not delete this file.
vm_name.vmsd
Is a database that stores information about a virtual machine’s snapshots, including metadata, and primary source of information for the snapshot Manager. The file contains line entries which define the relationships between snapshots as well as the child disks for each snapshot.
vm_name.vmsn
A .vmsn file include the current configuration and the exact state of the virtual machine, when the snapshot was taken. Using this snapshot, you can then restore your machine to the same state as when the snapshot was taken. Capturing the memory state of the virtual machine lets you revert to a turned on virtual machine state. With non-memory snapshots, you can only revert to a turned off virtual machine state. Memory snapshots take longer to create than non-memory snapshots.
vm_name.vmss
A VMSS file saves the state of a virtual machine, when it is in a suspended state. Suspending a virtual machine writes the state to a file with a .vmss extension. By default the .vmss file is stored in the directory in which the virtual machine configuration files (.vmx) are stored.
vm_name.vswp
Virtual machine swap file can be found in the virtual machine directory on datastore. Swap file is required by VMkernel to swap virtual machine memory to disk in case of excessive over provisioning. Swap file is equal to the amount of memory allocated to the virtual machine and it can grow while the virtual machine is in running state. Shrinking of the file can be done by restarting the virtual machine.
Swap file = Allocated Memory – Memory Reservation, by default the reservation is set to 0, so the .vswp file is equal to the amount of virtual memory. If virtual machine has 8GB and you reserve 50% then .vswp file will be 4GB. If you reserve 100%, the file is still there but with a size of 0 bytes.
There is also an additional .vswp file with size between 50-150MB reserved for Virtual Machine Executable (VMX) process. This file cannot be removed.
Swap file = Allocated Memory – Memory Reservation, by default the reservation is set to 0, so the .vswp file is equal to the amount of virtual memory. If virtual machine has 8GB and you reserve 50% then .vswp file will be 4GB. If you reserve 100%, the file is still there but with a size of 0 bytes.
There is also an additional .vswp file with size between 50-150MB reserved for Virtual Machine Executable (VMX) process. This file cannot be removed.
vm_name.log
VMware virtual machine log files are named as vmware.log, and are located in the virtual machine folder. Log file records events related to virtual machine activity, like if you are not able to power-on a virtual machine, any hardware changes to virtual machine, a virtual machine crash, or any other errors with the virtual machine.
vm_name-#.log
Old virtual machine log files keep auto rotating when the virtual machine is powered on, like vmware-#.log (where # is a number starting with 1). The latest log file is always vmware.log.
vm_name.scoreboard
Scoreboard files are used by Aria Operations monitoring tool, if you have Aria Operations for logs in your environment it can read these files and provide operational visibility and intelligent analytics for troubleshooting and auditing.
Additional files are created when you perform certain tasks with the virtual machine.
- A .vmtx file is created when you convert a virtual machine to a template. The .vmtx file replaces the virtual machine configuration file (.vmx file).
- A .hlog file is a log file that is used by vCenter Server to keep track of virtual machine files that must be removed after a certain operation completes.
