powerflex_protection_domain (Resource)

This resource is used to manage the Protection Domain entity of PowerFlex Array. We can Create, Update and Delete the protection domain using this resource. We can also import an existing protection domain from PowerFlex array.

Caution: Protection Domain 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.

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.
*/

# Example for creating protection domain. After successful execution, protection domain will be created on the cluster.
resource "powerflex_protection_domain" "pd" {
  # required paramaters  ======

  name = "domain_1"

  # optional parameters  ======

  active = true

  # SDS IOPS throttling
  # overall_io_network_throttling_in_kbps must be greater than the rest of the parameters
  # 0 indicates unlimited IOPS
  protected_maintenance_mode_network_throttling_in_kbps = 10 * 1024
  rebuild_network_throttling_in_kbps                    = 10 * 1024
  rebalance_network_throttling_in_kbps                  = 10 * 1024
  vtree_migration_network_throttling_in_kbps            = 10 * 1024
  overall_io_network_throttling_in_kbps                 = 20 * 1024

  # Fine granularity metadata caching
  fgl_metadata_cache_enabled      = true
  fgl_default_metadata_cache_size = 1024

  # Read Flash cache
  rf_cache_enabled          = true
  rf_cache_operational_mode = "ReadAndWrite" # Read/Write/ReadAndWrite/WriteMiss
  rf_cache_page_size_kb     = 16
  rf_cache_max_io_size_kb   = 32
}

After the execution of above resource block, protection domain would have been created on the PowerFlex array. For more information, please check the terraform state file.

Schema

Required

  • name (String) Unique name of the protection domain instance.

Optional

  • active (Boolean) Whether the PD should be in Active state. Default value is true.
  • fgl_default_metadata_cache_size (Number) Fine Granularity Metadata Cache size. Can be set only when fgl_metadata_cache_enabled is set to true.
  • fgl_metadata_cache_enabled (Boolean) Whether Fine Granularity Metadata Cache is enabled or not.
  • overall_io_network_throttling_in_kbps (Number) Maximum allowed IO for protected maintenance mode in KBps. Must be greater than any other network throttling parameter. The value 0 represents unlimited bandwidth. The default value is 0.
  • protected_maintenance_mode_network_throttling_in_kbps (Number) Maximum allowed IO for protected maintenance mode in KBps. The value 0 represents unlimited bandwidth. The default value is 0.
  • rebalance_network_throttling_in_kbps (Number) Maximum allowed IO for rebalancing in KBps. The value 0 represents unlimited bandwidth. The default value is 0.
  • rebuild_network_throttling_in_kbps (Number) Maximum allowed IO for rebuilding in KBps. The value 0 represents unlimited bandwidth. The default value is 0.
  • rf_cache_enabled (Boolean) Whether SDS Rf Cache is enabled or not. Default value is true.
  • rf_cache_max_io_size_kb (Number) Maximum IO of the SDS RF Cache in KB. Can be set only when rf_cache_enabled is set to true.
  • rf_cache_operational_mode (String) Operational Mode of the SDS RF Cache. Accepted values are Read, Write, ReadAndWrite and WriteMiss. Can be set only when rf_cache_enabled is set to true.
  • rf_cache_page_size_kb (Number) Page size of the SDS RF Cache in KB. Can be set only when rf_cache_enabled is set to true.
  • vtree_migration_network_throttling_in_kbps (Number) Maximum allowed IO for vtree migration in KBps. The value 0 represents unlimited bandwidth. The default value is 0.

Read-Only

  • fgl_default_num_concurrent_writes (Number) Fine Granularity default number of concurrent writes.
  • id (String) Unique identifier of the protection domain instance.
  • links (Attributes List) Underlying REST API links. (see below for nested schema)
  • replication_capacity_max_ratio (Number) Maximum Replication Capacity Ratio.
  • rf_cache_accp_id (String) ID of the RF Cache Acceleration Pool attached to the PD.
  • state (String) State of the PD.

Read-Only:

  • href (String) Specifies the exact path to fetch the details.
  • rel (String) Specifies the relationship with the Protection Domain.

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 Protection Domain by it's id
terraform import powerflex_protection_domain.pd_data "<id>"
  1. This will import the protection domain instance with specified ID into your Terraform state.
  2. After successful import, you can run terraform state list to ensure the resource has been imported successfully.
  3. Now, you can fill in the resource block with the appropriate arguments and settings that match the imported resource’s real-world configuration.
  4. Execute terraform plan to see if your configuration and the imported resource are in sync. Make adjustments if needed.
  5. Finally, execute terraform apply to bring the resource fully under Terraform’s management.
  6. Now, the resource which was not part of terraform became part of Terraform managed infrastructure.