This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/cloudstack-terraform-provider.git


The following commit(s) were added to refs/heads/main by this push:
     new f08f5a5  Add UEFI support (#83)
f08f5a5 is described below

commit f08f5a50addbf8daeb789f92399770b070792bf4
Author: Vladimir Dombrovski <[email protected]>
AuthorDate: Wed Mar 6 15:24:08 2024 +0100

    Add UEFI support (#83)
---
 cloudstack/resource_cloudstack_instance.go | 11 +++++++++++
 website/docs/r/instance.html.markdown      |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/cloudstack/resource_cloudstack_instance.go 
b/cloudstack/resource_cloudstack_instance.go
index aae2408..bd69e83 100644
--- a/cloudstack/resource_cloudstack_instance.go
+++ b/cloudstack/resource_cloudstack_instance.go
@@ -154,6 +154,12 @@ func resourceCloudStackInstance() *schema.Resource {
                                Optional: true,
                        },
 
+                       "uefi": {
+                               Type:     schema.TypeBool,
+                               Optional: true,
+                               Default:  false,
+                       },
+
                        "start_vm": {
                                Type:     schema.TypeBool,
                                Optional: true,
@@ -282,6 +288,11 @@ func resourceCloudStackInstanceCreate(d 
*schema.ResourceData, meta interface{})
                p.SetRootdisksize(int64(rootdisksize.(int)))
        }
 
+       if d.Get("uefi").(bool) {
+               p.SetBoottype("UEFI")
+               p.SetBootmode("Legacy")
+       }
+
        if zone.Networktype == "Advanced" {
                // Set the default network ID
                p.SetNetworkids([]string{d.Get("network_id").(string)})
diff --git a/website/docs/r/instance.html.markdown 
b/website/docs/r/instance.html.markdown
index 2510732..ee21f69 100644
--- a/website/docs/r/instance.html.markdown
+++ b/website/docs/r/instance.html.markdown
@@ -87,6 +87,8 @@ The following arguments are supported:
 * `expunge` - (Optional) This determines if the instance is expunged when it is
     destroyed (defaults false)
 
+* `uefi` - (Optional) When set, will boot the instance in UEFI/Legacy mode 
(defaults false)
+
 ## Attributes Reference
 
 The following attributes are exported:

Reply via email to