VMware Cloud Community
smith_ja
Contributor
Contributor

How to move Hypervisor VMDK to different datastore without vmotion

I have a Hypervisor vmware host version 5.0 with 4 virtual machines.  I one of my virtual machines has 2 VMDK files.  I need to move one of these VMDK files to a different datastore without using vmotion.  How can I do this?

0 Kudos
13 Replies
IT_pilot
Expert
Expert

The easiest way is to datastore browser VMWare ESXi 5 Move VM to Different Datastore | NetworkLessons.com

Since you only transfer the disk and not the VM, then do not read the further steps in the instruction (about Remove from Inventory and registering the vmx file)

Full list here VMware Knowledge Base

http://it-pilot.ru
0 Kudos
smith_ja
Contributor
Contributor

Do I need to power down the virtual machine first?  Do I just browse to the folder on the datastore and select move?  Are there any more steps?  More details would be appreciated.

0 Kudos
IT_pilot
Expert
Expert

There is no need to turn off the VM (If you have a SCSI adapter). I myself have not used the IDE for a long time, but write that "To remove an IDE hard disk, you must power off the virtual machine."

But you must Remove a Hard Disk from a Virtual Machine (BUT do not "Delete from Disk")!!!

VMware vSphere 4 - ESX and vCenter Server

http://it-pilot.ru
0 Kudos
a_p_
Leadership
Leadership

Welcome to the Community,

without vCenter Server in place, one option to migrate the virtual disk to another datastore is to do it from the command line.

For this task it's important to know that each virtual disc consists of two files, a descriptor file "<vmname>.vmdk", and a data file "<vmname>-flat.vmdk".

  1. power off the VM
  2. make sure the VM doesn't have active snashots!!! (i.e. no delta .vmdk files in the VM's folder)
  3. create a new target folder on the destination datastore
  4. clone the virtual disk, using the following command
    vmkfstools -i /vmfs/volumes/source-ds/vm-folder/virtual-disk.vmdk /vmfs/volumes/target-ds/vm-folder/virtual-disk.vmdk
    if you want the destination virtual disk to become thin provisioned, append -d thin to the above command line
    for details see e.g. https://kb.vmware.com/s/article/1028042
  5. from the GUI, edit the VM's settings, i.e. remove the migrated virtual disk from the VM's configuration (do not yet select delete from disk), save the VM's settings,, then open the settings again and add the existing virtual disk from the target location to the VM (make sure you select the same adapter, e.g. scsi0:1 to which the original virtual disk was connected)

If everything works as expected you may then carefiully delete the obsolete/migrated virtual disk file(s) from the source datasatore.

André

IT_pilot
Expert
Expert

After transferring the disk, you must Add a Hard Disk to a new Virtual Machine in the vSphere Client.

Select "Use an Existing Virtual Disk" VMware vSphere 5.1

Then, depending on which operating system inside the VM to perform the actions for initializing the newly added disk.

http://it-pilot.ru
0 Kudos
a_p_
Leadership
Leadership

... perform the actions for initializing the newly added disk.

Why would you want to do this? It's a disk with existing data on it.

André

0 Kudos
IT_pilot
Expert
Expert

The operating system itself does not see the disk.

You must enter the VM and take the necessary action. After that we will see the newly connected disk and the data on it.

I do not write "format a disk".

In addition, Windows immediately determines that the disk has data and does not offer to perform formatting (in contrast to adding a disk without a file system)

http://it-pilot.ru
0 Kudos
a_p_
Leadership
Leadership

Ok, so you are actually talking about rescanning, and taking the disk online if it's not detected automatically.

Initializing is used to create a new partition table (MBR, or GPT) on a new/raw disk.

André

0 Kudos
smith_ja
Contributor
Contributor

I have a VMware Hyper-v host that I am updating from version from version 5.5  to version 6. My boss did not pay for support, VMotion, Update Manager or a VCenter license for this host. The best instructions I can find to update this host is to boot off the DVD and run upgrade.  One of the virtual machines has a VMDK folder on the same partition as the VMware Host operating system.  I need to move this before I upgrade the host because I am afraid that the upgrade will wipe this partition.

So I have two options.  Both seem like good options.  Is this correct?

Option 1 (Suggested by a.p)

Clone the VMDK file with vmkfstools

Remove the original VMDK hard disk from the VM (do not delete)

Add the new hard disk using the new existing cloned VMDK file

Delete the old VMDK file.

Option 2 (Suggested by IT_pilot)

Remove the VMDK from the VM. (do not delete)

Browse to the datastore and move the VMDK file to a different datastore

Add the new hard disk using the existing moved VMDK file.

0 Kudos
a_p_
Leadership
Leadership

... I am afraid that the upgrade will wipe this partition

Unless you force it during the upgrade, the VMFS partitions (on which the VMs are stored) will not be affected by the upgrade.

Although you should not experience issues due to the upgrade (assuming your hardware is supported by the new version), I strongly recommend that you have an up-to-date backup of the data before running the upgrade.

André

0 Kudos
IT_pilot
Expert
Expert

I do not quite understand the general concept described now.

But if we are talking about a vmdk disk, then after you download it from the vmware datastore to your computer, it will not disappear any more. After you download this disk to a new datastore, the original will still be on your computer. And if something goes wrong then the procedure can be repeated.

In addition, you can conduct an experiment on a test drive to understand how everything works.

http://it-pilot.ru
0 Kudos
smith_ja
Contributor
Contributor

I am only going to download the OVA files to my PC as a backup before the upgrade.  I am hoping I will never need this backup.  I thought that the upgrade formatted the vmware host partition during the upgrade process.  This is why I wanted to move the virtual machine VMKD to a different partition before the upgrade.

0 Kudos
IT_pilot
Expert
Expert

1."One of the virtual machines has a VMDK folder (disk?) on the same partition as the VMware Host operating system" - it's impossible.

2. Make backups better by using Veeam Backup Free Edition.

http://it-pilot.ru
0 Kudos