Verifying sufficient free disk space for an ESX/ESXi virtual machine
search cancel

Verifying sufficient free disk space for an ESX/ESXi virtual machine

book

Article ID: 304548

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

This article provides steps to ensure you have sufficient free disk space. When creating a virtual machine, you must be aware of the disk space requirements that need to be met to create a bootable virtual machine and to create a virtual machine that does not experience any performance issues.
This article does not discuss the sizing of LUNs. For more information on the sizing of LUNs, see VMware Virtual Machine File System: Technical Overview and Best Practices.


Symptoms:
  • Unable to create a virtual machine
  • Unable to power on a virtual machine
  • Performance problems in a virtual machine


Environment

VMware vCenter Server 5.5.x
VMware ESXi 3.5.x Embedded
VMware vCenter Server 4.1.x
VMware ESXi 4.1.x Installable
VMware vCenter Server 5.1.x
VMware ESX Server 3.5.x
VMware ESXi 4.0.x Installable
VMware vCenter Server 5.0.x
VMware ESXi 4.1.x Embedded
VMware ESX 4.1.x
VMware vSphere ESXi 5.1
VMware vSphere ESXi 5.0
VMware vSphere ESXi 5.5
VMware ESXi 3.5.x Installable
VMware vCenter Server 4.0.x
VMware ESXi 4.0.x Embedded
VMware ESX 4.0.x
VMware VirtualCenter 2.5.x

Resolution

Before attempting to create a virtual machine, you must be aware of the disk space that is available on your ESX host. For more information, see Investigating disk space on an ESX or ESXi host (1003564).
The disk space required for a virtual machine depends on whether you intend to use Snapshots/Suspending.

Virtual machine without snapshots

