Virtual Machine Files
A virtual machine consists of several types of files you store on a supported storage device. The key files that make up a virtual machine are the configuration file, virtual disk file, NVRAM setting file, and the log file. For VMware virtual machines, the virtual machine settings can be configured via the vSphere Client. Table 18-1 lists the VMware virtual machine file types.
Table 18-1 VMware Virtual Machine Files
File | Usage | Description |
.vmx | vmname.vmx | Virtual machine configuration file |
.vmxf | vmname.vmxf | Additional virtual machine configuration files |
.vmdk | vmname.vmdk | Virtual disk characteristics |
-flat.vmdk | vmname-flat.vmdk | Virtual machine data disk |
.nvram | vmname.nvram or nvram | Virtual machine BIOS or EFI configuration |
.vmsd | vmname.vmsd | Virtual machine snapshots |
.vmsn | vmname.vmsn | Virtual machine snapshot data file |
.vswp | vmname.vswp | Virtual machine swap file |
.vmss | vmname.vmss | Virtual machine suspend file |
.log | vmware.log | Current virtual machine log file |
-#.log | vmware-#.log (where # is a number starting with 1) | Old virtual machine log files |
Additional files are created when you perform certain tasks with the virtual machine:
- A .hlog file is a log file used by vCenter Server to keep track of virtual machine files that must be removed after a certain operation completes.
- A .vmtx file is created when you convert a virtual machine to a template. The .vmtx file replaces the virtual machine configuration (.vmx) file.
Note
Every vendor has different file types that make up a virtual machine.
Virtual Machine vs. Container
Before comparing virtual machines with containers, let’s first look at what a container is and what its main components are. A container is a unit of lightweight, executable software that packages application code and its dependencies in a standardized way. This packaging allows an application to be mobile and executed across different locations.
The container image contains all the information for the container to run, such as application code, operating system, and other dependencies (for example, libraries). There are multiple container image formats, with the most common of them being the Open Container Initiative (OCI). The container engine pulls the container images from a repository and runs them. There are a number of container engines, such as Docker, RKT, and LXD. Container engines can run on any container host (such as a laptop), on a datacenter physical server, or in the public cloud. The container is a container image that has been initiated or executed by the container engine.
Containers are often compared to VMs, as they are both portable single units of packaged compute; however, they solve different problems. Whereas VMs aim to abstract an operating system from the physical server, containers aim to create an environment for application code to be executed in. Similar to how VM hypervisors virtualize the hardware to host multiple isolated operating systems, the container engine virtualizes the operating system to host multiple isolated applications. Containers are naturally smaller in size compared to VMs, as they are purposely built to run applications and they package only the absolute minimum amount of data and executables required. Containers have introduced the concept of immutability, as they do not need to be updated or patched, as with virtual machines. Any updates require an existing container to be destroyed and replaced with a new one.
Figure 18-2 compares a virtual machine with a container.
Figure 18-2 Virtual Machine vs. Container