Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Featurerequest, add parameter for Export-VM #34

Open
bacardischmal opened this issue Mar 16, 2024 · 4 comments
Open

New Featurerequest, add parameter for Export-VM #34

bacardischmal opened this issue Mar 16, 2024 · 4 comments
Assignees

Comments

@bacardischmal
Copy link

Hi,
i had trouble to export some VMs, they had lags/freezes at the beginning from the exports, it took about 30 to 90 sec for the VM to be unavailable. I found out its because of the type of export of the VM

I added quick and dirty on this line the parameter CaptureLiveState and it worked like a charm.
Line 1400 $Vm | Export-VM -Path "$WorkDir" -ErrorAction 'Stop'
to
$Vm | Export-VM -Path "$WorkDir" -ErrorAction 'Stop' -CaptureLiveState CaptureDataConsistentState

Would it make sense to integrate the export selection into the script call or is it not a good idea to change the kind of export?

@Digressive
Copy link
Owner

@bacardischmal Hi there, thanks for mentioning this - I'll do some tests on my end.
What are the VMs doing that were lagging/freezing? It might help.
Thanks again

@Digressive Digressive self-assigned this Mar 16, 2024
@Digressive Digressive added the bug Something isn't working label Mar 16, 2024
@Digressive
Copy link
Owner

@bacardischmal I just tested this with the new additions and my tests all failed so I'm reluctant to make this change until I understand exactly what is going on.

Since it's working well for you, that's great! Any more information you can provide about the VMs and their workload would be helpful.

@Digressive Digressive removed the bug Something isn't working label Mar 18, 2024
@bacardischmal
Copy link
Author

bacardischmal commented Mar 19, 2024

What did at your test fail?

The freeze is at the moment the export starts, you can recognize it from the Hyper V-Manager, Open the VM and open the system clock in taskbar to see the seconds and watch it, it stops running for several seconds. Same problem happend when you export a VM from the Hyper V-Manager.
I think its something because of the IO Performance, I did a export from a SSD to HDD the lag is about 90sec, did the same export from a ssd to a ssd 15 sec of lag. I can reproduce it on different systems, some of the VMs are Terminalserver and when there is a client connected the RDP session fezzes at this moment and you can do nothing, you get no disconnect/reconnect/blackscreen ect. at the time, only no response of the RDP. I tested it on a w2k16 and w2k19 standard server.

Perhaps there should be a possibility to pass the three parameters to the export method and not a fixed in the script?
https://learn.microsoft.com/en-us/powershell/module/hyper-v/export-vm?view=windowsserver2022-ps

@Digressive
Copy link
Owner

@bacardischmal My testing fails at the Export-VM stage with the error: Export-Vm : [VM Name] failed to export. Failed to export virtual machine. Can not create an application consistent checkpoint.

This is with a Windows Server 2022 VM. Creating Checkpoints works via the Hyper-V mmc.

I did test with "-CaptureLiveState CaptureCrashConsistentState" and "-CaptureLiveState CaptureDataConsistentState" and they both worked.

I'm going to add an option to the script so that the user and specify the -CaptureLiveState {CaptureCrashConsistentState | CaptureSavedState | CaptureDataConsistentState} option, as you suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants