-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs and examples for associate category to VG
- Loading branch information
1 parent
ccd9aa8
commit b0cf6e6
Showing
5 changed files
with
171 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
terraform { | ||
required_providers { | ||
nutanix = { | ||
source = "nutanix/nutanix" | ||
version = "2.1" | ||
} | ||
} | ||
} | ||
|
||
#defining nutanix configuration | ||
provider "nutanix" { | ||
username = var.nutanix_username | ||
password = var.nutanix_password | ||
endpoint = var.nutanix_endpoint | ||
port = 9440 | ||
insecure = true | ||
} | ||
|
||
// Create a volume group | ||
resource "nutanix_volume_group_v2" "example"{ | ||
name = "test_volume_group" | ||
description = "Test Volume group with min spec and no Auth" | ||
should_load_balance_vm_attachments = false | ||
sharing_status = "SHARED" | ||
target_name = "volumegroup-test-0" | ||
created_by = "Test" | ||
cluster_reference = "<Cluster uuid>" | ||
iscsi_features { | ||
enabled_authentications = "CHAP" | ||
target_secret = "1234567891011" | ||
} | ||
|
||
storage_features { | ||
flash_mode { | ||
is_enabled = true | ||
} | ||
} | ||
usage_type = "USER" | ||
is_hidden = false | ||
|
||
lifecycle { | ||
ignore_changes = [ | ||
iscsi_features[0].target_secret | ||
] | ||
} | ||
} | ||
|
||
|
||
# List categories | ||
data "nutanix_categories_v2" "categories"{} | ||
|
||
# Associate categories to volume group | ||
resource "nutanix_associate_category_to_volume_group_v2" "example"{ | ||
ext_id = nutanix_volume_group_v2.example.id | ||
categories{ | ||
ext_id = data.nutanix_categories_v2.categories.categories.0.ext_id | ||
} | ||
categories{ | ||
ext_id = data.nutanix_categories_v2.categories.categories.1.ext_id | ||
} | ||
categories{ | ||
ext_id = data.nutanix_categories_v2.categories.categories.2.ext_id | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
examples/associate_category_to_volume_group_v2/terraform.tfvars
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,5 @@ | ||
#define values to the variables to be used in terraform file | ||
nutanix_username = "admin" | ||
nutanix_password = "password" | ||
nutanix_endpoint = "10.xx.xx.xx" | ||
nutanix_port = 9440 |
13 changes: 13 additions & 0 deletions
13
examples/associate_category_to_volume_group_v2/variables.tf
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,13 @@ | ||
#define the type of variables to be used in terraform file | ||
variable "nutanix_username" { | ||
type = string | ||
} | ||
variable "nutanix_password" { | ||
type = string | ||
} | ||
variable "nutanix_endpoint" { | ||
type = string | ||
} | ||
variable "nutanix_port" { | ||
type = string | ||
} |
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
82 changes: 82 additions & 0 deletions
82
website/docs/r/associate_category_to_volume_group_v2.html.markdown
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,82 @@ | ||
--- | ||
layout: "nutanix" | ||
page_title: "NUTANIX: nutanix_associate_category_to_volume_group_v2" | ||
sidebar_current: "docs-nutanix-resource-associate-category-to-volume-group-v2" | ||
description: |- | ||
This operation submits a request to Creates a new Volume Disk. | ||
--- | ||
|
||
# nutanix_volume_group_v2 | ||
|
||
Provides a resource to Creates a new Volume Disk. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
resource "nutanix_volume_group_v2" "example"{ | ||
name = "test_volume_group" | ||
description = "Test Volume group with min spec and no Auth" | ||
should_load_balance_vm_attachments = false | ||
sharing_status = "SHARED" | ||
target_name = "volumegroup-test-0" | ||
created_by = "Test" | ||
cluster_reference = "<Cluster uuid>" | ||
iscsi_features { | ||
enabled_authentications = "CHAP" | ||
target_secret = "1234567891011" | ||
} | ||
storage_features { | ||
flash_mode { | ||
is_enabled = true | ||
} | ||
} | ||
usage_type = "USER" | ||
is_hidden = false | ||
lifecycle { | ||
ignore_changes = [ | ||
iscsi_features[0].target_secret | ||
] | ||
} | ||
} | ||
# List categories | ||
data "nutanix_categories_v2" "categories"{} | ||
# Associate categories to volume group | ||
resource "nutanix_associate_category_to_volume_group_v2" "example"{ | ||
ext_id = nutanix_volume_group_v2.example.id | ||
categories{ | ||
ext_id = data.nutanix_categories_v2.categories.categories.0.ext_id | ||
} | ||
categories{ | ||
ext_id = data.nutanix_categories_v2.categories.categories.1.ext_id | ||
} | ||
categories{ | ||
ext_id = data.nutanix_categories_v2.categories.categories.2.ext_id | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `ext_id `: -(Required) The external identifier of the Volume Group. | ||
* `categories`: -(Required) The category to be associated/disassociated with the Volume Group. This is a mandatory field. | ||
|
||
|
||
### categories | ||
|
||
The categories attribute supports the following: | ||
|
||
* `ext_id`: -(Required) The external identifier of the category. | ||
* `name`: -(Optional) Name of entity that's represented by this reference | ||
* `uris`: -(Optional) URI of entities that's represented by this reference. | ||
* `entity_type`: -(Optional) Type of entity that's represented by this reference. Default value is "CATEGORY". Valid values are: | ||
* "CATEGORY". | ||
|
||
See detailed information in [Nutanix Associate/Disassociate category to/from a Volume Group V4](https://developers.nutanix.com/api-reference?namespace=volumes&version=v4.0#tag/VolumeGroups/operation/associateCategory). |