Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SCSI controller support #70

Merged
merged 1 commit into from
Aug 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ resource "proxmox_vm_qemu" "prepprovision-test" {
cores = 3
sockets = 1
memory = 2560
scsihw = "lsi"
network {
id = 0
model = "virtio"
Expand Down
1 change: 1 addition & 0 deletions examples/cloudinit_example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 8 additions & 0 deletions proxmox/resource_vm_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down