VMware Cloud Community
Dagger213
Contributor
Contributor

Moving C drive VMDK ESXI 5.1

Hello,

I Have a datastore that is running out of space. I figured a quick band-aid while we quote new hardware would be to move the C drive VMDK of the Exchange server to another datastore on the same host.(This site does not have a san or vcenter. its a single host enviroment)

My question.

If i shut down the Guest vm, relocate the C drive vmdk and re-add it back into the Guest VM, Will my Exchange VM boot back up or are there things i need to modify in the VMX file?

Thank you,

Joe

Tags (2)
0 Kudos
5 Replies
daphnissov
Immortal
Immortal

Nope, you should be good to do that.

But before you do, I'd strongly recommend you exercise some caution and create a full, standalone backup of that Exchange VM before you shut it down. Any time you perform VM- or disk-level configuration changes or migrations, you should always create a backup.

0 Kudos
Dave_the_Wave
Hot Shot
Hot Shot

You certainly don't need vCenter for this.

You can do what you want from the datastore browser.

Create a new folder in the other datastore.

Copy over two files: .vmdk and .vmx

Add the .vmx to the Host Inventory and run.

Once the moved vm is satisfied, delete from disk the old vm.

Aside from your already regular backup intervals, It's not necessary to make another final full backup of the vm since you are copying (not moving) it to the other datastore.

0 Kudos
TheBobkin
Champion
Champion

Hello Dagger213

@Dave_the_Wave

"Copy over two files: .vmdk and .vmx"

"Once the moved vm is satisfied, delete from disk the old vm."

Sorry, but I have to point out that this is a potentially destructive bit of advice - one might construe this as moving/copying just the .vmdk descriptor file which is essentially a plain text file that describes the actual data disk (-flat.vmdk), NOT the actual data.

daphnissov

"Nope, you should be good to do that."

While it is all well and good to say that something is okay to do, please take more than 5 seconds to elaborate on correct procedure for performing such tasks - this is peoples data that is being dealt with (+kudos for advising taking back-ups before proceeding with such actions).

"If i shut down the Guest vm, relocate the C drive vmdk and re-add it back into the Guest VM, Will my Exchange VM boot back up or are there things i need to modify in the VMX file?"

Best practice is not to use commands such as 'mv' for this procedure as corruption may be more likely to occur- if you can afford downtime then use vmkfstools -i to clone the disk to the new location, e.g.:

# vmkfstools -i <options e.g. thin> "/vmfs/volumes/SourceDS/VMname/VMname.vmdk" "/vmfs/volumes/DestinationDS/VMname/VMname.vmdk"

https://docs.vmware.com/en/VMware-vSphere/6.0/com.vmware.vsphere.storage.doc/GUID-01D3CF47-A84A-4988...

Create the namespace folder for the VM first of course:

# mkdir /vmfs/volumes/DestinationDS/VMname

Then all you have to do is remove the original disk and add the new cloned disk in its place via the Web or C# Client - you can relocate the VMs working files (.vmx etc.) to this new datastore if you want to: unregister the VM from the host then move all the contents of the original namespace folder with cp/mv and  then re-register the VM from the new location (do this with VM still powered off of course).

Bob

0 Kudos
Dave_the_Wave
Hot Shot
Hot Shot

I thought I was very clear and specific when I wrote:

"Copy over two files: .vmdk and .vmx"

Once add the duped vm is added to Inventory and run, it will even ask you if it was moved or copied. Answer "I copied it". Even the MAC address in the nics will be preserved.

There is absolutely nothing destructive about copying over any kind of files, vm or otherwise.

0 Kudos
daphnissov
Immortal
Immortal

TheBobkin​, OP asked for conceptual validation of a procedure, which I provided. OP gave no indication s/he either would not be able to carry out the procedure proposed or required assistance in doing so. I'm more than happy to provide technical, step-by-step instructions, as you have preemptively done, if OP wishes them.

0 Kudos