VMware Cloud Community
Mactagish01
Contributor
Contributor

How to move an ESXi 3.5 VM to different datastore on same host.

Hi All,

What's the best way to move a VM to a new datastore on the same host? I've got a legacy Server 2003 VM which has run out of space, and I need to move to a new datastore (different array) on the same host. After that I'll increase the disk size available to the VM and use gparted or similar to increase the partition under windows I guess.

The host is running ESXi 3.5.0 which doesn't seem to have the ability to move the vmdk.

Thanks in advance!

7 Replies
conyards
Expert
Expert

Assuming you don;t have Storage vMotion available to you.  You can look at doing the following on a vi3.5 host.

  1. Make sure you have consolidated all snapshots on the VM (otherwise this is going to be messy).
  2. Power Off the VM and remove it from the inventory.
  3. Enable SSH services on the ESX host and SSH to the host as root
  4. Make a new directory on you new VMFS volume;
    • mkdir "/vmfs/volumes/Target VMFS Datastore/VMname Dir"
  5. Clone the VMDK files, you can choose what disk format the clone will take with options after the '-d' switch (thick/thin etc - double check the 3.5 documentation as for what this version will support, use thin if you can as it'll shorten the copy process).
    • vmkfstools -i "/vmfs/volumes/Source VMFS/VMname Dir/VMname.vmdk" -d thin "vmfs/volumes/Target VMFS Datastore/VMname Dir/VMname.vmdk"
  6. Copy the remaining VM files to the target datastore location, you can do this using a simple 'cp' command for each file. (This is for ease of administration, keeping all the files in the same place will make more sense on a 2am call out, then remembering that there are VMX edits to consider.)
  7. Add the VM to the inventory by browsing to the the target datastore location, locating the vmx file and adding to inventory from a right mouse click menu.
  8. Power on the VM and answer the Virtual machine Message with 'I copied it'
  9. Assuming the VM checks out ok at the new location you can then clean up/delete the source as appropriate.

Hope this helps

Simon

p.s. thanks for the trip down memory lane remembering this answer.

https://virtual-simon.co.uk/
TomHowarth
Leadership
Leadership

SVMotion was not available with VI3.5 therefore you need to power off your machine and migrate it.  assuming that both datastores are available to the host then when you do a cold migration you will have ability to move Datastores.

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
0 Kudos
Mactagish01
Contributor
Contributor

Thanks for the reply Simon. Smiley Happy Seems like a lot of effort is required just to move a VM!

0 Kudos
Mactagish01
Contributor
Contributor

Thanks Tom,

I don't seem to have a "move" option. I'm connecting to the ESXi 3.5.0 host using VMWare Infrastructure Client 2.5.0 - should i update that, and will it give me options for a cold migration? It's just the free version of ESXi as well. Screenshot attached showing options available when right clicking on powered down VM.

Cheers

James

0 Kudos
TomHowarth
Leadership
Leadership

no it is a part of the standard vMotion options,  from memory I think it is on the 2nd or 3rd page of the vMotion Wizard,  I do not have access to a 3.5 infrastructure to check.

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
0 Kudos
Finikiez
Champion
Champion

You can do vmotion and svmotion when you paid money for ESXi and vcenter server (aka virtual center as it was in 2.5 version)

If you have ESXi \ ESX with free license, you can't do vmotion and svmotion even it's a cold migration.

To migrate a VM from one datastore to another in free ESXi you must power off VM and copy all files manually.

0 Kudos
TomHowarth
Leadership
Leadership

I have just looked at you image as I have not had access to a computer only my phone.  and it looks that you using a standalone version of ESXi no vCenter.  if this is the case you will not have the ability to vMotion/MIgrate.

you will have to manually move the folder.

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
0 Kudos