diff --git a/iso/builder_acc_test.go b/iso/builder_acc_test.go index d1c94c67c..14cc6a6cc 100644 --- a/iso/builder_acc_test.go +++ b/iso/builder_acc_test.go @@ -31,7 +31,9 @@ func defaultConfig() map[string]interface{} { "ssh_username": "root", "ssh_password": "jetbrains", - "vm_name": commonT.NewVMName(), + "vm_name": commonT.NewVMName(), + "disk_size": 2, + "communicator": "none", // do not start the VM without any bootable devices } diff --git a/iso/config.go b/iso/config.go index 6646d3235..2b29c67ba 100644 --- a/iso/config.go +++ b/iso/config.go @@ -6,6 +6,7 @@ import ( "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" "github.com/jetbrains-infra/packer-builder-vsphere/common" + "fmt" ) type Config struct { @@ -35,6 +36,9 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) { errs = packer.MultiErrorAppend(errs, c.RunConfig.Prepare()...) errs = packer.MultiErrorAppend(errs, c.ConnectConfig.Prepare()...) errs = packer.MultiErrorAppend(errs, c.HardwareConfig.Prepare()...) + if c.DiskSize <= 0 { + errs = packer.MultiErrorAppend(errs, fmt.Errorf("'disk_size' must be provided")) + } errs = packer.MultiErrorAppend(errs, c.ShutdownConfig.Prepare()...) errs = packer.MultiErrorAppend(errs, c.CreateConfig.Prepare()...)