Vagrant: AutomaticCheckpointsEnabled is not supported by Windows Server 2016

Created on 30 Sep 2018  ยท  2Comments  ยท  Source: hashicorp/vagrant

Vagrant version

version 2.1.5

Host operating system

Windows Server 2016

Guest operating system

All guest operating machines

Vagrantfile

Any vagrant machine with hyperv provider.

Debug output

Script: configure_vm.ps1
Error:

Failed to disable automatic checkpoints on VM: A parameter cannot be found that matches parameter name 'AutomaticCheckpointsEnabled'.
---- End output of vagrant up --no-provision --provider hyperv ----
Ran vagrant up --no-provision --provider hyperv returned 1] on default-windows-2016

Expected behavior

What should have happened?
Should not throw exception

Actual behavior

What actually happened?
Threw an exception as it is assumed that we want to set AutomaticCheckpointsEnabled parameter which only exists on Windows. https://serverfault.com/questions/866347/how-can-i-disable-use-automatic-checkpoints-for-new-hyper-v-vms-on-windows-10

Steps to reproduce

  1. Use vagrant on Windows 2016 Server
  2. Spin up a machine with hyperv provider

References

none

bug has-pr hoswindows providehyperv

Most helpful comment

I think the fix is:

Change:

Hyper-V\Set-VM -VM $VM -AutomaticCheckpointsEnabled $autochecks

To:

    if ((Get-Command Hyper-V\Set-VM).Parameters["AutomaticCheckpointsEnabled"] -ne $null){
        Hyper-V\Set-VM -VM $VM -AutomaticCheckpointsEnabled $autochecks
    }

All 2 comments

I think the fix is:

Change:

Hyper-V\Set-VM -VM $VM -AutomaticCheckpointsEnabled $autochecks

To:

    if ((Get-Command Hyper-V\Set-VM).Parameters["AutomaticCheckpointsEnabled"] -ne $null){
        Hyper-V\Set-VM -VM $VM -AutomaticCheckpointsEnabled $autochecks
    }

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hesco picture hesco  ยท  3Comments

StefanScherer picture StefanScherer  ยท  3Comments

tomhking picture tomhking  ยท  3Comments

rrzaripov picture rrzaripov  ยท  3Comments

cbednarski picture cbednarski  ยท  3Comments