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

Feature/vcpu #122

Merged
merged 3 commits into from
Dec 6, 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 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" {
os_type = "cloud-init"
cores = "2"
sockets = "1"
vcpus = "0"
cpu = "host"
memory = "2048"
scsihw = "lsi"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module github.com/Telmate/terraform-provider-proxmox
go 1.13

require (
github.com/Telmate/proxmox-api-go v0.0.0-20191202165429-ba1b7dd050aa
github.com/Telmate/proxmox-api-go v0.0.0-20191206171242-991c5ce7826d
github.com/hashicorp/terraform v0.12.10
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ github.com/Telmate/proxmox-api-go v0.0.0-20191104165655-ab21e7f8ad14 h1:5YRnEl50
github.com/Telmate/proxmox-api-go v0.0.0-20191104165655-ab21e7f8ad14/go.mod h1:OGWyIMJ87/k/GCz8CGiWB2HOXsOVDM6Lpe/nFPkC4IQ=
github.com/Telmate/proxmox-api-go v0.0.0-20191202165429-ba1b7dd050aa h1:Ypr/7Agl67RX/6iQ3fW+tHJPul14xFwttXC0d5xNdxg=
github.com/Telmate/proxmox-api-go v0.0.0-20191202165429-ba1b7dd050aa/go.mod h1:OGWyIMJ87/k/GCz8CGiWB2HOXsOVDM6Lpe/nFPkC4IQ=
github.com/Telmate/proxmox-api-go v0.0.0-20191206171242-991c5ce7826d h1:OPRNmtQcU2EvGndXfW+G/rg3DYAxSoyHbWGCdG48Vg0=
github.com/Telmate/proxmox-api-go v0.0.0-20191206171242-991c5ce7826d/go.mod h1:OGWyIMJ87/k/GCz8CGiWB2HOXsOVDM6Lpe/nFPkC4IQ=
github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292/go.mod h1:KYCjqMOeHpNuTOiFQU6WEcTG7poCJrUs0YgyHNtn1no=
github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw=
github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
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 @@ -106,6 +106,11 @@ func resourceVmQemu() *schema.Resource {
Optional: true,
Default: 1,
},
"vcpus": {
Type: schema.TypeInt,
Optional: true,
Default: 0,
},
"cpu": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -446,6 +451,7 @@ func resourceVmQemuCreate(d *schema.ResourceData, meta interface{}) error {
Memory: d.Get("memory").(int),
QemuCores: d.Get("cores").(int),
QemuSockets: d.Get("sockets").(int),
QemuVcpus: d.Get("vcpus").(int),
QemuCpu: d.Get("cpu").(string),
QemuNuma: d.Get("numa").(bool),
Hotplug: d.Get("hotplug").(string),
Expand Down Expand Up @@ -636,6 +642,7 @@ func resourceVmQemuUpdate(d *schema.ResourceData, meta interface{}) error {
Memory: d.Get("memory").(int),
QemuCores: d.Get("cores").(int),
QemuSockets: d.Get("sockets").(int),
QemuVcpus: d.Get("vcpus").(int),
QemuCpu: d.Get("cpu").(string),
QemuNuma: d.Get("numa").(bool),
Hotplug: d.Get("hotplug").(string),
Expand Down Expand Up @@ -734,6 +741,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("vcpus", config.QemuVcpus)
d.Set("cpu", config.QemuCpu)
d.Set("numa", config.QemuNuma)
d.Set("hotplug", config.Hotplug)
Expand Down