From 8908a72fa935ef0c3ba23584ce398dcc7b804d78 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Wed, 24 Oct 2018 12:20:52 +0200 Subject: [PATCH] builder/hyperv/vmcx: allow to set generation from buildfile this commit fixes #6908 --- builder/hyperv/vmcx/builder.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/builder/hyperv/vmcx/builder.go b/builder/hyperv/vmcx/builder.go index 024c4c7cb..1178061d3 100644 --- a/builder/hyperv/vmcx/builder.go +++ b/builder/hyperv/vmcx/builder.go @@ -85,7 +85,7 @@ type Config struct { MacAddress string `mapstructure:"mac_address"` VlanId string `mapstructure:"vlan_id"` Cpu uint `mapstructure:"cpu"` - Generation uint + Generation uint `mapstructure:"generation"` EnableMacSpoofing bool `mapstructure:"enable_mac_spoofing"` EnableDynamicMemory bool `mapstructure:"enable_dynamic_memory"` EnableSecureBoot bool `mapstructure:"enable_secure_boot"` @@ -155,8 +155,6 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { b.config.Cpu = 1 } - b.config.Generation = 1 - if b.config.CloneFromVMName == "" { if b.config.CloneFromVMCXPath == "" { errs = packer.MultiErrorAppend(errs, fmt.Errorf("The clone_from_vm_name must be specified if "+