VMware Cloud Community
Jona_S
Contributor
Contributor

How to relocate a vm from datastore1 to datastore2

Hello everybody.

I try / want to move a vm on my ESXi 5.5 <datastore1> to <datasore2>.

I found some articles about vmkfstools but there was no nothing written about relocating a vm with all corresponding snapshots...

So my question is:

How can I move a vm from one datastore to another including all my snapshots under ESXi 5.5?

Thank you very much for your replies.

(vmkfstool: VMware KB: Cloning and converting virtual machine disks with vmkfstools )

0 Kudos
4 Replies
rcporto
Leadership
Leadership

This ESXi host is managed by vCenter ?

---

Richardson Porto
Senior Infrastructure Specialist
LinkedIn: http://linkedin.com/in/richardsonporto
0 Kudos
Jona_S
Contributor
Contributor

no I am using vSphere Client / Workstation 10

0 Kudos
continuum
Immortal
Immortal

mkdir /vmfs/volumes/datastore2/vm-name

vmkfstools -i /vmfs/volumes/datastore1/vm-name/basedisk.vmdk  /vmfs/volumes/datastore2/vm-name/basedisk.vmdk
cp /vmfs/volumes/datastore1/vm-name/basedisk-0000*.vmdk  /vmfs/volumes/datastore2/vm-name/

cp /vmfs/volumes/datastore1/vm-name/*.vmsn /vmfs/volumes/datastore2/vm-name/

cp /vmfs/volumes/datastore1/vm-name/*.vmsd /vmfs/volumes/datastore2/vm-name/

cp /vmfs/volumes/datastore1/vm-name/*.vmx /vmfs/volumes/datastore2/vm-name/

or in plain text: use vmkfstools to copy the basedisk and cp to copy everything else
Before you start the copied VM for the first time inspect all vmdk-descriptorfiles and fix absolute paths in case you find any.
In the vmx-file delete the line that gives the path to the vswp or vmem-file and fix absolute paths for the vmdks.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
Jona_S
Contributor
Contributor

Thank you very much for your reply.

I found an easier way to manage my problem:

https://networklessons.com/vmware/vmware-esxi-5-move-vm-to-different-datastore/

thx a lot!

0 Kudos