powerflex_nvme_target (Data Source)
This datasource is used to query the existing NVMe targets from the PowerFlex array. The information fetched from this datasource can be used for getting the details / for further processing in resource block.
Note: NVMe over TCP is supported in PowerFlex 4.0 and later versions, therefore this datasource is not supported in PowerFlex 3.x.
Example Usage
/*
Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved.
Licensed under the Mozilla Public License Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://mozilla.org/MPL/2.0/
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
# commands to run this tf file : terraform init && terraform apply --auto-approve
# Get all NVMe target details present on the cluster
data "powerflex_nvme_target" "example1" {
}
// If multiple filter fields are provided then it will show the intersection of all of those fields.
// If there is no intersection between the filters then an empty datasource will be returned
// For more information about how we do our datasource filtering check out our guides: https://dell.github.io/terraform-docs/docs/storage/platforms/powerflex/product_guide/examples/
// Please note that NVMe over TCP is supported in PowerFlex 4.0 and later versions, therefore this datasource is not supported in PowerFlex 3.x.
data "powerflex_nvme_target" "example" {
filter {
name = ["name1", "name2"]
# id = ["ID1", "ID2"]
# protection_domain_id = ["PD1", "PD2"]
# storage_port = [12200]
# nvme_port = [4420]
# discovery_port = [8009]
# sdt_state = ["Normal"]
# mdm_connection_state = ["Connected"]
# membership_state = ["Joined"]
# fault_set_id = ["FS1"]
# software_version_info = ["Version"]
# maintenance_state = ["NoMaintenance"]
# authentication_error = ["None"]
# persistent_discovery_controllers_num = [0]
# system_id = ["systemID"]
}
}
output "nvme_target_result" {
value = data.powerflex_nvme_target.example
}
After the successful execution of above said block, We can see the output by executing terraform output
command. Also, we can fetch information via the variable: data.powerflex_nvme_target.example1.datasource_block_name.attribute_name
where attribute_name is the attribute which user wants to fetch.
Schema
Optional
filter
(Block, Optional) (see below for nested schema)
Read-Only
id
(String) ID of the NVMe targets Datasourcenvme_target_details
(Attributes List) List of NVMe targets (see below for nested schema)
Nested Schema for filter
Optional:
authentication_error
(Set of String) List of authentication_errordiscovery_port
(Set of Number) List of discovery_portfault_set_id
(Set of String) List of fault_set_idid
(Set of String) List of idmaintenance_state
(Set of String) List of maintenance_statemdm_connection_state
(Set of String) List of mdm_connection_statemembership_state
(Set of String) List of membership_statename
(Set of String) List of namenvme_port
(Set of Number) List of nvme_portprotection_domain_id
(Set of String) List of protection_domain_idsdt_state
(Set of String) List of sdt_statesoftware_version_info
(Set of String) List of software_version_infostorage_port
(Set of Number) List of storage_portsystem_id
(Set of String) List of system_id
Nested Schema for nvme_target_details
Read-Only:
authentication_error
(String) The authentication error of the NVMe target.certificate_info
(Attributes) Certificate Information. (see below for nested schema)discovery_port
(Number) The discovery port of the NVMe target.fault_set_id
(String) The fault set ID of the NVMe target.host_list
(Attributes List) Hosts attached to the NVMe target. (see below for nested schema)id
(String) ID of the NVMe targetip_list
(Attributes List) List of IPs associated with the NVMe target. (see below for nested schema)links
(Attributes List) Specifies the links associated with NVMe target. (see below for nested schema)maintenance_state
(String) The maintenance state of the NVMe target.mdm_connection_state
(String) The MDM connection state of the NVMe target.membership_state
(String) The membership state of the NVMe target.name
(String) Name of the NVMe targetnvme_port
(Number) The NVMe port of the NVMe target.protection_domain_id
(String) Protection Domain ID of the replicatio of the NVMe target.sdt_state
(String) The state of the NVMe target.software_version_info
(String) The software version information of the NVMe target.storage_port
(Number) The storage port of the NVMe target.system_id
(String) The ID of the system.
Nested Schema for nvme_target_details.certificate_info
Read-Only:
issuer
(String) Certificate issuer.subject
(String) Certificate subject.thumbprint
(String) Certificate thumbprint.valid_from
(String) The start date of the certificate validity.valid_from_asn1_format
(String) The start date of the Asn1 format.valid_to
(String) The end date of the certificate validity.valid_to_asn1_format
(String) The end date of the Asn1 format.
Nested Schema for nvme_target_details.host_list
Read-Only:
host_id
(String) Host ID.host_ip
(String) Host IP address.host_name
(String) Host name.is_connected
(Boolean) Specifies whether the host is connected to the NVMe target.sys_port_ip
(String) Specifies the target IP address of the NVMe controller.
Nested Schema for nvme_target_details.ip_list
Read-Only:
ip
(String) NVMe Target IP.role
(String) NVMe Target IP role.
Nested Schema for nvme_target_details.links
Read-Only:
href
(String) Specifies the exact path to fetch the details.rel
(String) Specifies the relationship with the NVMe target.