|
|
|
|
@ -46,6 +46,7 @@ type Config struct {
|
|
|
|
|
GuestOSType string `mapstructure:"guest_os_type"`
|
|
|
|
|
HardDriveDiscard bool `mapstructure:"hard_drive_discard"`
|
|
|
|
|
HardDriveInterface string `mapstructure:"hard_drive_interface"`
|
|
|
|
|
SATAPortCount int `mapstructure:"sata_port_count"`
|
|
|
|
|
HardDriveNonrotational bool `mapstructure:"hard_drive_nonrotational"`
|
|
|
|
|
ISOInterface string `mapstructure:"iso_interface"`
|
|
|
|
|
KeepRegistered bool `mapstructure:"keep_registered"`
|
|
|
|
|
@ -128,6 +129,15 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
|
|
|
|
|
errs, errors.New("hard_drive_interface can only be ide, sata, or scsi"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if b.config.SATAPortCount == 0 {
|
|
|
|
|
b.config.SATAPortCount = 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if b.config.SATAPortCount > 30 {
|
|
|
|
|
errs = packer.MultiErrorAppend(
|
|
|
|
|
errs, errors.New("sata_port_count cannot be greater than 30"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if b.config.ISOInterface != "ide" && b.config.ISOInterface != "sata" {
|
|
|
|
|
errs = packer.MultiErrorAppend(
|
|
|
|
|
errs, errors.New("iso_interface can only be ide or sata"))
|
|
|
|
|
|