How to Copy VMs Directly Between ESXi Hosts Without Shared Storage

There were some discussions earlier this week about copying Virtual Machines from one ESXi host to another ESXi host that reminded me of a very cool feature in the ovftool that could help with this task(which I thought I had written about already). As you probably have guessed by now, I am a big fan of the ovftool and have written several articles here, here and here. It still surprises me with the amount of features this little utility contains and this particular one is definitely a cool one!

If you have ever needed to copy a Virtual Machine from one host to another, it can be a challenge sometimes, especially if you do not have shared storage. You can of course leverage tools like VMware Converter or exporting the VM to a "middle man" system and then re-importing that VM into the destination host but it could take awhile or you have to run a Windows system. Well, if you are looking for a quick and easy way to copy a VM from one host to another, try using the ovftool.

In this example, I have two ESXi hosts called vESXi-03 and vESXi-04 and they both contain a single local datastore (no shared storage). I have a VM called vMA5 that is located on vESXi-03 and I would like to copy that directly to vESXi-04 without needing any additional storage.

Here is an example of using ovftool to probe the ESXi host to see the list of available VMs:

Note: A VM must be powered off for ovftool to transfered or exported.

Now that we have identified our VM, we just need to specify the source ESXi host and the destination ESXi host as well as the datastore using the -ds option. Here is an example of using ovftool to export the VM from one ESXi host to another ESXi host:

There are also other options that you can specify such as the network configuration and power options, please refer to the ovftool documentation for more details.

If you open up a vSphere Client connection to each of your ESXi hosts, you will see that the source host will have an export task and the destination host will have an import task as shown in the screenshot below:

Pretty nifty huh? 🙂

If anyone is interested in how this works, the system that is running ovftool acts as a proxy between your source and destination. The system running ovftool IS in the data path during the transfer but its only for the data to stream from source->client->destination. Nothing is stored on the client system and you do not need to have the storage capacity of what you are transferring. This is very nifty little feature that many people are not aware of with ovftool.

Yep, I recommended that in my blog as well for those wanting a bit easier of administration. http://wp.me/p14UMO-ba

So if you are importing/exporting VM’s using the OVF how does that stack up to using CP or the HTTP get/put from a performance standpoint? Obviously the OVF tool is made for virtual machine related functions so maybe the performance is better? Sounds like I will need to do some further testing…

For some reason,We have a vCenter 5.0 and would be replaced by several single ESXi 5.1 hosts. The VMs on vCenter 5.0 should be migrated and distributed to 6 ESXi hosts’ local data-storage. And the snapshot along with VM is required to be kept during migration. I searched the some solutions as below. It seems all existing solution has some limitation so that can not meet our requirement well.

P.S Because some reason, we are not allowed to add new ESXi 5.1 hosts to the existing vCenter 5.0 which would be retired.

1, Veeam B&R, by using Quick Migration Feature A,data moving performance is very bad B, Snapshot can not be kept C, Do not support THIN HDD well. For example, a VM with 200GB provisioned sized and with 13GB actual size, B&R seems moving 200GB data during quick migration and caused about 90 mins.

2, OVFtool, hard to implement because of we have more than 100 VM to be migrated. and it can not keep snapshot.

3, vCenter Converter Standalone, hard to implement because of we have more than 100 VM to be migrated. and it can not keep snapshot.

4, Download/Upload VMs’ data in DataStore Browser interface, though it can keep snapshot, it’s hard to implement for so much VMs

Well, that was super embarrassing. I told a network dude to use the “middle-man” approach as you described in the article. He went off and found ovftool and copied over 200GB in 10 minutes when my suggestion took many hours (he actually cancelled it before it completed to find a faster way). So off the google-izer I go to find out about ovftool copying VMs. Thanks for sharing.

GSCopy Pro v6.0 (RoboCopy Alternative) with Open File AgentGSCopyPro is a single command-line tool (CLI) that can copy, replicate and move files from one folder to another. This folder can be on the same machine/ server or another server elsewhere. What makes GSCopyPro stand out from other competitors is the fact it works on 32-bit as well as 64-bit systems and has no restrictions. It can easily be scheduled to run as a scheduled task and fully automated. GSCopyPro also comes with an open file agent which can copy files that are locked/ opened by other processes. This feature is supported in all windows vSCersions from widows XP/ 2003 and later.Go To:>> http://www.gurusquad.com/GOPYPRO

What I required was a space office that made me feel that my stuff might be secured. What I got was a clean and well-run office, that feeling that all is well with the world, additionally a cordial staff to make my comings and goings a charming background. self storage in Glen Waverley

Looking for a solution or a trick that I would be able to import license to the specific virtual machine then export it to OVF/OVA file, after that I want to deploy that OVF file on different ESX without losing the license of virtual machine.
By default when you get an OVF of a machine from an ESX and deploy it on another ESX you will lose your license that imported before.

