Search This Blog

Loading...

Sunday, June 12, 2011

Moving Virtual Machine Without Using Hyper-V Export/Import

 

Howdy ! Ever encounter a problem whereby your existing Hyper-V hardware has a problem and would like to move the VMs to another Hyper-V host. I’m not talking about Export/Import features on Hyper-V.

If you’re interested, keep reading on this article to see how i can achieve this scenario.

In normal hard way which everyone will do, you will probably

1. Export / Import – not a good options if hard disk size is limited and you need to present the VM to another Hyper-V Host in a quick way.

2. Copy and Paste VHD. Recreate VM configuration and assign back existing VHD. – not a good options as i need to key in the ip address on the VM and longer duration of copying/paste process.

3. Restore from DPM – good if total VM faulty but it will took very long process to restore. So far based on my experience is 1GB per minute. If you have 100GB fixed disk VM, will most likely took you 100 minute (just estimation).

4. Use Quick Storage Migration – not applicable as i need additional storage.

5. Use Live Migration – i’m not using Cluster Hyper V.

6. Use Migrate to move VM from 1 host to another – good but slow and i need HDD space/ present new LUN to new Host.

How about total failure but you have managed to copy the whole VM configuration, snapshot and VHD? We can’t use back the VM configuration as you did not export the VM.

Do i get your interest to read more….. (scroll down…)

Here is my real experience on how to achieve this scenario without using Export/Import.

1. Make sure the VM is stopped / Saved State.

2. Use Hyper-V Mover tool to detach the VM. This will remove hard link from Hyper V host. Example: LowVM Virtual Machine.

1

2

3. On Hyper-V manager snap-in, LowVM Virtual machine has detached and you no longer see it on the snap-in.

4. Reassign the LUN to another Hyper V Host.

Overview

5. Use Hyper-V Mover tool to attach the VM. The tool will detect new location by itself and add to new Hyper-V Host. Click on below picture to see the process of attaching.

3

6. Restart Hyper-V Virtual Machine Management services

4

7. On Hyper-V Manager snap-in, you will see the LowVM Virtual Machine has added to the new Hyper-V Host.

Quite easy and fast process (less than 1 minute).

Some thoughts on this tool :

  • A VM can only be detached if it is in the "Saved" or "Stopped" state.
  • It is not necessary to stop the Hyper-V service and all modifications are detected live by the service.
  • A VM can only be imported if it contains at least on HDD on the IDE 0 controller.
  • All the VM files must be under the same directory, HDD and snapshots.
  • All files that are modified are backed-up next to the original files; All other files are not modified nor moved.
  • .NET 3.5 must be installed.

It’s provided free by Microsoft CodePlex. To get it, please click here.

Note:- Use Hyper-V Mover on your own risk.

5 comments:

  1. Does not work for me. I have copied everything and when i do this i Hype V Manager name comes :
    4C1D6F99-C086-44DA-AC6F-41D163F72BC7 as supossed to be CL2. I sow:

    Importing [I:\6421\Drives\6421B-NYC-CL2] using [C:\ProgramData\Microsoft\Windows\Hyper-V] on [.]
    15.12.2011 13:06:09 : Guessed original path as [C:\Program Files\Microsoft Learning\6421\Drives\6421B-NYC-CL2]
    15.12.2011 13:06:09 : Updating paths in [I:\6421\Drives\6421B-NYC-CL2\Virtual Machines\4C1D6F99-C086-44DA-AC6F-41D163F72BC7.xml] ([C:\Program Files\Microsoft Learning\6421\Drives\6421B-NYC-CL2] to [I:\6421\Drives\6421B-NYC-CL2])...
    15.12.2011 13:06:09 : Updating paths in [I:\6421\Drives\6421B-NYC-CL2\Snapshots\CEBD0478-6743-4A61-B80A-1006B9FAF975.xml] ([C:\Program Files\Microsoft Learning\6421\Drives\6421B-NYC-CL2] to [I:\6421\Drives\6421B-NYC-CL2])...
    15.12.2011 13:06:09 : Creating new symlinks to snapshot files...
    15.12.2011 13:06:09 : Setting ACLs snapshot symlink files...
    15.12.2011 13:06:09 : Failed to set permissions to [C:\ProgramData\Microsoft\Windows\Hyper-V\Snapshots\CEBD0478-6743-4A61-B80A-1006B9FAF975.xml]
    15.12.2011 13:06:09 : Setting ACLs snapshot for all virtual machine files...

    Guessed original path is not correct all files are on I: drive!!
    Also i can delete this new crate VM any more. seems like error with permissions.

    ReplyDelete
  2. Sorry:

    Also i can NOT delete this new create VM any more. seems like error with permissions.

    ReplyDelete
  3. Hi anonymous,

    I'm so sorry to hear that. This tool is not 100% supported depend on hypervisor. That's why i put a remark: Note:- Use Hyper-V Mover on your own risk.

    Cheer

    ReplyDelete
  4. "I'm so sorry to hear that. This tool is not 100% supported depend on hypervisor. That's why i put a remark: Note:- Use Hyper-V Mover on your own risk."

    Great .. but you failed to tell us WHY there is a risk!!!
    Well done!

    ReplyDelete
  5. Thanks for sharing these comprehensive step-by-step guidelines with us. They are really helpful especially for those who wish to migrate their storage and servers over. The process is not as simple as it may sound but it is not impossible either. With careful instructions to follow and correct execution, I am sure the process will be a breeze.

    ReplyDelete