Skip to content

Commit

Permalink
add rdma_cluster_id attribute to bare metal instance (#157)
Browse files Browse the repository at this point in the history
* update change log
* add rdma_cluster_id attribute
  • Loading branch information
wangrzneu authored Sep 4, 2023
1 parent 8d87cde commit 8c20676
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion examples/rssd/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
ucloud = {
source = "ucloud/ucloud"
version = "~>1.38.0"
version = "~>1.38.1"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion ucloud/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 6 additions & 0 deletions ucloud/resource_ucloud_baremetal_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ func resourceUCloudBareMetalInstance() *schema.Resource {
"no_raid",
}, false),
},
"rdma_cluster_id": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion website/docs/d/baremetal_images.html.markdown
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions website/docs/index.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ terraform {
required_providers {
ucloud = {
source = "ucloud/ucloud"
version = "~>1.38.0"
version = "~>1.38.1"
}
}
}
Expand Down Expand Up @@ -91,7 +91,7 @@ terraform {
required_providers {
ucloud = {
source = "ucloud/ucloud"
version = "~>1.38.0"
version = "~>1.38.1"
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion website/docs/r/baremetal_instance.html.markdown
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 8c20676

Please sign in to comment.