VMware Cloud Community
arley_beyond
Contributor
Contributor
Jump to solution

Move VMs between data stores?

I may have to reformat one of my data stores. What is the best way to move the VMs from one datastore to another? What's the best way without using Virtual Center (one of the VMs is my VC server).

0 Kudos
1 Solution

Accepted Solutions
Dave_Mishchenko
Immortal
Immortal
Jump to solution

There's a script on this thread you can use (scroll down the thread as the original script was updated). http://communities.vmware.com/thread/89885

You would basically want to unregister the VM (you can do this with the VI client if you point the VI client at the host rather than your VC server). Then make a new folder on the new datstore and copy the vmdk over with the vmkfstools command. It'll be something like vmkfstools -i /vmfs/volumes/. This will copy over the vmkd and flat.vmdk. You would need to repeat the process if you have more than one vmdk for the VM. Then the rest of the files can be copied over with the cp command.

You'll want to make sure that you commit any snapshots if they exist on the VM before you copy over the vmdk.

View solution in original post

0 Kudos
1 Reply
Dave_Mishchenko
Immortal
Immortal
Jump to solution

There's a script on this thread you can use (scroll down the thread as the original script was updated). http://communities.vmware.com/thread/89885

You would basically want to unregister the VM (you can do this with the VI client if you point the VI client at the host rather than your VC server). Then make a new folder on the new datstore and copy the vmdk over with the vmkfstools command. It'll be something like vmkfstools -i /vmfs/volumes/. This will copy over the vmkd and flat.vmdk. You would need to repeat the process if you have more than one vmdk for the VM. Then the rest of the files can be copied over with the cp command.

You'll want to make sure that you commit any snapshots if they exist on the VM before you copy over the vmdk.

0 Kudos