From dd5f121494f35355bb26f3c183c13f82c4e0a973 Mon Sep 17 00:00:00 2001 From: Joakim Sernbrant Date: Wed, 8 Jun 2016 10:23:14 +0200 Subject: [PATCH] provider/cloudstack: add root_disk_size --- .../cloudstack/resource_cloudstack_instance.go | 11 +++++++++++ .../providers/cloudstack/r/instance.html.markdown | 4 ++++ 2 files changed, 15 insertions(+) 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: