Link to home
Start Free TrialLog in
Avatar of pandafusion
pandafusion

asked on

Hyper-V VM - exports all but one disk

Hello everyone,

I have a new and interesting problem. I have a Hyper-V Domain Controller, which I have spent a lot of time refining. I regularly (every few weeks or so) export this DC and then re-import it elsewhere. No problem. From Hyper-V Manager, I select the VM, select Export and voila! This worked flawlessly as recently as 09-23-2018.

However, it now has a problem. The VM contains (and has always contained) 3 vhdx virtual hard disks. Two are data disks and the third is the C:\ drive. Everything is exporting just fine except for the C:\ drive vhdx (named AT01-DC1020). The export function runs, but no errors and no AT01-DC1020.vhdx (Data.vhdx and Users.vhdx are there and are fine). I have checked past export files and all three hard disks show up just like they should in those past exports. I need this to work, because I need the new changes to Group Policy and so on to be part of future imports.

PS - the VM itself runs just fine (Connect and Start and yay!). I don't see any issues whatsoever when running the VM.

I have done all updates
I have updated the vm configuration
I have restarted several times
I have tried exporting to different disks, external and internal
I have sacrificed a small fuzzy creature (or at least a picture of one)_.
I have Googled a bit, but either my fu is broke or I am not getting any hits on why all but one of my vhdx files is exporting correctly.

Why won't my VM export the way I want it to anymore?

Updates and Edits/Additional Info:
1. I attempted to export using Powershell. No luck.
2. I can export other VMs without any problem.
3. My drive is encrypted, but I can export other VMs without any problem.
4. The vhdx that is not exporting is about 35GB in size. i have more than 200GB of room on my drive that the VM is located on.
5. There are no checkpoints or snapshots.
6. This is a Gen2 VM (Configuration 8.3) and all disks are dynamically expanding.
7. All Integration Services except Time Synchronization are selected.
8. We have tried Export while running and Export while shut down. No difference. VM opens and appears to run just fine.
9. I tried to copy and paste the entire folder, but got an error "cannot read from source file or disk" - that may be expected behavior.
10. I renamed the VM and tried the export operation again. It still failed.
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

any checkpoints / snapshots? If so merge them first.
Avatar of pandafusion
pandafusion

ASKER

Good thought! However, there are no checkpoints or snapshots. Also, a few more details:
This is a Gen 2 VM (Configuration 8.3) and the vhdx hard disks in question (all 3) are dynamically expanding. Total VM size is about 35GB. The local drive has around 200GB Free.
All integration services except Time Synchronization are selected. The DC uses 3 ntp pool peers, as does the Host OS which is Windows 10 Pro.
I found this and tried the following:
https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/deploy/export-and-import-virtual-machines

1. I started the VM, logged in, everything was good, exported it while it was running (I normally shut them down). No improvement.

2. I tried it in PowerShell, figuring that would actually be a really good option. This gave a very nice progress bar that counted in 1% and 2% until it hit 28% and then flashed all the way to complete. No errors. Same result as before.
Export-VM -Name AT01-DC1020 -Path C:\VM\AT01-DC1020Export

For grins I have done a variety of dumb things like changing the path name to something shorter, without spaces, etc. No dice.
Since it is a DC server, it will have a NTDS database installed. To safely export a server with a database, you need to use Shadow copy facilities to  ensure a clean export of the disk.  So, you need to make sure you have enough disk space for a proper export using shadow copy.

See https://www.altaro.com/hyper-v/copy-hyper-v-vhd-file-virtual-machine-running/
thank you Peter. As noted previously, the main disk we are referring to is about 35GB. there are 200+GB available on the current save location and I also tried to export to an external 4tb hard drive.

i appreciate the look and the link! let me know if I misunderstood what i needed to do in response to your post.
I tried to just copy and paste the whole thing, but got an error that it could not read from the source file or disk. Still operates just fine though. My Source drive is encrypted via BitLocker
Maybe you need to suspend bitlocker first and supply the key to allow you to export the disk. I think Bitlocker is preventing export of the disk as an anti-theft feature.
See https://www.itpromentor.com/bitlocker-hyperv-guest/
This is also a good theory, though my successful previous exports have never been an issue. Also, I can still successfully export other VMs.
Two more notes:
1. I can export another VM successfully, so the problem appears to just be with this particular VM/Configuration
2. I can not copy and paste the folder (don't know if I really ever tried this before). I get a "cannot read from source file ro disk" error.

Thank you!
I also found this post and renamed the VM before Export. No luck:
https://www.petri.com/fixing-hyper-v-export-errors
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.