apache / cloudstack-terraform-provider

CloudStack Terraform Provider
https://cloudstack.apache.org
Apache License 2.0
29 stars 36 forks source link

Add Override root disk offering and Disk Offerings to cloudstack_instance Resource #68

Open jb2592 opened 1 year ago

jb2592 commented 1 year ago

It would be useful to be able to override the root disk offering as part of the compute offering and specify a disk offering as part of the cloudstack_instance resource just like you can via the UI.

Select a Compute Offering Enable Override root disk offering Select a disk offering via name or ID from the list available.

kiranchavala commented 8 months ago

@vishesh92

We need to add the parameter "overridediskofferingid" to the resource cloudstack_instance

https://cloudstack.apache.org/api/apidocs-4.19/apis/deployVirtualMachine.html

https://github.com/apache/cloudstack-terraform-provider/blob/main/cloudstack/resource_cloudstack_instance.go

https://github.com/apache/cloudstack-go/blob/main/cloudstack/VirtualMachineService.go#L40

When I added the following code and try to build it locally getting the following exception

"overridediskofferingid": {
                Type:     schema.TypeString,
                Optional: true,
            },

if overridediskofferingid, ok := d.GetOk("overridediskofferingid"); ok {
        p.SetOverridediskofferingid(overridediskofferingid.(string))
    }
cloudstack-terraform-provider git:(add-overridediskofferingid) ✗ go build
# github.com/terraform-providers/terraform-provider-cloudstack/cloudstack
cloudstack/resource_cloudstack_instance.go:291:5: p.SetOverridediskofferingid undefined (type *"github.com/apache/cloudstack-go/v2/cloudstack".DeployVirtualMachineParams has no field or method SetOverridediskofferingid)
vishesh92 commented 8 months ago

Had a discussion with @kiranchavala. This requires go SDK to be upgraded. Changed the milestone to v0.6.0