Enabling clustering features for an existing virtual disk by converting while copying
search cancel

Enabling clustering features for an existing virtual disk by converting while copying

book

Article ID: 342282

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides steps for conversion of a virtual disk to eagerzeroedthick to support clustering features while making a copy of the virtual disk. The new copy can be attached to a new or existing virtual machine.

Virtual disks can also be converted in place.

For more information, see:



Environment

VMware ESX Server 3.0.x
VMware vSphere ESXi 5.5
VMware vSphere ESXi 5.1
VMware vSphere ESXi 5.0

Resolution

An existing VMDK virtual disk can be converted to a Thick disk with any unallocated blocks being allocated and zeroed out. This preserves any existing data in the virtual disk. This corresponds to the Enable Clustering Support option when creating a virtual disk using the vSphere Client.

It is necessary to repeat these steps after extending an existing eagerzeroedthick virtual disk with the vmkfstools -X command or by increasing the disk size using the vSphere Client.

Caution: Do not convert a virtual disk if the virtual machine has snapshots. If you want to convert a virtual disk with snapshots, ensure to delete the snapshots first. For more information, see Determining if a virtual machine is using snapshots (1004343).

To clone and convert a virtual disk to Eager Zeroed Thick from the vSphere Command Line Interface (vCLI) or VMware vSphere Management Assistant (vMA):

  1. Open a console to the vMA or other location where the vCLI is installed. For more information, see the vSphere Command-Line Interface Documentation.
  2. Locate the source VMDK virtual disk file using the vifs command. For example:

    Retrieve a list of datastores:
    vifs --server ESXHostnameOrIP --username root --listds
    [DatastoreName]
    [DatastoreName2]
    [DatastoreName3]


    Retrieve a directory listing within a datastore:
    vifs --server ESXHostnameOrIP --username root --dir '[DatastoreName]'
    VirtualMachineName
    VirtualMachineName2


    Retrieve a directory listing within a directory on a datastore:
    vifs --server ESXHostnameOrIP --username root --dir '[DatastoreName] VirtualMachineName/'
    VirtualMachineName.vmx
    VirtualMachineName.vmdk
    VirtualMachineName-flat.vmdk


  3. Power down the virtual machine using the source VMDK virtual disk file.
  4. Copy and convert the source virtual disk to a new Eager Zeroed Thick virtual disk using the vmkfstools command:

    vmkfstools <connectoptions> -i <source.vmdk></source.vmdk> <destination.vmdk> -d eagerzeroedthick

    For example:

    vmkfstools --server ESXHostnameOrIP --username root -i "[DatastoreName] MyVM/MyVM.vmdk" "[DestinationDatastore] NewVM/NewVM.vmdk" -d eagerzeroedthick

    Note: The clone command may take a few minutes, and reports the percentage of completion.

  5. Power on the source virtual machine.
  6. Attach the destination virtual disk to a new or existing virtual machine.

To clone and convert a virtual disk to Eager Zeroed Thick from the ESX host console:

  1. Open a console to the ESX/ESXi host. For more information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807) or Using Tech Support Mode in ESXi 4.1 (1017910).
  2. Locate the VMDK virtual disk file in the /vmfs/volumes/<DatastoreName>/<VMName>/ directory.
  3. Power down the virtual machine using the source VMDK virtual disk file.
  4. Copy and convert the virtual disk to Eager Zeroed Thick using the vmkfstools command:

    vmkfstools -i <source.vmdk></source.vmdk> -d eagerzeroedthick <destination.vmdk>

    For example:

    vmkfstools -i /vmfs/volumes/DatastoreName/MyVM/MyVM.vmdk -d eagerzeroedthick /vmfs/volumes/DestinationDatastore/NewVM/NewVM.vmdk

    Note: The clone command may take a few minutes, and does not report the percentage of completion.

  5. Power on the source virtual machine.
  6. Attach the destination virtual disk to a new or existing virtual machine.