From 8c20676f2a38a7ee93d81feb41918217fd716c11 Mon Sep 17 00:00:00 2001 From: Renzheng Wang Date: Mon, 4 Sep 2023 16:33:09 +0800 Subject: [PATCH] add rdma_cluster_id attribute to bare metal instance (#157) * update change log * add rdma_cluster_id attribute --- CHANGELOG.md | 6 ++++++ examples/rssd/main.tf | 2 +- ucloud/config.go | 2 +- ucloud/resource_ucloud_baremetal_instance.go | 6 ++++++ website/docs/d/baremetal_images.html.markdown | 2 +- website/docs/index.html.markdown | 4 ++-- website/docs/r/baremetal_instance.html.markdown | 8 +++++++- 7 files changed, 24 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e662eac..489d1476 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.38.1 (2023-09-03) + +FEATURES: + +* add rdma_cluster_id attribute to bare metal instance + ## 1.38.0 (2023-09-03) FEATURES: diff --git a/examples/rssd/main.tf b/examples/rssd/main.tf index 8942691c..b036bf57 100644 --- a/examples/rssd/main.tf +++ b/examples/rssd/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { ucloud = { source = "ucloud/ucloud" - version = "~>1.38.0" + version = "~>1.38.1" } } } diff --git a/ucloud/config.go b/ucloud/config.go index 83bf5526..e4ccd1d6 100644 --- a/ucloud/config.go +++ b/ucloud/config.go @@ -72,7 +72,7 @@ func (c *Config) Client() (*UCloudClient, error) { // enable auto retry with http/connection error cfg.MaxRetries = c.MaxRetries cfg.LogLevel = log.PanicLevel - cfg.UserAgent = "Terraform-UCloud/1.38.0" + cfg.UserAgent = "Terraform-UCloud/1.38.1" cfg.BaseUrl = c.BaseURL cred := auth.NewCredential() diff --git a/ucloud/resource_ucloud_baremetal_instance.go b/ucloud/resource_ucloud_baremetal_instance.go index f57b575f..4d6977b7 100644 --- a/ucloud/resource_ucloud_baremetal_instance.go +++ b/ucloud/resource_ucloud_baremetal_instance.go @@ -213,6 +213,10 @@ func resourceUCloudBareMetalInstance() *schema.Resource { "no_raid", }, false), }, + "rdma_cluster_id": { + Type: schema.TypeString, + Computed: true, + }, }, } } @@ -454,6 +458,8 @@ func resourceUCloudBareMetalInstanceRead(d *schema.ResourceData, meta interface{ if _, ok := d.GetOk("network_interface"); ok { d.Set("network_interface", networkInterfaces) } + + d.Set("rdma_cluster_id", instance.RdmaClusterId) return nil } diff --git a/website/docs/d/baremetal_images.html.markdown b/website/docs/d/baremetal_images.html.markdown index 81d59d3e..3b30d3ba 100644 --- a/website/docs/d/baremetal_images.html.markdown +++ b/website/docs/d/baremetal_images.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "Bare Metail (UPhost)" +subcategory: "Bare Metal (UPhost)" layout: "ucloud" page_title: "UCloud: ucloud_baremetal_images" sidebar_current: "docs-ucloud-datasource-baremetal-images" diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 4545c7fe..6e440286 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -23,7 +23,7 @@ terraform { required_providers { ucloud = { source = "ucloud/ucloud" - version = "~>1.38.0" + version = "~>1.38.1" } } } @@ -91,7 +91,7 @@ terraform { required_providers { ucloud = { source = "ucloud/ucloud" - version = "~>1.38.0" + version = "~>1.38.1" } } } diff --git a/website/docs/r/baremetal_instance.html.markdown b/website/docs/r/baremetal_instance.html.markdown index e51ae842..7cfa08d7 100644 --- a/website/docs/r/baremetal_instance.html.markdown +++ b/website/docs/r/baremetal_instance.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "Bare Metail (UPhost)" +subcategory: "Bare Metal (UPhost)" layout: "ucloud" page_title: "UCloud: ucloud_baremetal_instance" sidebar_current: "docs-ucloud-resource-baremetal-instance" @@ -76,6 +76,12 @@ The `network_interface` block supports: - `eip_internet_type` - (Required, ForceNew) Type of Elastic IP routes. Possible values are: international as international BGP IP and bgp as china mainland BGP IP. - `eip_charge_mode` - (Required, ForceNew) Elastic IP charge mode. Possible values are raid1, raid0, raid10, raid5 and no_raid. +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `rdma_cluster_id` - The RDMA Cluster ID of disk. It is mandatory if your disk type is `rssd_data_disk` in `ucloud_disk` resource and must be set to the same value as the bare metal instance to attach to. + ## Import Bare metal instance can be imported using the `id`, e.g.