provider/cloudstack: add root_disk_size

This commit is contained in:
Joakim Sernbrant 2016-06-08 10:23:14 +02:00
parent ac2d195cc5
commit dd5f121494
2 changed files with 15 additions and 0 deletions

View File

@ -124,6 +124,12 @@ func resourceCloudStackInstance() *schema.Resource {
Optional: true, Optional: true,
Computed: true, Computed: true,
}, },
"root_disk_size": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
ForceNew: true,
},
}, },
} }
} }
@ -252,6 +258,11 @@ func resourceCloudStackInstanceCreate(d *schema.ResourceData, meta interface{})
p.SetGroup(group.(string)) p.SetGroup(group.(string))
} }
// If there is a root_disk_size supplied, add it to the parameter struct
if rootdisksize, ok := d.GetOk("root_disk_size"); ok {
p.SetRootdisksize(int64(rootdisksize.(int)))
}
// Create the new instance // Create the new instance
r, err := cs.VirtualMachine.DeployVirtualMachine(p) r, err := cs.VirtualMachine.DeployVirtualMachine(p)
if err != nil { if err != nil {

View File

@ -66,6 +66,10 @@ The following arguments are supported:
* `expunge` - (Optional) This determines if the instance is expunged when it is * `expunge` - (Optional) This determines if the instance is expunged when it is
destroyed (defaults false) destroyed (defaults false)
* `root_disk_size` - (Optional) The size of the root disk in
gigabytes. The root disk is resized on deploy. Only applies to
template-based deployments.
## Attributes Reference ## Attributes Reference
The following attributes are exported: The following attributes are exported: