title | linkTitle | page_title | subcategory | description |
---|---|---|---|---|
powerstore_hostgroup resource |
powerstore_hostgroup |
powerstore_hostgroup Resource - powerstore |
This resource is used to manage the host group entity of PowerStore Array. We can Create, Update and Delete the host group using this resource. We can also import an existing host group from PowerStore array. |
This resource is used to manage the host group entity of PowerStore Array. We can Create, Update and Delete the host group using this resource. We can also import an existing host group from PowerStore array.
~> Note: Exactly one of host_ids
and host_names
is required.
~> Note: host_connectivity
cannot be used while creating host group resource but it can be used while updating the host group resource.
/*
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_group_import.tf for more info
# name and host_ids are the required attributes to create and update
# description is the optional attribute
# Host datasource can be used to fetch host id/name.
# To check which attributes of the host resource can be updated, please refer Product Guide in the documentation
resource "powerstore_hostgroup" "test" {
name = "test_hostgroup"
description = "Creating host group"
host_ids = ["42c60954-ea71-4b50-b172-63880cd48f99"]
}
After the execution of above resource block, host group would have been created on the PowerStore array. For more information, Please check the terraform state file.
name
(String) The host group name.
description
(String) An optional description for the host group.host_connectivity
(String) Connectivity type for hosts and host groups.host_ids
(Set of String) The list of host IDs to include in the host group. Conflicts withhost_names
.host_names
(Set of String) The list of host names to include in the host group. Conflicts withhost_ids
.
id
(String) Unique identifier of the host group.
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 group :
# Step 1 - To import a host group, we need the id of that host group
# Step 2 - To check the id of the host group we can make use of host group datasource to read required/all host group ids. Alternatively, we can make Get request to host group endpoint. eg. https://10.0.0.1/api/rest/host_group which will return list of all host group ids.
# Step 3 - Add empty resource block in tf file.
# eg.
# resource "powerstore_hostgroup" "resource_block_name" {
# (resource arguments)
# }
# Step 4 - Execute the command: terraform import "powerstore_hostgroup.resource_block_name" "id_of_the_hostgroup" (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