title | linkTitle | page_title | subcategory | description |
---|---|---|---|---|
powerstore_host resource |
powerstore_host |
powerstore_host Resource - powerstore |
This resource is used to manage the host entity of PowerStore Array. We can Create, Update and Delete the host using this resource. We can also import an existing host from PowerStore array. |
This resource is used to manage the host entity of PowerStore Array. We can Create, Update and Delete the host using this resource. We can also import an existing host from PowerStore array.
~> 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.
/*
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 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" }]
}
After the execution of above resource block, host would have been created on the PowerStore array. For more information, Please check the terraform state file.
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
description
(String) Description of the host.host_connectivity
(String) Connectivity type for hosts and host groups.
host_group_id
(String) Associated host group, if host is part of host group.id
(String) The unique identifier of the host.
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 is supported using the following syntax:
#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.
# 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