merge avhd and vhd files offline
-
Thursday, May 17, 2012 8:15 AM
I have one hyper V server running 4 vms
One of them is an exchange server .
I don't know when or how but we now has avhd and vhd for exchangeserver , exchangedata and also exchangelog
exchangeserver vhd and avhd is on drive c: (operating system disk) .
exchangedata and exchangelog vhd and avhd are on drive f: (data disk) .
Now drive c: is running short of disk space .
I tried manual merge of exchangeserve avhd and vhd on drive : and failed (insufficient disk space).
I want to down the exchange server , copy both files to drive f: and manual merge them there .
How can I do this with high confidence please ???
I need safe method to try and if it does not work , put back to drive c: and run .
I need to get this done , so I don't run short on diskspace on c:
After this , then I can attempt to merge the exchangedata and exchangelog vhds .
I read that we need to delete snapshot and then shutdown and it will merge by itself .
I have shutdown a few times but nothing happened , probably due to drive C: insufficient disk space .
I did not delete the snapshots via hyper v console (didn't know if it was safe) before shutdown .
Currently I have only 9 GB free diskspace on c:
Exchangeserver.vhd is 30GB and exchangeserver.avhd is 50GB.
Any help will be appreciated .
I need help .
Thanks
David
All Replies
-
Thursday, May 17, 2012 8:42 AMModerator
Hi,
Before you perform the merge, please backup this virtual machine, you can also export it to another disk with enough disk space.
By the way, you can use the following guide to merge the snapshot manually.
Manually Merge avhd to vhd in Hyper-V
http://social.technet.microsoft.com/wiki/contents/articles/6257.aspx
-
Thursday, May 17, 2012 10:52 AM
Hi ,
Thanks for helping .
However , my first problem is no space on drive c:
I will not be able to merge them at same location , so I need to copy the avhd and vhd to new location and merge them there .
Do I have to change anything in this case .
What is the recommendation in this scenario
Also I have the usual windows server backup (full) , will that do ?. Help...
Thanks
David Ng
-
Thursday, May 17, 2012 10:54 AM
Sorry , I also have read about deleting snapshot , where is this done ?.
Do I do this after my manual merge at another location ?.
Thanks
David Ng
-
Friday, May 18, 2012 4:22 AM
Hi ,
Do you mean copy data to another location or do you mean export /import vm ?.
Also If I do copy exchangeserver vhd and avhd to another location and merge it there
Do I also have to do the exchangedata and exchangelog vhd and avhd as well ??.
Do I have to delete snapshots , how and when please ..?
Please help ..
Thanks
David
-
Friday, May 18, 2012 5:20 AMModerator
Hi,
The following post discussed a similar issue, you can refer to check whether you can resolve issue.
-
Friday, May 18, 2012 6:43 AM
Hi ,
I don't have ghost .
I don't have additional hard disk.
I don't have space on C:
I have space on f:
Please help me ..... .
Also ,
Do you mean copy data to another location or do you mean export /import vm ?.
Also If I do copy exchangeserver vhd and avhd to another location and merge it there
Do I also have to do the exchangedata and exchangelog vhd and avhd as well ??.
Do I have to delete snapshots , how and when please ..?
Current disk space status is :-
Exchangeserver vhd 30GB , avhd 50GB on drive C: (no more space only 9GB left)
Exchangedate vhd 68GB , avhd 58GB on drive f: (1TB space left)
Exchangelog chd 85GB , avhd 16GB on drive f: (1 TB space left)
If I do the export vm way , how long to export please ... ?
How long to import again please ... ?
Please help ..
Thanks
David
- Edited by pandan22 Friday, May 18, 2012 6:56 AM
-
Friday, May 18, 2012 7:36 AMModerator
Hi,
You can copy the VHD files and AVHD files to F: drive and then them manually.
Manually Merge avhd to vhd in Hyper-V
http://social.technet.microsoft.com/wiki/contents/articles/6257.aspx
You can also export the virutal machine to F: drive to let it merge the snapshots automaticlly with the followig steps:
1. Export the virutal machine to F: drive, rename this virtual machine to be identified easisy. For exampe, VM_original.
2. Import it in Hyper-V Manager with the box “Copy the virtual machine(create a new unique ID)” checked in “Import Virtual Machine” wizard
3. Start the virtual machine and then power it off to see whether it start the merge automaticlly.
-
Friday, May 18, 2012 8:20 AM
Hi ,
Okay , so I will try to merge exchangeserver.vhd and avhd files together in another location .
Now Do I also have to do the exchangedata and exchangelog vhd and avhd as well ??.
Do I have to delete snapshots , how and when please ..?
Current disk space status is :-
Exchangeserver vhd 30GB , avhd 50GB on drive C: (no more space only 9GB left)
Exchangedate vhd 68GB , avhd 58GB on drive f: (1TB space left)
Exchangelog chd 85GB , avhd 16GB on drive f: (1 TB space left)
If I do the export vm way , how long to export please ... ?
I am afraid the export vm / import vm method will take much longer .
How long to import again please ... ?
I need to do all this quickly , to reduce downtime .
Please help ..
Thanks
David
-
Sunday, May 20, 2012 11:42 AM
Hi Vincent ,
I have tried to merge the exchangeserver.vhd and avhd by copying to another location and merging it there . I did it .
However , when I tried to change the hyper-v settings to point to this new merged vhd , it prompted me with message warning of possible data loss , has the server been activated since last snapshot , do I wish to make another snapshot etc.,
In view of this message , I stopped .
Also I have not done the exchangedata.vhd and avhd , exchangelog.vhd and avhd too , should I do this as well ?. Do I need to do this ?.
Please help . I am not confident to continue .
Thanks
David Ng
-
Sunday, May 20, 2012 2:26 PMModerator
Hi,
If you change the VHD file on a virtual machine with snapshots, it will ask you to perform a snapshot. If you have the backup of the VHD and AVHD file, you can ignore the warning.
By the way, you can create a new virtual machine and then attach the merged VHD file to see whether you get any issues.
- Edited by Vincent HuModerator Monday, May 21, 2012 2:56 AM typo
-
Monday, May 21, 2012 1:11 AM
Hi ,
Okay , now I understand the warning and what to do .
question : What about my exchangedata.vhd and avhd , exchangelog.vhd and avhd too , should I do this as well ?. Do I need to do this ?.
My drive C: is only has 8GB left . I am getting frantic .
question : If I copy my exchangeserver.vhd and avhd to dirve F: , then change vm setting to point to dirve f: , the exchangedata vhd and avhd , exchangelog vhd and avhd remaining same , will it allow me to run ?.
If it does , then at least , my problem is over for now , and I can schedule time to delete snapshot and allow the server to merge the files .
Please advise.
Thanks
David
-
Monday, May 21, 2012 2:56 AMModerator
Hi,
You can use the same way to merge the exchangedata.vhd and exchangelog.vhd. Move the VHD file to another location and adjust the path in virtual machine's settings will not affect the running of the virtual machine.
-
Monday, May 21, 2012 4:04 AM
Hi ,
I really don't know how long it will take to do all the merges .
copying exchangeserver vhd and avhd to another location took 20 minutes each time .
exchangeserver vhd 30GB and avhd 51GB - took about 1 hour (I think) last Saturday to merge
exchangedata vhd 68GB and avhd 58GB - haven't tried , don't know how long to merge
exchangelog vhd 85GB and avhd 16GB - haven't tried , don't know how long to merge .
question : I think it will take 3 hours for all these merges , what do you think ??
question : must I merge all exchangeserver , exchangedata , exchangelog vhd and avhd before setting change and run ??.
question : If I move without merge , the exchangeserver.avhd and vhd to drive f: , change vm setting , will it run ?? . This will take the least time .
Then I can schedule another time to merge all the avhd and vhd files by :-
1) using hyper v console to delete the snapshots.
2) shutdown the exchange server , to allow it to self-merge
question : will this work ?
I think the last time it didn't work because drive c: no space .
Thanks
David
-
Monday, May 21, 2012 2:38 PMModerator
Hi,
Quest 1:
The time of the merge is really depends on the size of the VHD and AVHD file, also the performance of the computer.Quest 2:
It depends. If the Exchange Server need the database and log files, then it’s better to merge them before you run the Exchange Server.Question 3:
It should run. However, it is not recommended to run snapshots in a production environment. -
Monday, May 21, 2012 8:40 PM
Hi David,
there is a other way to get rid f the snapshots but it takes time:
- you need a lokal drive with enough space for all your VHDs. It is posible to use an USB drive.
- you shutdown the system
- you create a new snapshot
- you export this new created snapshot (this will take a long time) and after the export you will only have the merged VHDs
- you remove the lokal exchange server
- you copy the export to the place where the merged server should be placed
- you import the vm from there
But as Vincent mentioned don`t do anything without a proper backup!!!
Grüße/Regards Carsten Rachfahl | MVP Virtual Machine | MCT | MCITP | MCSA | CCA | Husband and Papa | www.hyper-v-server.de | First German Gold Virtualisation Kompetenz Partner ---- If my answer is helpful please mark it as answer or press the green arrow.
-
Tuesday, May 22, 2012 12:47 AM
Hi Carsten,
My drive c: is very low on disk space - also the reason why I need to work this out quickest manner .
As such the snapshot will not work (no space) .
Export - have not tried - How long will this take ??
Thanks
David
-
Tuesday, May 22, 2012 1:08 AM
Hi ,
I am very short on drive c: diskspace . I need to get this done quickest manner .
As such I am thinking of copying the exchangeserver.vhd and avhd to drive f: . change hyper v settings to point to new location exchangeserver.avhd and run as normal .
I know this is not best way , but shortest time required (if it works).
Also , this exchange server has been running with the avhd for sometime (until I noticed it was taking much space).
After this is done , and I have time to breathe , I will schedule time to do delete snapshot , shutdown and let it automerge.
If that works , okay , else , manual merge all the files , change settings and run .
Based on this plan , what do you think , is it workable ??
Incidentally , my drive c: is now with 8GB free only.
Thanks
David
-
Tuesday, May 22, 2012 5:04 AM
Hi David,
first you need nearly no space on drive C: when you take a snapshot of a not running VM (the avhd files only grows when the VM writes data in it and as the system is shutdown this wil not happen). And the trick is that this snapshot is you NOW state. I have writen a blog post about these problem that I had some time ago at a customer. You find the Translation here: http://translate.google.de/translate?hl=de&sl=de&tl=en&u=http%3A%2F%2Fwww.hyper-v-server.de%2Fhypervisor%2Fsnapshot-zusammenfhrung-steckt-in-einer-endlosschleife%2F .
To the question how long will it take. I can't tell. I can only estimate that it would take 2 to 3 hours.
Grüße/Regards Carsten Rachfahl | MVP Virtual Machine | MCT | MCITP | MCSA | CCA | Husband and Papa | www.hyper-v-server.de | First German Gold Virtualisation Kompetenz Partner ---- If my answer is helpful please mark it as answer or press the green arrow.
-
Wednesday, May 23, 2012 9:44 AM
Hi Carsten ,
If the vm is down and I take a snapshot , where is the snapshot created ?. If it is on drive C:, then again I have no space .
I cannot get to your blog , please give me the url .
I thought export does not merge the avhd , it copies everything to another location , ready for import .
If export takes 3 hours , then copy another time 2 hours , then import takes how long ??.
I really cannot afford moves that take very long time .
At the moment I am thinking of doing the following :-
1) As such I am thinking of copying the exchangeserver.vhd and avhd to drive f: . change hyper v settings to point to new location exchangeserver.avhd and run as normal .
I know this is not best way , but shortest time required (if it works).
Also , this exchange server has been running with the avhd for sometime (until I noticed it was taking much space).
2) After this is done , and I have time to breathe , I will schedule time to do delete snapshot , shutdown and let it automerge.
2a) If that works , okay , else , manual merge all the files , change settings and run .
Based on this plan , what do you think , is it workable ??
Incidentally , my drive c: is now with 8GB free only.
Thanks
David Ng
- Edited by pandan22 Wednesday, May 23, 2012 9:45 AM type errors
-
Wednesday, May 23, 2012 4:45 PM
Hi David,
- here is the link to the original post in german: http://www.hyper-v-server.de/hypervisor/snapshot-zusammenfhrung-steckt-in-einer-endlosschleife/
- If you take a snapshot of a VM that is off only the new .AVHD file (size maybe 1MB) is created and you can export the last snapshot to an drive. If you have enough space on f: is is a posible place to export to and then import from there.
- I am nearly shure that you can't copy the vhd and avhd from c: to f: and then confige the .avhd file as disk in the VM. The snapshot relation to the VHD is in my opinion broken.
Grüße/Regards Carsten Rachfahl | MVP Virtual Machine | MCT | MCITP | MCSA | CCA | Husband and Papa | www.hyper-v-server.de | First German Gold Virtualisation Kompetenz Partner ---- If my answer is helpful please mark it as answer or press the green arrow.
-
Thursday, May 24, 2012 3:29 AM
Hi Carsten ,
Read your blog (translated by google) , interesting .
Don't really understand how the data is merged , but know the vhd gets bigger and when merged , the avhd is gone .
- Create a new snapshot (assigned few kB)
- Export these snapshots to an external drive
- Delete the VM and your files
- Copy of the export on the VM disk
- Import of VM
I think you mean export the VM using the import/export vm function , to external disk .
Question :- when exported to external disk , is the merge all done already ?. Or is it merged only during the import ?.
This will take a long time (too much time).
I cannot down the system for such a long time .
My plan :-
- Shutdown the vm
- Copy exchangeserver.vhd and avhd to another location . manual merge there (2 hours, I think)
- Copy the exchangedata.chd and avhd to another location . manual merge there (2 hours, I think)
- Copy the exchangelog.vhd and avhd to another location . manual merge there (1 hour, I think)
- Change vm settings to point to new locations (10 minutes) .
- Start the VM
Will this work? . Anything to add ?. We will have spare copies of vhd and avhd (before merge) .
Thanks
David
-
Thursday, May 24, 2012 3:38 AM
Hi Vincent ,
Please read my input and reply.
Also , all the stuff at the bottom is all crooked and out of place.
Thanks
David
-
Thursday, May 24, 2012 12:13 PM
Hi David,
>Question :- when exported to external disk , is the merge all done already ?. Or is it merged only during the import ?.
>This will take a long time (too much time)The export only has the merged VHDs. So no space needed on your disks. I personal think it is the fasted or at least as fast as a merge when you delete the snapshot.
Here is a other advantage: you can estimate how long it will take. You start and take the time for maybe 5 percent of the export. Then you calculate how long it takes until the export is at 60 percent (the export is nearly finished at 60% :-) ).
I would not do a manual merge.
Grüße/Regards Carsten Rachfahl | MVP Virtual Machine | MCT | MCITP | MCSA | CCA | Husband and Papa | www.hyper-v-server.de | First German Gold Virtualisation Kompetenz Partner ---- If my answer is helpful please mark it as answer or press the green arrow.
- Edited by Carsten RachfahlMVP Thursday, May 24, 2012 12:14 PM
-
Friday, May 25, 2012 1:07 AM
Hi ,
I have not done import / export vm.
Neither have I done delete snapshot . I really hate this snapshot thing .
Shouldn't be turned on by default . That way nobody will have snapshot issue .
Every snapshot activation should have warning message and double confirmation so user knows and must intentionally run snapshot and be ready for cleanups etc.,
I have done create vm , install vm from CD , install applications , administration .
Your steps :-
- Create a new snapshot (assigned few kB)
- Export these snapshots to an external drive
- Delete the VM and your files
- Copy of the export on the VM disk
- Import of VM
Kindly detail all the steps e.g. where to make / delete snapshot .
1) After new snapshot , I export the vm to drive f: ??
2) During export , I check the 5% time , if it takes too long , can I abort ?.
3) After abort (if it is possible) , can I export the vm again ?
On import vm , on import settings , do I choose :-
a)move or restore vm (use existing unique ID)
b) Copy the vm (create ad new unique ID)
c) Duplicate all files so the same vm can be imported again .
n.b. I will make copies of all the original vhd , avhd before starting .
Please help. I need to have all the answers before starting .
I am planning to do all this without hiccups on 26th May 2012 1200hrs onwards (estimate 6 hours).
We are in Singapore GMT +8
I will be working alone , and will have no other support avenues .
Thanks
David
- Edited by pandan22 Friday, May 25, 2012 1:10 AM missing sentences
-
Saturday, May 26, 2012 12:03 AM
Hi David,
I read the steps and the are good for me. Here are some answers to your questions:
> Kindly detail all the steps e.g. where to make / delete snapshot .
- You shutdown the VM and than take a snapshot. This will create a nearly empty new .avhd file. If you didn't start the VM this file will not grow (only a running VM writes it changes to the .avhd file)
- Then you select the new snapshot in Hyper-V Manager and you have the posibility to export the snapshot of the VM to an lokal drive (this could be your F: drive if there is enough space for the export otherwise chouse an external USB drive). When you export na VM normaly everything (including the VHD, the AVHD and the config) is stored in a folder. The diference is when you export a snapshot you only want to export this shapshot and doen't care about the others. So Hyper-V will only generate VHD files that reflects the time of your snapshot. I understand that the F: drive is a local drive. So if you can export to the F: drive you can directly import the VM from there.
>2) During export , I check the 5% time , if it takes too long , can I abort ?.
Yes you can abort. Remeber the export is nearly finished at 60% so don't calculate the time for 60%.
> 3) After abort (if it is possible) , can I export the vm again ?
Yes you can export the VM again
> On import vm , on import settings , do I choose :-
> a)move or restore vm (use existing unique ID)
> b) Copy the vm (create ad new unique ID)
> c) Duplicate all files so the same vm can be imported again .
Forget about c). Option a) is if you delete the VM and then imported the VM again. With option b) a new GUID is created and you can have the same VM twice. I nearly always use option b)
So here is a sugestion:
If you have enough space on drive F: (and this is a local disk) why not export the VM to F: and import it from there without deleting the old one (so you feel more confident). Remeber if there VM is there and not deleted you must chouse the Option B) for generating a new GUID file. Then you can test the new one and if everything is o.k. you can delete the old VM.
Grüße/Regards Carsten Rachfahl | MVP Virtual Machine | MCT | MCITP | MCSA | CCA | Husband and Papa | www.hyper-v-server.de | First German Gold Virtualisation Kompetenz Partner ---- If my answer is helpful please mark it as answer or press the green arrow.
- Edited by Carsten RachfahlMVP Saturday, May 26, 2012 12:04 AM
- Marked As Answer by pandan22 Saturday, May 26, 2012 10:30 AM
- Edited by Carsten RachfahlMVP Saturday, May 26, 2012 11:16 AM Correct some typos
-
Saturday, May 26, 2012 5:52 AM
Hi ,
Hope you can see this .
If I shutdown the vm , do a snapshot , then export the snapshot to drive f: , will it be a new complete vhd ??.
Is there any loss of data (email etc.,) ??
Thanks
David
-
Saturday, May 26, 2012 8:32 AM
If I shutdown the vm , do a snapshot , then export the snapshot to drive f: , will it be a new complete vhd ??.
Is there any loss of data (email etc.,) ??
Hi David,
YES the export of a snapshot is is a full VM with complete VHDs and it is runnable. It could even importet on an other Hyper-V Host.
NO there is no loos of data.
Grüße/Regards Carsten Rachfahl | MVP Virtual Machine | MCT | MCITP | MCSA | CCA | Husband and Papa | www.hyper-v-server.de | First German Gold Virtualisation Kompetenz Partner ---- If my answer is helpful please mark it as answer or press the green arrow.
- Edited by Carsten RachfahlMVP Saturday, May 26, 2012 8:34 AM
-
Saturday, May 26, 2012 10:00 AM
Hi ,
I did the shutdown
I did the snapshot after shutdown .
I then did export last snapshot to another location drive f: . At 5% it took 10 minutes , however after 95 minutes it finished , no notice , took me by surprise.
I checked , looked like it was completed .
I used hyper-V manager , imported from f: , using option b) create a new unique id . It was done in a snap. Again I checked to see if the new vm settings were correct . It was .
I ran the new exchange vm
I did copies of before export / after export etc., took quite some time.
Seemed sluggish , this new exchange server . All the mmc snap-ins were showing blank . Had to wait for the details to appear (frightening thoughts) .
Seems to be running now . Need to do simple verification of my mailbox (3 years of mail) .Need to try send / receive email .
I hope I can come back to report success . Wish me luck .
Thanks
David
-
Saturday, May 26, 2012 10:29 AM
Hi ,
Just tested send email / receive email , send to BB , receive from BB , all seems normal .
I would like to thank you for the help offered .
I have read many kb on this subject , but needed some extra confidence boosters .
Thanks
David Ng
n.b. I can now forget about this hyper-v snapshot problem , but not before documenting all this .

