kitchen-hyperv icon indicating copy to clipboard operation
kitchen-hyperv copied to clipboard

Disable Hyper-V automatic snapshots for virtual machines

Open ebjornset opened this issue 7 years ago • 4 comments

In later versions of Win10 Hyper-V enables automatic snapshots for new virutal machines. Since these are not needed to run test kitchen they should be turned off.

This is quite easy, with the Powewrsehll command:

Set-VM -Name MyVM -AutomaticCheckpointsEnabled $false

This should be run when the virutal machine is created, and before it's startet for the first time.

ebjornset avatar Jan 28 '18 07:01 ebjornset

This feature looks to be exclusive to the Creators Update (1709) and probably later when they get there. I can work on this later this week if you haven't got your dev environment working in the next few days.

kdoores avatar Jan 28 '18 18:01 kdoores

Great!

I've not got my environment running yet, but I think code along these lines
if ((Get-Command Set-Vm).Parameters["AutomaticCheckpointsEnabled"]) { Set-Vm -Name $vm.VMName -AutomaticCheckpointsEnabled $false } should go into support/hyperv.ps1 at line 119?

And then some proper tests of this in spec/support/hyperv.Tests.ps1 of cource:-)

ebjornset avatar Jan 29 '18 16:01 ebjornset

Today I got my development environment running, and I have an implementation that passes my unit tests. I'll verify it with an actual test-kitchen run, and create a PR afterwards.

ebjornset avatar Jan 30 '18 00:01 ebjornset

Looks like this solved in PR #64? Maybe this issue can be closed?

johlju avatar May 02 '19 17:05 johlju