Use this general formula to calculate the disk space required:
(Size of virtual machine's hard disk(s)) + (size of RAM for virtual machine) + ( 100 MB for log files per virtual machine) is the minimum space needed for each virtual machine.
For example, you have 8 GB left on your LUN. If you create a virtual machine with a 8 GB hard disk, this virtual machine cannot boot. This is due to the extra space requirements for memory and other miscellaneous files ( logs, vmxf, nvram).
This is illustrated by these examples:
  1. Disk space required for a powered off virtual machine:

    [root@server1 vm1]# ls -lisah

    total 8.1G
    281 64K drwxr-xr-x 1 root root 1.6K Mar 6 19:04 .
    261 1.0M drwxrwxrwt 1 root root 5.9K Mar 6 10:42 ..
    288 8.0G -rw------- 1 root root 8.0G Mar 6 19:04 vm1-flat.vmdk
    470 64K -rw------- 1 root root 8.5K Mar 6 18:35 vm1.nvram
    287 64K -rw------- 1 root root 396 Mar 6 19:04 vm1.vmdk
    284 64K -rw------- 1 root root 436 Mar 6 19:04 vm1.vmsd
    282 64K -rwxr-xr-x 1 root root 2.0K Mar 6 19:04 vm1.vmx
    283 64K -rw------- 1 root root 258 Mar 6 17:07 vm1.vmxf
    704 1.0M -rw-r--r-- 1 root root 154K Feb 21 11:43 vmware-1.log
    705 64K -rw-r--r-- 1 root root 29K Feb 25 09:43 vmware-2.log
    844 64K -rw-r--r-- 1 root root 31K Mar 4 09:04 vmware-3.log
    841 64K -rw-r--r-- 1 root root 30K Mar 6 18:35 vmware.log

  2. Disk space required for a powered on virtual machine:

    [root@server1 vm1]# ls -lisah

    total 9.1G
    281 64K drwxr-xr-x 1 root root 1.9K Mar 6 19:07 .
    261 1.0M drwxrwxrwt 1 root root 5.9K Mar 6 10:42 ..
    849 1.0G -rw------- 1 root root 1.0G Mar 6 19:07 vm1-c8466559.vswp
    288 8.0G -rw------- 1 root root 8.0G Mar 6 19:07 vm1-flat.vmdk
    470 64K -rw------- 1 root root 8.5K Mar 6 18:35 vm1.nvram
    287 64K -rw------- 1 root root 396 Mar 6 19:07 vm1.vmdk
    284 64K -rw------- 1 root root 436 Mar 6 19:04 vm1.vmsd
    282 64K -rwxr-xr-x 1 root root 2.0K Mar 6 19:07 vm1.vmx
    283 64K -rw------- 1 root root 258 Mar 6 17:07 vm1.vmxf
    704 1.0M -rw-r--r-- 1 root root 154K Feb 21 11:43 vmware-1.log
    705 64K -rw-r--r-- 1 root root 29K Feb 25 09:43 vmware-2.log
    844 64K -rw-r--r-- 1 root root 31K Mar 4 09:04 vmware-3.log
    851 64K -rw-r--r-- 1 root root 30K Mar 6 18:35 vmware-4.log
    850 64K -rw-r--r-- 1 root root 23K Mar 6 19:07 vmware.log
There is a difference of 1 GB due to the presence of a .vswp file.
If you make reservations for your virtual machines that are equal to the amount of RAM assigned to them, swapping and page sharing does not occur. You can overcommit if you are comfortable with poor performance. If you do not set reservations, ESX host creates a .vswp file equal to the difference between the amount of physical memory assigned to the virtual machine and the reservation it has. By default, memory reservations are set to 0. If you have a virtual machine with 2 GB of memory without a reservation, it creates a 2 GB .vswp file when it is powered on. The virtual machine starts using the .vswp file if the server is out of physical RAM. If you set a 1 GB reservation, it creates a 1 GB .vswp file. The .vswp files allow for memory overcommitment.

Virtual machine with snapshots

Ensure to consider whether you are using snapshots with your virtual machine.
Prior to ESX4.0 Update 2, as well as using this formula:
(Size of virtual machine's hard disk(s)) + (size of RAM for virtual machine) + ( 100 MB for log files per virtual machine)
You need to add space for snapshots. Snapshots are usually small at first, under 100 MB if you do not snapshot the virtual machines memory. If you select memory, an additional amount equal to the amount of RAM a virtual machine has is created in the .vmsn file. The growth of snapshots depends on how many disk changes happen on the virtual machine. If few changes are made, they remain small and if many changes are made, they grow larger. It can vary depending on the role of your server. Snapshots of database and exchange servers grow quickly, snapshots of web and active directory servers usually grow slowly. They have the potential to grow up to the maximum size of the virtual machine disk.

For earlier versions prior to VMware ESX 4.0 Update 2, the task of consolidating all snapshots (Remove All Snapshots task) caused unique changes stored only in the second snapshot delta disk to be copied upwards through the snapshot chain and into the first snapshot, or its parent. This effect is recursive for each preceding parent file. For example, a base disk of size 8 GB and 2 levels of snapshots, each of 4 GB each. During a Remove All Snapshot Tasks
, the first snapshot delta disk file can grow, worse-case scenario, to 8 GB, as all new blocks from the second snapshot are written. Any common changes stored in both snapshot levels do not require additional space.

In ESX 4.0 Update 2 and later versions, the snapshot mechanism has changed. VMware ESX now incorporates improved consolidation procedures, which lessen the demand for free space. You can consolidate virtual machine delta disks even with minimal free space on your datastore.

For additional information on virtual machine snapshots, see Understanding virtual machine snapshots in VMware ESXi and ESX (1015180).
Notes:
  • VMware recommends not to leave a snapshot going for too long.
  • Snapshots can take a very long time to commit if they are large.

Additional Information

To limit the number of vmware.log files those are created for a virtual machine:
  1. Connect to your VirtualCenter server or directly to your ESX host using VMware Infrastructure (VI) Client.
  2. Select the virtual machine you want to edit from the inventory.
  3. Power off the virtual machine.
  4. Right-click the virtual machine and click Edit Settings.
  5. Click the Options tab.
  6. Select Advanced.
  7. Click Configuration Parameters.
  8. Click Add Row.
  9. Enter log.keepOld for the Name and as many historical log files as you want to keep for the value (in addition the the original vmware.log file).
  10. Click Add Row.
  11. Enter log.rotateSize for the Name and a maximum size in bytes for the log files to grow to. For example, 500000 for 500 kb.
  12. Click OK.
  13. Power on the virtual machine.

    Note
    : It now creates vmware.log files up to the size you specified and also only keep as many as you specified.

  14. Alternately, you can disable virtual machine logging by deselecting Enable logging on the Options tab. If you do this, all logging except for VMware Tools logging is disabled.

    Note
    :
    If you also want to disable VMware Tools logging, you can add an additional row in Configuration Parameters with a name isolation.tools.setinfo.disable with a value of true.

    Caution: If you require support at a later time, VMware often needs to examine that log file. You may need to enable logging before you can get receive support.


Additional Information

Investigating disk space on an ESX or ESXi host
Understanding VM snapshots in ESXi / ESX
Como verificar o espaço livre em disco suficiente para a máquina virtual ESX/ESXi
ESX/ESXi 仮想マシンに十分な空きディスク領域があることを確認する
验证 ESX/ESXi 虚拟机的可用磁盘空间是否充足