From 0a4fe13182420a57991c25a77a2bd3d1113afff0 Mon Sep 17 00:00:00 2001 From: Virgil Date: Mon, 5 Aug 2019 11:00:26 +0200 Subject: [PATCH] Add SCSI controller support --- README.md | 1 + examples/cloudinit_example.tf | 1 + proxmox/resource_vm_qemu.go | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 83b56bb6..843bce92 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,7 @@ resource "proxmox_vm_qemu" "prepprovision-test" { cores = 3 sockets = 1 memory = 2560 + scsihw = "lsi" network { id = 0 model = "virtio" diff --git a/examples/cloudinit_example.tf b/examples/cloudinit_example.tf index 32f4e3b5..f7ee97ba 100644 --- a/examples/cloudinit_example.tf +++ b/examples/cloudinit_example.tf @@ -26,6 +26,7 @@ resource "proxmox_vm_qemu" "cloudinit-test" { cores = "2" sockets = "1" memory = "2048" + scsihw = "lsi" # Setup the disk. The id has to be unique disk { diff --git a/proxmox/resource_vm_qemu.go b/proxmox/resource_vm_qemu.go index 5fa93a27..b7e37da3 100644 --- a/proxmox/resource_vm_qemu.go +++ b/proxmox/resource_vm_qemu.go @@ -88,6 +88,11 @@ func resourceVmQemu() *schema.Resource { Optional: true, Default: 1, }, + "scsihw": { + Type: schema.TypeString, + Optional: true, + Default: "", + }, "network": &schema.Schema{ Type: schema.TypeSet, Optional: true, @@ -370,6 +375,7 @@ func resourceVmQemuCreate(d *schema.ResourceData, meta interface{}) error { Memory: d.Get("memory").(int), QemuCores: d.Get("cores").(int), QemuSockets: d.Get("sockets").(int), + Scsihw: d.Get("scsihw").(string), QemuOs: d.Get("qemu_os").(string), QemuNetworks: qemuNetworks, QemuDisks: qemuDisks, @@ -526,6 +532,7 @@ func resourceVmQemuUpdate(d *schema.ResourceData, meta interface{}) error { Memory: d.Get("memory").(int), QemuCores: d.Get("cores").(int), QemuSockets: d.Get("sockets").(int), + Scsihw: d.Get("scsihw").(string), QemuOs: d.Get("qemu_os").(string), QemuNetworks: qemuNetworks, QemuDisks: qemuDisks, @@ -614,6 +621,7 @@ func resourceVmQemuRead(d *schema.ResourceData, meta interface{}) error { d.Set("memory", config.Memory) d.Set("cores", config.QemuCores) d.Set("sockets", config.QemuSockets) + d.Set("scsihw", config.Scsihw) d.Set("qemu_os", config.QemuOs) // Cloud-init. d.Set("ciuser", config.CIuser)