Skip to content

Commit a56bc1c

Browse files
author
greyworld
committed
feat(workspace): update desktop resource for batch modify volume QoS
- change implement for modify volume QoS - add test case for volume normal change - add test case for volume abnormal change
1 parent f38c750 commit a56bc1c

File tree

4 files changed

+1144
-249
lines changed

4 files changed

+1144
-249
lines changed

docs/resources/workspace_desktop.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ The following arguments are supported:
9797
* `data_volume` - (Optional, List) Specifies the configuration of data volumes.
9898
The [object](#desktop_volume) structure is documented below.
9999

100+
-> Only can append new disks at the end of the queue, and cannot modify the order of existing disks.
101+
100102
* `availability_zone` - (Optional, String, ForceNew) Specifies the availability zone where the desktop is located.
101103
Changing this will create a new resource.
102104

@@ -154,6 +156,8 @@ The `root_volume` and `data_volume` block supports:
154156
The valid values are as follows:
155157
+ **SAS**: High I/O disk type.
156158
+ **SSD**: Ultra-high I/O disk type.
159+
+ **GPSSD**: General purpose SSD disk type.
160+
+ **GPSSD2**: General purpose SSD V2 disk type.
157161

158162
-> Updates are not supported for this parameter. Changing this will not create a new resource, but will throw an
159163
error.
@@ -162,6 +166,18 @@ The `root_volume` and `data_volume` block supports:
162166
+ For root volume, the valid value is range from `80` to `1,020`.
163167
+ For data volume, the valid value is range from `10` to `8,200`.
164168

169+
* `iops` - (Optional, Int) Specifies the IOPS of the volume.
170+
which is the number of read and write operations per second.
171+
This parameter is only valid for GPSSD2 type volumes.
172+
The valid value is range from `3,000` to `12,800`.
173+
174+
* `throughput` - (Optional, Int) Specifies the throughput of the volume.
175+
which is the amount of data successfully transmitted per second (read and write data), in MiB/s.
176+
This parameter is only valid for GPSSD2 type volumes.
177+
The valid value is range from `125` to `1,000`.
178+
179+
* `kms_id` - (Optional, String) Specifies the KMS key ID used to encrypt the volume.
180+
165181
<a name="desktop_nic"></a>
166182
The `nic` block supports:
167183

huaweicloud/services/acceptance/workspace/data_source_huaweicloud_workspace_desktops_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,18 @@ data "huaweicloud_workspace_flavors" "test" {
8989
}
9090
9191
resource "huaweicloud_workspace_desktop" "test" {
92-
flavor_id = try(data.huaweicloud_workspace_flavors.test.flavors[0].id)
92+
flavor_id = try(data.huaweicloud_workspace_flavors.test.flavors[0].id, "NOT_FOUND")
9393
image_type = "market"
94-
image_id = try(data.huaweicloud_images_images.test.images[0].id)
95-
availability_zone = data.huaweicloud_availability_zones.test.names[0]
96-
vpc_id = huaweicloud_vpc.test.id
94+
image_id = try(data.huaweicloud_images_images.test.images[0].id, "NOT_FOUND")
95+
availability_zone = try(data.huaweicloud_availability_zones.test.names[0], "NOT_FOUND")
96+
vpc_id = data.huaweicloud_workspace_service.test.vpc_id
9797
security_groups = [
98-
huaweicloud_workspace_service.test.desktop_security_group.0.id,
99-
huaweicloud_networking_secgroup.test.id,
98+
try(data.huaweicloud_workspace_service.test.desktop_security_group[0].id, "NOT_FOUND"),
99+
try(data.huaweicloud_workspace_service.test.infrastructure_security_group[0].id, "NOT_FOUND")
100100
]
101101
102102
nic {
103-
network_id = huaweicloud_vpc_subnet.test.id
103+
network_id = try(data.huaweicloud_workspace_service.test.network_ids[0], "NOT_FOUND")
104104
}
105105
106106
name = "%[2]s"
@@ -249,5 +249,5 @@ output "is_status_filter_useful" {
249249
[for v in data.huaweicloud_workspace_desktops.filter_by_status.desktops[*].status : v == local.status]
250250
)
251251
}
252-
`, testAccDesktop_base(rName), rName)
252+
`, testAccDesktop_base(), rName)
253253
}

0 commit comments

Comments
 (0)