VMFS Recovery™
Recover data from damaged or formatted VMFS disks or VMDK files
Recover data from damaged or formatted VMFS disks or VMDK files
Last updated: Nov 09, 2022

Disk Mode for the ESXi VM

When creating a new virtual disk or trying to add more virtual disks, during the setup stage, you'd discover a "Disk Mode" option, which has three sub-options: Dependent, Independent – persistent, and Independent – non-persistent. The Disk Mode feature is also available when you use the ESXi host (web client).

What do these Disk Mode options mean, and which should you select?

In this article you will find:

  • ESXi Disk Mode Configuration
  • ESXi Disk Modes Description
  • How to Use ESXi Disk Modes

Ready? Let's read!

ESXi Disk Mode Configuration

If you were working with the VSphere client, you could choose a disk mode from the settings page – the same applies when working with the ESXi web client of an ESXi host. But, to get started with ESXi disk mode configuration, you must connect to the ESXi host from the virtual machine or via another server you have the host address and host admin credentials.

After that is done, you'd need to get the parameters of the current disks on the actual VM you're working on using specific commands (via PowerCLI):

PS C:\> Connect-VIServer –Server ”Server name or IP” -Force

Now, get the list of all the disks on the VM:

PS C:\> Get-HardDisk -VM "VM Name"

With the disks all shown, you can then pick the exact one you need to work on – from the ones connected to the VM ([" Disk number"]).

  • [0] – New VM.vmdk;
  • [1] – New VM_1.vmdk;
  • [2] – New VM_2.vmdk.

The disks will show different disk modes as per how they were created. Hereunder is how the disk modes will appear:

  • Dependent will show as Persistent;
  • Independent – persistent will appear as IndependentPersistent;
  • Independent – Non–persistent will appear as IndependentNonPersistent.

Now, you can change the disk mode of the VM disk you want using specific commands.

PS C:\> (Get-HardDisk -VM "VM Name")[”Disk number”] | Set-HardDisk -Persistence "Persistent"-Confirm:$false

Double-check to confirm that the VM's disk mode has been changed using the following:

PS C:\> Get-HardDisk -VM "VM Name"

After your confirmation, if everything worked fine, you should then disconnect the ESXI host session so that it would stop consuming your host's resources, as well as present a potential vulnerability until the next reboot. Use the below command to disconnect.

PS C:\> Disconnect-VIServer -Server ”Server name or IP” -Force

ESXi Disk Modes Description

Apparently, you may have been trying to understand the differences between these disk mode types hinted above in this article. Well, here's the answer you seek – below are the definitions of the three VMDK disk mode types, so you can know why you should choose a particular one.

1. Dependent

This is the "base" VMDK disk mode, which means that if you do not manually select a disk mode during your VM setup, the system will automatically choose "Dependent" for you. This disk has no specialty – just your ordinary VMDK disk.

2. Independent – Persistent

While this disk mode looks to work similarly to the "Dependent" mode, it differs in "snapshots." When you choose this disk mode, it means that you want changes to the disk to be permanent. In Independent Persistent, when you create a snapshot, no delta disk is created because all changes are written directly to the disk. So, even if you delete the snapshot, the changes will still be preserved. This means you can revert errors when you use this disk mode – it calls for more carefulness.

3. Independent – Non– Persistent

In contrast to the Independent-Persistent mode discussed above when you create snapshots with this disk mode, a delta disk is created, and all changes will be saved on that delta disk – the previous copy of the data then becomes "Read-only." So, in a case where the VM stops running (you stopped it) or you deleted a snapshot, the changes would be discarded. Most people don't prefer this disk mode anyway.

Using ESXi Disk Modes

Having understood the meaning of these disk modes, when should you use them, specifically?

1. Dependent

Dependent disk mode isn't in any way special; it is just an ordinary disk mode. There's no real point in describing this in any precise way since it's an ordinary disk. When you create a snapshot in a dependent VMDK disk, the data is saved to the delta disk and is deleted or added to existing data, depending on the need.

2. Independent – Persistent

If you use snapshots often, this may be the best disk mode for you. So that when you revert a snapshot, nothing happens to the original data, and neither would the disk be affected in any way. Independent persistent mode is best used for storing log data; the VM's state–whether running or not – does not affect the data.

3. Independent – Non– Persistent

Independent non-persistent mode is used on the system meant for testing software updates since this disk mode can survive reboots. Also, if you use snapshots too often, you may need to consider this disk mode to keep your virtual environment safer.

Notwithstanding, this VMDK disk mode allows you to perform any action or tests inside your VM without fear of safety risks, and if anything goes wrong, simply stop the VM, and all changes will be discarded so you can start all over.

Conclusion

This is a detailed explanation of the different disk modes available for ESXi environments. However, it is important to add that if you lost your VM's VMDK files and need to recover them, the DiskInternals VMFS Recovery software has a proven 18-year record of successfully recovering VMDK images and VMFS partitions with up to 99 percent efficiency; the program is free and easy to use.

Related articles

FREE DOWNLOADVer 4.14, WinBUY NOWFrom $699

Please rate this article.