powerflex_sds (Resource)
This resource is used to manage the Storage Data Servers entity of the PowerFlex Array. We can Create, Update and Delete the SDS using this resource. We can also import an existing SDS from the PowerFlex array.
Caution: SDS creation or update is not atomic. In case of partially completed create operations, terraform can mark the resource as tainted. One can manually remove the taint and try applying the configuration (after making necessary adjustments). If the taint is not removed, terraform will destroy and recreate the resource.
Note: Either
protection_domain_name
andprotection_domain_id
is required. But not both.
Example Usage
/*
Copyright (c) 2023-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 sds_resource_import.tf for more info
# To create / update, either protection_domain_name or protection_domain_id must be provided
# name and ip_list are the required parameters to create or update
# other atrributes like : performance_profile, port, drl_mode, rmcache_enabled, rfcache_enabled, rmcache_size_in_mb are optional
# To check which attributes can be updated, please refer Product Guide in the documentation
# Example for adding SDS. After successful execution, SDS will be added to the protection domain.
resource "powerflex_sds" "create" {
name = "demo-sds-test-01"
protection_domain_name = "demo-sds-pd"
ip_list = [
{
ip = "10.10.10.12"
role = "sdsOnly" # all/sdsOnly/sdcOnly
},
{
ip = "10.10.10.11"
role = "sdcOnly" # all/sdsOnly/sdcOnly
},
]
}
# Example for adding SDS with fault set. After successful execution, SDS will be added to the protection domain and fault set.
resource "powerflex_fault_set" "test" {
protection_domain_id = "202a046600000000"
name = "demo_fault_set"
}
resource "powerflex_sds" "create" {
name = "demo-sds-test-01"
protection_domain_name = "demo-sds-pd"
fault_set_id = powerflex_fault_set.test.id
ip_list = [
{
ip = "10.10.10.12"
role = "sdsOnly" # all/sdsOnly/sdcOnly
},
{
ip = "10.10.10.11"
role = "sdcOnly" # all/sdsOnly/sdcOnly
},
]
}
output "changed_sds" {
value = powerflex_sds.create
}
After the execution of above resource block, sds would have been created on the PowerFlex array. For more information, please check the terraform state file.
Schema
Required
ip_list
(Attributes Set) List of IPs to be assigned to the SDS. There must be at least one IP withall
role or at least two IPs, one with rolesdcOnly
and the other with rolesdsOnly
. (see below for nested schema)name
(String) Name of SDS.
Optional
drl_mode
(String) DRL mode of SDSfault_set_id
(String) Fault set id of SDSperformance_profile
(String) Performance Profile of SDS. Valid values areCompact
andHighPerformance
. Default value is determined by array settings.port
(Number) Port of SDSprotection_domain_id
(String) ID of the Protection Domain under which the SDS will be created. Conflicts withprotection_domain_name
. Cannot be updated.protection_domain_name
(String) Name of the Protection Domain under which the SDS will be created. Conflicts withprotection_domain_id
. Cannot be updated.rfcache_enabled
(Boolean) Rfcache enabled state of SDSrmcache_enabled
(Boolean) Rmcache enabled state of SDSrmcache_size_in_mb
(Number) Read RAM cache size in MB of SDS. Can be set only whenrmcache_enabled
is true.
Read-Only
id
(String) The id of the SDSis_on_vmware
(Boolean) Is on vmware state of SDSmdm_connection_state
(String) Mdm connection state of SDSmembership_state
(String) Membership state of SDSnum_of_io_buffers
(Number) Number of io buffers of SDSrmcache_frozen
(Boolean) RMcache frozen state of SDSrmcache_memory_allocation_state
(String) Rmcache memory allocation state of SDS.sds_state
(String) State of SDS
Nested Schema for ip_list
Required:
ip
(String) IP address to be assigned to the SDS.role
(String) Role to be assigned to the IP address. Valid values areall
,sdcOnly
andsdsOnly
.
Import
Import is supported using the following syntax:
# /*
# Copyright (c) 2023-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.
# */
# import SDS by it's id
terraform import powerflex_sds.sds_data "<id>"
- This will import the SDS instance with specified ID into your Terraform state.
- After successful import, you can run terraform state list to ensure the resource has been imported successfully.
- Now, you can fill in the resource block with the appropriate arguments and settings that match the imported resource’s real-world configuration.
- Execute terraform plan to see if your configuration and the imported resource are in sync. Make adjustments if needed.
- Finally, execute terraform apply to bring the resource fully under Terraform’s management.
- Now, the resource which was not part of terraform became part of Terraform managed infrastructure.