builder/hyperv/vmcx: allow to set generation from buildfile

this commit fixes #6908
This commit is contained in:
Adrien Delorme 2018-10-24 12:20:52 +02:00
parent 95d107a89c
commit 8908a72fa9
1 changed files with 1 additions and 3 deletions

View File

@ -85,7 +85,7 @@ type Config struct {
MacAddress string `mapstructure:"mac_address"` MacAddress string `mapstructure:"mac_address"`
VlanId string `mapstructure:"vlan_id"` VlanId string `mapstructure:"vlan_id"`
Cpu uint `mapstructure:"cpu"` Cpu uint `mapstructure:"cpu"`
Generation uint Generation uint `mapstructure:"generation"`
EnableMacSpoofing bool `mapstructure:"enable_mac_spoofing"` EnableMacSpoofing bool `mapstructure:"enable_mac_spoofing"`
EnableDynamicMemory bool `mapstructure:"enable_dynamic_memory"` EnableDynamicMemory bool `mapstructure:"enable_dynamic_memory"`
EnableSecureBoot bool `mapstructure:"enable_secure_boot"` EnableSecureBoot bool `mapstructure:"enable_secure_boot"`
@ -155,8 +155,6 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
b.config.Cpu = 1 b.config.Cpu = 1
} }
b.config.Generation = 1
if b.config.CloneFromVMName == "" { if b.config.CloneFromVMName == "" {
if b.config.CloneFromVMCXPath == "" { if b.config.CloneFromVMCXPath == "" {
errs = packer.MultiErrorAppend(errs, fmt.Errorf("The clone_from_vm_name must be specified if "+ errs = packer.MultiErrorAppend(errs, fmt.Errorf("The clone_from_vm_name must be specified if "+