locked
forgot to export Hyper-V virtual machine of Server 2008r2, i just copied folder with vhd files (no snapshot) - how do i import if i did not export using hyper-v manager RRS feed

  • Question

  • Hi Everybody,

    I know this sounds bad, but we had an issue with with one of our hyper-v VM machine which kept eating up harddrive space.

    to make a long story short, the host machine went to 0 drive space and paused all the hyper-v machines, in a quick reaction, we deleted a couple hyper-v vm machines from the hyper-v list (using the hyper-v manager) and we quickly moved the 2 hyper-v VM machines off of the host server to another server.

    of course at the time we had thought that hyper-v would be like Vmware server where you can just copy the folder and open the .vmx file to mount the VM machine again.

    sad to say we learned the hard way and found out that you need to export your hyper-v vm machine in order to import it into another host machine.

    so i am hoping that someone out there will have an answer to our problem.

    basically we want to import our 2 hyper-v vm machines on the new host server. (which we did not use the export tool from the hyper-v manager)

    any help is greatly appreciated.  i could not find a single thing on this issue which i find hard to believe that no one else is in the same situation.

    thx


    MattLok
    Friday, April 1, 2011 9:20 PM

Answers

  • Given this post is a little old, I am guessing you figured this out already.

    But if you haven't, you just create a new virtual machine in HyperV and attach it to existing vhd files. If you only have the vhd files, you are missing the metadata that specifies the "physical" characteristics of the machine, like amount of ram and cpu. You will have to recreate these aspects. However, the vms will run fine off just the vhds.

    So go to New -> Virtual Machine, select the appropriate choices but when you get to "Connect Virtual Hard Disk" choose "use an existing virtual hard disk" and select your vhds.

    • Marked as answer by mattlok Tuesday, April 19, 2011 2:02 AM
    Monday, April 18, 2011 9:28 PM

All replies

  • Given this post is a little old, I am guessing you figured this out already.

    But if you haven't, you just create a new virtual machine in HyperV and attach it to existing vhd files. If you only have the vhd files, you are missing the metadata that specifies the "physical" characteristics of the machine, like amount of ram and cpu. You will have to recreate these aspects. However, the vms will run fine off just the vhds.

    So go to New -> Virtual Machine, select the appropriate choices but when you get to "Connect Virtual Hard Disk" choose "use an existing virtual hard disk" and select your vhds.

    • Marked as answer by mattlok Tuesday, April 19, 2011 2:02 AM
    Monday, April 18, 2011 9:28 PM
  • You are the man!!!

    Thank-you so much for this solution. 

    Other people tell me it can't be done.

    man are they totally wrong.

     

    haha

    Works 100%


    MattLok
    Tuesday, April 19, 2011 2:02 AM
  • What if you had snapshots in the equation?  Are you able to mount them aswell, or only the vhd files?
    Wednesday, April 20, 2011 2:14 PM
  • @ MattLok, glad I could help... and be the WOman. ;)

    @Mapleleafguy, I wish I could help but I am not familiar with snapshots through HyperV.  (We snapshot using our SAN.) This much I am pretty sure of, the vhds do not contain the snapshots. So if you only have the vhd files, you do not have the snapshot data. You would at least need the Snapshots directory. 

    Wednesday, April 20, 2011 4:17 PM
  • Hi

    I know that this is an old thread, but I just have a problem that's somehow similar to it.

    First of all, this is my first use of Hyper-V, so I'm a new to it.

    A colleague gave me some hyper-v....at that time I was not interested on it and never used it till a need for them arose.

    Trying to import the vms faild and after a while I read that it should be exported first, so I guess that those vms were not.

    What's on my hand now are the files, on the virtual hard disk folder I found 3 files.

    I tried to do as mikainsb advised and 2 files failed and one was accepted, BUT, after starting the vm, I discovered that it's almost a new installation without any of the required apps, even the windows installed is asking for activation.

    I have also found a windwos batch file with every vm, that's named "VM-Pre-Import-"VMNAME".bat

    can it be used to get them to work ?

    If not, do you guys have any idea how can I get them to work ?

    Thursday, February 23, 2012 6:49 PM
  • Amaksoud

    Many times after a VM migration you will run into an activation issue.  Windows detects a drastic change in hardware and asks to re-activate.  This is not uncommon.  The problem you will run into when you get naked .vhd's like this, is that you may not have the hardware details.  Take a look at the .bat files and see if that tells you, doubt it.  Another option is to look at the size of the .vhd and try to guess the hard drive size.  This can be tough if it is a dynamic disk.  If it is a static sized .vhd it might be easy considering most people use rounded sized disks, 50GB, 100GB, 200GB...etc.

    This is going to take some testing and experimenting.  That can actually be good as you will learn more about the Hyper-V structure and how .vhd's and thier xml files interact.  Once you create a VM, you can open the xml and modify it to help get the VM up and running.

    Steve Melcher

    CCNA, SSCP, MCTS


    Steve Melcher CCNA, SSCP, MCTS 311 W. Monroe, Suite 1300 Chicago, IL 60606 Tel-312.775.3466

    Thursday, May 17, 2012 7:39 PM
  • I guess everybody knows by now that you just mount the latest vhd in the differencing chain that you want. I would have to assume any vhd chain loaded and run could no longer accept the portion of the avhd that has a later date.  As an aside, you should really look into merging the avhd pieces to increase performance. They can be mounted as boot drives as well as additional storage drives. 
    Tuesday, May 7, 2013 12:37 AM