VMware Cloud Community
Ryan_Witschger
Enthusiast
Enthusiast

Moving VM Directory to New Host

Hello all,

I have two different DataCenters within VMWare and for some contigency planning for an upcoming move I am forced into a pickle which I assume is possible, but I am not sure.

Here is what I would like to accomplish.

I need to be able to move a VM's entire directory from SAN A to SAN B and then attach it back to VMWare VirtualCenter. The basic idea is if I had all of the files backed up and my entire VMWare enviornment was shipped to Istanbulia how do I attach those VMs to an entirely new host?

When I try "vmware-cmd -s register foo.vmx" I get some rather ugly errors about the datastore format.

I thought about just making all new machines and attaching just the VMDK, but I need to maintain MAC addresses, memory settings and the like. So is there some command I can use that will register a machine with virtual center while rebuilding the portions of the .vmx that change?

PS I'd rather not use VMConverter as I want to stage the entire enviornment for a quick contigency plan execution, we're talking about 5 terabytes of data.

Reply
0 Kudos
5 Replies
doctormiru
Enthusiast
Enthusiast

Hi

There are some circumstances to be aware when moving an entire VM directory to a new LUN (SAN).

\- If the *.vmdk files where splitted over different LUNS the config files need to be adapted because there is a hard reference to the VMFS device signature

\- If the VMs had snapshots there might be a problem moving the entire directory because there are hard references to the original VMFS device too

\- The datastores must have the same version

We did this procedure quiet a lot in the past when we moved from a small LUN to a bigger LUN. We just unregistered all VMs , copied the data to the new LUN and re-registered the VMs without any issues.

Regards

Michael

Reply
0 Kudos
Cloneranger
Hot Shot
Hot Shot

Can you not attach both sans to the hosts?

Then just cold clone, from one to the other.

Unless I am missing something it seems the simplest way to me, its what we did for our DR.

Reply
0 Kudos
Ryan_Witschger
Enthusiast
Enthusiast

One is in Boston, the other in Albuquerque.

The other post above seems to be the right thinking path, but am a little unsure what he means. I used vi to change the vmfs path whereever I could find it, is there more? The VM will still not register.

-Ryan

Reply
0 Kudos
mrcreosote
Contributor
Contributor

Use the following cmd on the esx host to register the vm:

vmware-cmd -s register /vmfs/volumes/yourdatastore/yourserver/yourserver.vmx

Reply
0 Kudos
Texiwill
Leadership
Leadership

Hello,

There is quite a bit more. Did you rename the VM when you made the copy, if so the metadata files .vmdk, .vmx, .vmxf are all incorrect.

There is a copy script floating around the forums that fixes all this up for you.

Best regards,

Edward

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
Reply
0 Kudos