Skip to content

Commit

Permalink
add new attributes [attachmentType, protocol, disks] to Volume Group
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroon-Dweikat-Ntx committed Dec 12, 2024
1 parent d14694d commit 1c4d973
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 2 deletions.
49 changes: 49 additions & 0 deletions examples/volume_group_v2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,55 @@ resource "nutanix_volume_group_v2" "volume_group_example" {
}



# create a volume group with attachement_type , protocol and disks
resource "nutanix_volume_group_v2" "volume_group_example" {
name = var.volume_group_name
description = "Test Create Volume group with spec"
should_load_balance_vm_attachments = false
sharing_status = var.volume_group_sharing_status
target_name = "volumegroup-test-001234"
created_by = "example"
cluster_reference = local.cluster1
iscsi_features {
enabled_authentications = "CHAP"
target_secret = var.volume_group_target_secret
}

storage_features {
flash_mode {
is_enabled = true
}
}
usage_type = "USER"
attachment_type = "DIRECT"
protocol = "ISCSI"
disks {
disk_size_bytes = 10 * 1024 * 1024 * 1024
index = 1
disk_data_source_reference {
name = "vg-disk-%[1]s"
ext_id = "<storage_container_uuid>"
entity_type = "STORAGE_CONTAINER"
uris = ["uri1","uri2"]
}
disk_storage_features {
flash_mode {
is_enabled = false
}
}
}
is_hidden = false

# ignore changes to target_secret, target secret will not be returned in terraform plan output
lifecycle {
ignore_changes = [
iscsi_features[0].target_secret
]
}
}


##########################
### Data Sources
##########################
Expand Down
44 changes: 42 additions & 2 deletions website/docs/r/volume_group_v2.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,16 @@ The following arguments are supported:
* `cluster_reference`: -(Required) The UUID of the cluster that will host the Volume Group.
* `storage_features`: -(Optional) Storage optimization features which must be enabled on the Volume Group.
* `usage_type`: -(Optional) Expected usage type for the Volume Group. This is an indicative hint on how the caller will consume the Volume Group. Valid values are BACKUP_TARGET, INTERNAL, TEMPORARY, USER
* `attachment_type`: -(Optional) The field indicates whether a VG has a VM or an external attachment associated with it. Valid values are :
- EXTERNAL : Volume Group has an external iSCSI or NVMf attachment.
- NONE : Volume Group has no attachment.
- DIRECT : Volume Group has a VM attachment.
* `protocol`: -(Optional) Type of protocol to be used for Volume Group. Valid values are :
- NOT_ASSIGNED : Volume Group does not use any protocol.
- ISCSI : Volume Group uses iSCSI protocol.
- NVMF : Volume Group uses NVMf protocol.
* `is_hidden`: -(Optional) Indicates whether the Volume Group is meant to be hidden or not.

* `disks`: -(Optional) A list of Volume Disks to be attached to the Volume Group.

### Iscsi Features

Expand All @@ -81,4 +89,36 @@ The flash mode features attribute supports the following:

* `is_enabled`: - Indicates whether the flash mode is enabled for the Volume Group.

See detailed information in [Nutanix Volumes V4](https://developers.nutanix.com/api-reference?namespace=volumes&version=v4.0.b1).
### Disks

The disks attribute supports the following:

* `index`: - Index of the disk in a Volume Group. This field is optional and immutable.
* `disk_size_bytes`: - ize of the disk in bytes. This field is mandatory during Volume Group creation if a new disk is being created on the storage container.
* `description`: - Volume Disk description.
* `disk_data_source_reference`: -(Required) Disk Data Source Reference.
* `disk_storage_features`: - Storage optimization features which must be enabled on the Volume Disks. This is an optional field. If omitted, the disks will honor the Volume Group specific storage features setting.


#### Disk Data Source Reference

The disk_data_source_reference attribute supports the following:

* `ext_id`: - The external identifier of the Data Source Reference.
* `name`: - The name of the Data Source Reference.bled for the Volume Group.
* `uris`: - The uri list of the Data Source Reference.
* `entity_type`: - The Entity Type of the Data Source Reference.

#### Disk Storage Features

The disk_storage_features attribute supports the following:

* `flash_mode`: - this field will avoid down migration of data from the hot tier unless the overrides field is specified for the virtual disks.

##### Flash Mode

The flash mode features attribute supports the following:

* `is_enabled`: - Indicates whether the flash mode is enabled for the Volume Group Disk.

See detailed information in [Nutanix Volumes V4](https://developers.nutanix.com/api-reference?namespace=volumes&version=v4.0.b1#tag/VolumeGroups/operation/createVolumeGroup).

0 comments on commit 1c4d973

Please sign in to comment.