Merge pull request #129 from V-Paranoiaque/feature/balloon

Add ballooning feature for memory
This commit is contained in:
Grant Gongaware 2019-12-16 09:42:33 -08:00 committed by GitHub
commit ecb0b334ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,6 +96,11 @@ func resourceVmQemu() *schema.Resource {
Optional: true,
Default: 512,
},
"balloon": {
Type: schema.TypeInt,
Optional: true,
Default: 0,
},
"cores": {
Type: schema.TypeInt,
Optional: true,
@ -449,6 +454,7 @@ func resourceVmQemuCreate(d *schema.ResourceData, meta interface{}) error {
BootDisk: d.Get("bootdisk").(string),
Agent: d.Get("agent").(int),
Memory: d.Get("memory").(int),
Balloon: d.Get("balloon").(int),
QemuCores: d.Get("cores").(int),
QemuSockets: d.Get("sockets").(int),
QemuVcpus: d.Get("vcpus").(int),
@ -640,6 +646,7 @@ func resourceVmQemuUpdate(d *schema.ResourceData, meta interface{}) error {
BootDisk: d.Get("bootdisk").(string),
Agent: d.Get("agent").(int),
Memory: d.Get("memory").(int),
Balloon: d.Get("balloon").(int),
QemuCores: d.Get("cores").(int),
QemuSockets: d.Get("sockets").(int),
QemuVcpus: d.Get("vcpus").(int),
@ -739,6 +746,7 @@ func resourceVmQemuRead(d *schema.ResourceData, meta interface{}) error {
d.Set("bootdisk", config.BootDisk)
d.Set("agent", config.Agent)
d.Set("memory", config.Memory)
d.Set("balloon", config.Balloon)
d.Set("cores", config.QemuCores)
d.Set("sockets", config.QemuSockets)
d.Set("vcpus", config.QemuVcpus)