diff --git a/builder/proxmox/config.go b/builder/proxmox/config.go index 9b478672c..3f516beb7 100644 --- a/builder/proxmox/config.go +++ b/builder/proxmox/config.go @@ -37,15 +37,16 @@ type Config struct { VMName string `mapstructure:"vm_name"` VMID int `mapstructure:"vm_id"` - Memory int `mapstructure:"memory"` - Cores int `mapstructure:"cores"` - Sockets int `mapstructure:"sockets"` - CPUType string `mapstructure:"cpu_type"` - OS string `mapstructure:"os"` - NICs []nicConfig `mapstructure:"network_adapters"` - Disks []diskConfig `mapstructure:"disks"` - ISOFile string `mapstructure:"iso_file"` - Agent bool `mapstructure:"qemu_agent"` + Memory int `mapstructure:"memory"` + Cores int `mapstructure:"cores"` + CPUType string `mapstructure:"cpu_type"` + Sockets int `mapstructure:"sockets"` + OS string `mapstructure:"os"` + NICs []nicConfig `mapstructure:"network_adapters"` + Disks []diskConfig `mapstructure:"disks"` + ISOFile string `mapstructure:"iso_file"` + Agent bool `mapstructure:"qemu_agent"` + SCSIController string `mapstructure:"scsi_controller"` TemplateName string `mapstructure:"template_name"` TemplateDescription string `mapstructure:"template_description"` @@ -164,6 +165,10 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) { errs = packer.MultiErrorAppend(errs, errors.New(fmt.Sprintf("disk format must be specified for pool type %q", c.Disks[idx].StoragePoolType))) } } + if c.SCSIController == "" { + log.Printf("SCSI controller not set, using default 'lsi'") + c.SCSIController = "lsi" + } errs = packer.MultiErrorAppend(errs, c.Comm.Prepare(&c.ctx)...) errs = packer.MultiErrorAppend(errs, c.BootConfig.Prepare(&c.ctx)...) diff --git a/builder/proxmox/config_test.go b/builder/proxmox/config_test.go index 65d9df9d9..84dd13c6d 100644 --- a/builder/proxmox/config_test.go +++ b/builder/proxmox/config_test.go @@ -95,6 +95,7 @@ func TestBasicExampleFromDocsIsValid(t *testing.T) { // NIC 0 model not set, using default 'e1000' // Disk 0 cache mode not set, using default 'none' // Agent not set, default is true + // SCSI controller not set, using default 'lsi' if b.config.Memory != 512 { t.Errorf("Expected Memory to be 512, got %d", b.config.Memory) @@ -120,6 +121,9 @@ func TestBasicExampleFromDocsIsValid(t *testing.T) { if b.config.Agent != true { t.Errorf("Expected Agent to be true, got %t", b.config.Agent) } + if b.config.SCSIController != "lsi" { + t.Errorf("Expected SCSI controller to be 'lsi', got %s", b.config.SCSIController) + } } func TestAgentSetToFalse(t *testing.T) { diff --git a/builder/proxmox/step_start_vm.go b/builder/proxmox/step_start_vm.go index ee67ca7df..8020cf9db 100644 --- a/builder/proxmox/step_start_vm.go +++ b/builder/proxmox/step_start_vm.go @@ -40,6 +40,7 @@ func (s *stepStartVM) Run(ctx context.Context, state multistep.StateBag) multist QemuIso: c.ISOFile, QemuNetworks: generateProxmoxNetworkAdapters(c.NICs), QemuDisks: generateProxmoxDisks(c.Disks), + Scsihw: c.SCSIController, } if c.VMID == 0 { diff --git a/website/source/docs/builders/proxmox.html.md b/website/source/docs/builders/proxmox.html.md index 68e5aa5a7..1704fcabb 100644 --- a/website/source/docs/builders/proxmox.html.md +++ b/website/source/docs/builders/proxmox.html.md @@ -156,6 +156,10 @@ builder. then `qemu-guest-agent` must be installed on the guest. When disabled, then `ssh_host` should be used. Defaults to `true`. +- `scsi_controller` (string) - The SCSI controller model to emulate. Can be `lsi`, + `lsi53c810`, `virtio-scsi-pci`, `virtio-scsi-single`, `megasas`, or `pvscsi`. + Defaults to `lsi`. + ## Example: Fedora with kickstart Here is a basic example creating a Fedora 29 server image with a Kickstart diff --git a/website/source/intro/getting-started/build-image.html.md b/website/source/intro/getting-started/build-image.html.md index 6ddd59914..cf4233b7c 100644 --- a/website/source/intro/getting-started/build-image.html.md +++ b/website/source/intro/getting-started/build-image.html.md @@ -235,7 +235,7 @@ Now save the following text in a file named `firstrun.json`: "access_key": "{{user `aws_access_key`}}", "ami_name": "packer-linux-aws-demo-{{timestamp}}", "instance_type": "t2.micro", - "region": "us-east-1", + "region": "{{user `region`}}", "secret_key": "{{user `aws_secret_key`}}", "source_ami_filter": { "filters": {