-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vserver): Add the ability to create a KVM hypervisor type 3Gen s…
…erver (#455) * feat(vserver): Add VSERVER image numbers Data Source * feat(vserver): Add VSERVER specs Data Source * feat(vserver): Add the ability to create a KVM hypervisor type Gen3 server * fix(vserver): Don't set the state when error responded * review(vserver): Modify based on reviews
- Loading branch information
Showing
18 changed files
with
1,245 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
--- | ||
subcategory: "Server" | ||
--- | ||
|
||
|
||
# Data Source: ncloud_server_image_numbers | ||
|
||
To create a server instance (VM), you should select a server image. This data source gets a list of server images. You can look up the image numbers of Gen2(XEN) and Gen3(KVM) servers. | ||
|
||
~> **NOTE:** This only supports VPC environment. | ||
|
||
## Example Usage | ||
|
||
The following example shows how to take a list of Server image. | ||
|
||
```terraform | ||
data "ncloud_server_image_numbers" "example" { | ||
output_file = "image.json" | ||
} | ||
output "image_list" { | ||
value = { | ||
for image in data.ncloud_server_image_numbers.example.image_number_list: | ||
image.server_image_number => [image.name, image.hypervisor_type] | ||
} | ||
} | ||
``` | ||
|
||
Outputs: | ||
```terraform | ||
image_list = { | ||
"16187005" = [ | ||
"ubuntu-20.04", | ||
"XEN", | ||
] | ||
"16187007" = [ | ||
"win-2019-64-en", | ||
"XEN", | ||
] | ||
"17552318" = [ | ||
"ubuntu-20.04-base", | ||
"KVM", | ||
] | ||
"23789321" = [ | ||
"ubuntu-22.04-gpu", | ||
"KVM", | ||
] | ||
"25495367" = [ | ||
"rocky-8.10-base", | ||
"KVM", | ||
] | ||
"25623982" = [ | ||
"rocky-8.10-gpu", | ||
"KVM", | ||
] | ||
"25624115" = [ | ||
"rocky-8.10-base", | ||
"XEN", | ||
] | ||
} | ||
``` | ||
|
||
```terraform | ||
data "ncloud_server_image_numbers" "example" { | ||
filter { | ||
name = "name" | ||
values = ["rocky-8.10-base"] | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `output_file` - (Optional) The name of file that can save data source after running `terraform plan`. | ||
* `filter` - (Optional) Custom filter block as described below. | ||
* `name` - (Required) The name of the field to filter by | ||
* `values` - (Required) Set of values that are accepted for the given field. | ||
* `regex` - (Optional) is `values` treated as a regular expression. | ||
|
||
## Attributes Reference | ||
|
||
This data source exports the following attributes in addition to the arguments above: | ||
|
||
* `image_number_list` - List of SEVER image number. | ||
* `server_image_number` - Server image number. | ||
* `name` - Server image name. | ||
* `description` - Server image description. | ||
* `type` - Server image type. (`SELF` or `NCP`) | ||
* `hypervisor_type` - Server image hypervisor type. (`XEN` or `KVM`) | ||
* `cpu_architecture_type` - Server image cpu type. | ||
* `os_category_type` - Server image os category type. (`LINUX` or `WINDOWS`) | ||
* `os_type` - Server image os type. (`ROCKY` or `UBUNTU` or `CENTOS` or `WINDOWS`) | ||
* `product_code` - The code of image product. | ||
* `block_storage_mapping_list` - List of block storage allocated to the server image. Viewable after the server image is created. | ||
* `order` - Block storage order. | ||
* `block_storage_snapshot_instance_no` - Block storage snapshot instance number. | ||
* `block_storage_snapshot_name` - Block storage snapshot name. | ||
* `block_storage_size` - Block storage size (byte). | ||
* `block_storage_name` - Block storage name. | ||
* `block_storage_volume_type` - Block storage volume type. (`SSD` or `HDD` or `CB1` or `FB1`). | ||
* `iops` - IOPS. | ||
* `throughput` - Load balancing performance. | ||
* `is_encrypted_volume` - Volume encryption status. (`true` or `false`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
subcategory: "Server" | ||
--- | ||
|
||
|
||
# Data Source: ncloud_server_specs | ||
|
||
To create a server instance (VM), you should select a server spec. This data source gets a list of server specs. You can look up the spec code of servers. | ||
|
||
~> **NOTE:** This only supports VPC environment. | ||
|
||
## Example Usage | ||
|
||
The following example shows how to take a list of Server spec. | ||
|
||
```terraform | ||
data "ncloud_server_specs" "example" { | ||
output_file = "spec.json" | ||
} | ||
output "spec_list" { | ||
value = { | ||
for spec in data.ncloud_server_specs.example.server_spec_list: | ||
spec.server_spec_code => [spec.description, spec.generation_code] | ||
} | ||
} | ||
``` | ||
|
||
Outputs: | ||
```terraform | ||
spec_list = { | ||
"c2-g3" = [ | ||
"vCPU 2EA, Memory 4GB", | ||
"G3", | ||
] | ||
"m2-g3" = [ | ||
"vCPU 2EA, Memory 16GB", | ||
"G3", | ||
] | ||
"c2-g2-s50" = [ | ||
"vCPU 2EA, Memory 4GB, [SSD]Disk 50GB", | ||
"G2", | ||
] | ||
} | ||
``` | ||
|
||
```terraform | ||
data "ncloud_server_specs" "example" { | ||
filter { | ||
name = "server_spec_code" | ||
values = ["c2-g3"] | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `output_file` - (Optional) The name of file that can save data source after running `terraform plan`. | ||
* `filter` - (Optional) Custom filter block as described below. | ||
* `name` - (Required) The name of the field to filter by | ||
* `values` - (Required) Set of values that are accepted for the given field. | ||
* `regex` - (Optional) is `values` treated as a regular expression. | ||
|
||
## Attributes Reference | ||
|
||
This data source exports the following attributes in addition to the arguments above: | ||
|
||
* `server_spec_list` - List of SEVER spec. | ||
* `server_spec_code` - Server spec code. | ||
* `hypervisor_type` - Server hypervisor type. (`XEN` or `KVM`) | ||
* `generation_code` - Server generation code. (`G2` or `G3`) | ||
* `cpu_architecture_type` - Server cpu type. | ||
* `cpu_count` - Server cpu count. | ||
* `memory_size` - Server memory size(Byte). | ||
* `block_storage_max_count` - Maximum number of BlockStorage that can be allocated. | ||
* `block_storage_max_iops` - BlockStorage max IOPS. | ||
* `block_storage_max_throughput` - BlockStorage max throughput(Mbps). | ||
* `network_performance` - Network performance(bps). | ||
* `network_interface_max_count` - Maximum number of network interfaces that can be allocated. | ||
* `gpu_count` - GPU count. | ||
* `description` - Server sepc description. | ||
* `product_code` - The code of server product. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.