I know this is a very old topic, but I figured out why the password doesn’t work. According to the ovftool debug logs (and some strace dumps I did), ovftool forms a URL that includes the userid and password – even if you entered the password at the prompt. The URL looks like this:

Kudos… This tip helped me resolved a vcsa 5.5 to 6 upgrade problem I was having. Found out that my DNS was only somewhat routable from my vcsa client making the system error out when trying to resolve names.

Good info, only problem I’ve run into is that it is KILLER slow! Is there any way to speed it up? something along the lines of the VM Converter encryption setting that slowed that down? I started a move of a 750g VM over night and after 10 hours it was at 5%. That seems really slow to me. That would take 9 days to transfer! Any suggestiosn are MUCH appreciated!

I think if you run the ovftool on your workstation it will pump traffic trough it, not directly between hosts. It is true, that it will not use any local storage, but the data will cross your PC. So if you try to move VMs between two ESXi hosts which are located in the same but remote to you network, you will act as a proxy and send all the data accross the WAN link. This can be really slow…

At least this is what I observed using windows based ovftool. In some other artikle I found a recommendation to setup a little Linux VM on one of the ESXi hosts and run ovftool there. This should greatly speed up the process.

I am finding that while in some cases (like when I was trying to transfer some CentOS VMs with ovftool) the network configuration was not being ported. The resulting IP configuration is effectively blank on the target VM. Do you know what could cause this?

Hi,
Thanks for the tip ! It worked great with a small VM, but now I would like to use it with a critical VM that can’t be turned off for long. The problem is that this time it concerns the copy of 2 datastores (ssd and sata). How can I put an option to say datastore1 (source) goes to datastore1 (target) and datastore2 (source) goes to datastore2 (target)? Is it even possible to do that with OVF tool?
Thanks

Good Day! we are currently in the process of consolidating our data centers. We are about to move all of our Esxi host from our Amsterdam data center to our Chicago data center. We are looking for ways and means to move it in a fast and efficient manner. is the ovftool will help? and what type of approach you can recommend?

It really depends on what you need/care about. ovftool allows you to export/import offline VMs. If you care about speed, you may consider just storing all the VMs on an external drive and shipping it to your final destination and then re-importing them in. There are other tools like VMware Converter that can do V2V migration or if you’re running vSphere 6.0, you could even leverage XvC-vMotion feature to migrate a VM (online or offline) between vCenter Servers, of course if VM networking isn’t stretched or running with an overlay, VM will still see downtime. It sounds like you’re after speed, so the first recommendation is what I would do and its something I’ve done as a customer 6yrs ago where we had acquired a company and need to quickly consolidate. We just had everything exported to external disk and re-imported once it hit our datacenter.

Thank you sir. I had to move a large VM to a dedicated standalone host and first tried it with Veeam, but that gave me some random error. This works perfectly. Time to clean up that Veeam installation and go to bed, while my VM moves overnight 🙂

If you don’t have a shared storage you can create it in temporary Linux VM and run storage migration twice with Extrasphere solution.
It will be very similar to ovf trick but need less downtime.
Or use Veeam – it’s free and easy to use )

I tried to copy a VM from ESXi 5.5.0 free to 6.5.0 evaluation mode.
This should be the right command:
Ovftool –ds=Datastore vi://[email protected]/WEV-MON-DC vi://[email protected]
But i get this warning back:
Error: Unexpected option: vi://[email protected]

Could they be on different subnets, connected directly from one physical nic to another? The create vmkern/vmotion designated vnics on each?
I have a lab I would like to push things to, while keeping it segregated.

However, the OVA file is well created. When I extract it (with tar), I have the 3 files but it seems that there are some errors:
– the mf file is wrong (the sha1 hash is not generated. The hash is replaced by “xxxxxxxxxxxx”)
– the ovf file seems weird: for example, I can see this line “ovf:size=9223372036854775807”. The size seem sto be overestimated.
– the vmdk seems to be good

When I try to export the OVA file with vSphere client 6.0, the problem is the same. I also tried to export as an OVF, but still the same errors.

I thought a lot about a way to migrate / copy my vms between esxi without storage.
This function of ovftools, this for me was very cool. I had thought of creating an NFS in Esxi, to do this task, looking for this article, I previously did the export / import process using a PC between ESXi, but it directly reduced my time in half.

When running I came across this error:
line 26 unsupported family 14
I saw some shapes around, but I stopped thinking and did like this:

1. unregistered in vm
1. download .vmx
2. I edited and changed to vm_version13
3. upload .vmx
4. I registered to vm (keeping it off)
5. and performed the process

[…] the data was pretty straight forward. I started migrating some VMs using scp and ovftool (using this blog post by William Lam). That was fine, but in the end I decided to just pull the drives from the old […]

Primary Sidebar

Search this website

Author

William Lam is a Staff Solutions Architect working in the VMware Cloud on AWS team within the Cloud Platform Business Unit (CPBU) at VMware. He focuses on Automation, Integration and Operation of the VMware Software Defined Datacenter (SDDC).