diff --git a/builtin/providers/cloudstack/resource_cloudstack_instance.go b/builtin/providers/cloudstack/resource_cloudstack_instance.go index aa894f517..3e2c7d463 100644 --- a/builtin/providers/cloudstack/resource_cloudstack_instance.go +++ b/builtin/providers/cloudstack/resource_cloudstack_instance.go @@ -124,6 +124,12 @@ func resourceCloudStackInstance() *schema.Resource { Optional: 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)) } + // 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 r, err := cs.VirtualMachine.DeployVirtualMachine(p) if err != nil { diff --git a/website/source/docs/providers/cloudstack/r/instance.html.markdown b/website/source/docs/providers/cloudstack/r/instance.html.markdown index bc8f6a2d5..9ed4a9db5 100644 --- a/website/source/docs/providers/cloudstack/r/instance.html.markdown +++ b/website/source/docs/providers/cloudstack/r/instance.html.markdown @@ -66,6 +66,10 @@ The following arguments are supported: * `expunge` - (Optional) This determines if the instance is expunged when it is 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 The following attributes are exported: