VMware Cloud Community
TelecomVanuatu
Contributor
Contributor

Migration of VM machine to another datastore but not the vmdk

I have two datastores and one is almost full

i want to migrate VM machine to the other datastore but keep the vmdk file in the current datastore

what is the process?

0 Kudos
4 Replies
a_p_
Leadership
Leadership

One option (if available) is to use Storage vMotion. The "Advanced" options allow you to select what to migrate to another datastore.

André

0 Kudos
Yuva_1990
Hot Shot
Hot Shot

Hi

We can achieve this by using the advanced option which is available in storage V motion wizard.We can choose the specific disks are only the configuration files which needs to be migrated

Regards

Yuvaraj

0 Kudos
TelecomVanuatu
Contributor
Contributor

IT is a standalone server and i only wanted to move the VMDK file to the other datastore

0 Kudos
a_p_
Leadership
Leadership

If you want to move the virtual disk (vmdk), i.e. not everything except the .vmdk as stated in your initial post, you can do this from e.g. the ESXi host's command line.

  • IMPORTANT: make sure that the VM has no active snapshots (no "...-00000x.vmdk" files in the VMs folder)
  • cleanly shut down the VM
  • create a new target folder for the VM's files on the target datastore
  • run: vmkfstools -i /vmfs/volumes/source-ds/vm-folder/virtual-disk.vmdk /vmfs/volumes/target-ds/vm-folder/virtual-disk.vmdk
    in case you want to have a thin provisioned target virtual disk, append -d thin to the command line
  • edit the VM's settings from the GUI, i.e. remove the original virtual disk from the VM's settings, and then add the cloned one using the original SCSI identifier (e.g. scsi0:0)

Note: The vmkfstools command expects the .vmdk descriptor file name (i.e. the one without flat in its name). The command will clone the virtual disk (descriptor as well as data file), and you can delete the virtual disk on the source datastore after verifying that everything works as expected.

André

0 Kudos