VMware Cloud Community
mlubinski
Expert
Expert

move one of VMDK files to another datastore

Maybe someone will need this operation in the future (I did, but already found solution). So if you want to move one vmdk file (i.e. second disk in VM) to another datastore, simply power off VM, move both vmname_1-flat and vmname_1.vmdk files to new location (the same folder name), and then edit vmx file for this VM, and in line that points to "old" location of second VMDK, change it to new location /vmfs/volumes/vmname/vmname_1.vmdk.

This should set proper disk location

[I]If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points[/I]
0 Kudos
5 Replies
firestartah
Virtuoso
Virtuoso

or just use the new storage migration

or use the free app svmotion

If you found this or other information useful, please consider awarding points for "Correct" or "Helpful". Gregg http://thesaffageek.co.uk
0 Kudos
msemon1
Expert
Expert

I have a VM with a similar issue. It looks like this:

Datastore1

VM1

VMDK1

VMDK2

Datastore2

VM1

VMX, VMXF,VMSD Log, Vswap

The VMDK's are in 1 datastore and the configuration files are in another. Is there a way to SVMotion or copy the VMDK's back into the folder with the configuration files? Does this Vm need to be re-registered? Not sure how they got separated.

Mike

0 Kudos
mlubinski
Expert
Expert

you need to do exactly like I wrote (but in different direction Smiley Happy

Just see your .vmx file, you should there see entry for harddisk0 and harddisk1 pointing to /vmfs/volumes/DATASTORE1/vmname/vm1.vmdk and /vmfs/volumes/DATASTORE1/vmname/vm1_1.vmdk

so just power this VM off (you can do this test with new created machine (before doing this change on real VM), then move (or copy for sure) these 4 vmdk (should be 4 in total, because flat, and normal vmdk) , then edit via nano editor .vmx file with entries about harddisk0 and 1 without /vmfs/volumes... so only vm1.vmdk and vm1_1.vmdk

then after power on this should be ok

[I]If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points[/I]
0 Kudos
firestartah
Virtuoso
Virtuoso

You can just use svmotion to migrate the files via a very easy gui. It's a great plug-in for esx 3.5 and allows you to migrate live un snapshoted machines to different datastores.

If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".

If you found this or other information useful, please consider awarding points for "Correct" or "Helpful". Gregg http://thesaffageek.co.uk
0 Kudos
msemon1
Expert
Expert

Your right. I think I had that backwards. Here is what I am planning:

1. Shut down VM

2. Remove from Inventory

3. Copy configuration files to Datastore with the VMDK files.

4. Edit VMX file with Nano and remove all of the path information except for the name of the VMDK.

5. Add to inventory in VC.

6. Restart VM.

Am I missing anything?

Mike

0 Kudos