VMware Cloud Community
Jim_MT
Contributor
Contributor

Correct syntax for vmkfstools for moving VM to a new datastore

I have data stores set up for both TEST and PRODUCTION. I have a VM with three disks - disk 2 and 3 are fine where they are at - BUT - disk 1 needs to be moved to a different datastore.

Since the folder for disk1 contains the .vmx, .vmdk, .nvram, etc files - can you use vmkfstools -i at the "folder" level so it copies everything to the new datastore? OR does vmkfstools see that disk1 resides in the folder where all the other files resides and moves everything?

Within VC when you do a cold migrate - the option to say "move disk 1 to datastore X but leave disks 2 and 3 alone" doesn't exist - or if it does I've not come across it.

So in a nutshell - how do you move the .vmx, .vmdk and all the other files relating to a VM from one datastore to another? Thanks!

0 Kudos
2 Replies
arisaperstein
Enthusiast
Enthusiast

I would use cp (copy command) to copy the files. First unregister the VM, then copy the files to the new datastore, modify the .vmx file if necessary and register the VM again.

0 Kudos
esiebert7625
Immortal
Immortal

Vmkfstools is only for copying disk files. You can use SCP on the ESX console to copy all other files. Just unregister the VM, copy the files, edit the vmx file to change any path references and then re-add the VM to the ESX server inventory. You can also use programs like FastSCP to do ESX to ESX copies.

Also see this recently posted script to move a VM...

Script for moving a VM to different storage - http://www.vmware.com/community/thread.jspa?threadID=89885

Fyi…if you find this post helpful, please award points using the Helpful/Correct buttons.

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

Thanks, Eric

Visit my website: http://vmware-land.com

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

0 Kudos