powerstore_host (Resource)

Host resource

Note: name, os_type and initiators are the required attributes to create.
Note: os_type cannot be updated.
Note: port_name is the required attribute for initiators.
Note: chap_single_password must be present when chap_single_username is given and vice-versa.
Note: chap_mutual_password must be present when chap_mutual_username is given and vice-versa.
Note: chap_mutual_username and chap_mutual_password can be used only when chap_single_username and chap_single_password are present.

Example Usage

# Commands to run this tf file : terraform init && terraform plan && terraform apply
# Create, Update, Delete is supported for this resource
# To import , check host_import.tf for more info
# name, os_type and initiators are the required attributes to create and update
# description and host_connectivity are the optional attributes
# To check which attributes of the host resource can be updated, please refer Product Guide in the documentation

resource "powerstore_host" "test" {
  name              = "new-host1"
  os_type           = "Linux"
  description       = "Creating host"
  host_connectivity = "Local_Only"
  initiators        = [{ port_name = "iqn.1994-05.com.redhat:88cb605"}]
}

Schema

Required

  • initiators (Attributes Set) Parameters for creating or adding initiators to host. (see below for nested schema)
  • name (String) Name of the host. This should be unique across all hosts in the cluster.
  • os_type (String) Operating system of the host. This cannot be updated

Optional

  • description (String) Description of the host.
  • host_connectivity (String) Connectivity type for hosts and host groups.

Read-Only

  • host_group_id (String) Associated host group, if host is part of host group.
  • id (String) The unique identifier of the host.

Nested Schema for initiators

Required:

  • port_name (String) IQN name aka address or NQN name for NVMEoF port types.

Optional:

  • chap_mutual_password (String, Sensitive) Password for CHAP authentication. This value must be 12 to 64 UTF-8 characters. This password cannot be queried. CHAP password is required when the cluster CHAP mode is mutual authentication.
  • chap_mutual_username (String) Username for CHAP authentication. This value must be 1 to 64 UTF-8 characters. CHAP username is required when the cluster CHAP mode is mutual authentication.
  • chap_single_password (String, Sensitive) Password for CHAP authentication. This value must be 12 to 64 UTF-8 characters. This password cannot be queried. CHAP password is required when the cluster CHAP mode is single authentication.
  • chap_single_username (String) Username for CHAP authentication. This value must be 1 to 64 UTF-8 characters. CHAP username is required when the cluster CHAP mode is single authentication.

Read-Only:

  • port_type (String) Protocol type of the host initiator.

Import

Import is supported using the following syntax:

# Below are the steps to import host :
# Step 1 - To import a host , we need the id of that host
# Step 2 - To check the id of the host we can make Get request to host endpoint. eg. https://10.0.0.1/api/rest/host which will return list of all host ids.
# Step 3 - Add empty resource block in tf file.
# eg.
# resource "powerstore_host" "resource_block_name" {
  # (resource arguments)
# }
# Step 4 - Execute the command: terraform import "powerstore_host.resource_block_name" "id_of_the_host" (resource_block_name must be taken from step 3 and id must be taken from step 2)
# Step 5 - After successful execution of the command , check the state file