-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added validation for network pool/rule ds * added doc for synciq + async * added synciq workflow guide * add key values for action * removed root path in example
- Loading branch information
1 parent
e2e08ff
commit 92635dd
Showing
8 changed files
with
390 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
# 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. | ||
page_title: "Adding Asynchronous Operations" | ||
title: "Adding Asynchronous Operations" | ||
linkTitle: "Addding Asynchronous Operations" | ||
--- | ||
|
||
# Terraform Internal Behaviour | ||
Terraform's concurrent execution capabilities allow multiple operations to run in parallel, each thread responsible for managing the lifecycle of a resource. However, even with this parallel execution, each individual thread must still execute its operations in a synchronous manner. By default, Terraform's create, update, and delete operations wait for a resource to reach its expected lifecycle state before proceeding with the next step. | ||
|
||
For instance, when a resource is in the creation phase, Terraform will not advance to the subsequent step until the resource has successfully reached the completion phase. In scenarios where platform operations are performed asynchronously, which can result in extended creation times, Terraform will wait for the resource to reach the completion phase before proceeding, thereby introducing a delay in the overall workflow. | ||
|
||
# Consideration for Asynchronous Operations In Terraform | ||
When utilizing Terraform, it is essential to consider the implications of asynchronous operations of the platform. To ensure seamless automation, this guide provides recommendations for resources that support asynchronous operations, enabling users to effectively integrate these features into their infrastructure provisioning workflows. | ||
|
||
1. The state file doesn't have the full information of the resource because the resource is not yet created. | ||
2. The resource's stage must be refreshed to get its full information, including whether the resource failed to be created. | ||
3. Terraform does not check the stage of a resource again after initiating its creation or deletion. Failed operations are only shown in subsequent refreshes of the resource. | ||
4. The asynchronous resource must have no dependencies, because the resource is not fully created before another operation begins. | ||
|
||
# List of Asynchronous Resources | ||
1. SyncIQ replication Job | ||
2. Snapshot Restore (Only SnapRevert Operation) | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
--- | ||
# 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. | ||
page_title: "SyncIQ Workflow", | ||
title: "SyncIQ Workflow" | ||
linkTitle: "SyncIQ Workflow" | ||
--- | ||
|
||
|
||
SyncIQ Workflow Explanation | ||
|
||
SyncIQ is a data management solution that helps manage data movement between different locations. The workflow involves enabling the SyncIQ service, creating a SyncIQ policy, creating a replication job from the policy, and monitoring the job's status using a replication report. | ||
|
||
Step 1: Enable SyncIQ Service | ||
|
||
To begin, the SyncIQ service needs to be enabled. This is done using the powerscale_synciq_global_settings resource in Terraform. The service parameter is set to "on" to enable the service. | ||
|
||
``` | ||
### Make sure SyncIQ service is enabled | ||
resource "powerscale_synciq_global_settings" "enable_synciq" { | ||
service = "on" | ||
} | ||
``` | ||
Step 2: Create SyncIQ Policy | ||
|
||
Next, a SyncIQ policy needs to be created. A policy defines the rules for data movement, such as the source and target locations, and the action to take (e.g., sync). In this example, a policy named policy1 is created with the following settings: | ||
|
||
- action is set to "sync" to synchronize data between the source and target locations. | ||
- source_root_path is set to "/ifs" to specify the source location. | ||
- target_host is set to "10.10.10.10" to specify the target location. | ||
- target_path is set to "/ifs/policy1Sink" to specify the target path. | ||
|
||
``` | ||
### Create SyncIQ policy with action sync | ||
resource "powerscale_synciq_policy" "policy1" { | ||
name = "policy1" | ||
action = "sync" # action can be sync or copy | ||
source_root_path = "/ifs/Source" | ||
target_host = "10.10.10.10" | ||
target_path = "/ifs/policy1Sink" | ||
} | ||
``` | ||
|
||
Step 3: Create Replication Job | ||
|
||
A replication job is created from the SyncIQ policy using the powerscale_synciq_replication_job resource. The job is configured to run the policy (identified by the id parameter) and is not paused (i.e., is_paused is set to false). | ||
``` | ||
### Create replication job from SyncIQ policy | ||
resource "powerscale_synciq_replication_job" "job1" { | ||
action = "run" # action can be run, test, resync_prep, allow_write or allow_write_revert | ||
id = "policy1" | ||
is_paused = false | ||
} | ||
``` | ||
Step 4: Monitor Replication Job Status | ||
|
||
To monitor the status of the replication job, a replication report can be used. The powerscale_synciq_replication_report resource is used to filter the report to show only the replication job with the name Policy1. | ||
|
||
``` | ||
### Use replication report to view the status of the job | ||
data "powerscale_synciq_replication_report" "filtering" { | ||
filter { | ||
policy_name = "Policy1" | ||
} | ||
} | ||
``` | ||
By following these steps, SyncIQ can be used to manage data movement between different locations and monitor the status of the replication jobs. | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
examples/resources/powerscale_synciq_replication_job/provider.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
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. | ||
*/ | ||
|
||
terraform { | ||
required_providers { | ||
powerscale = { | ||
source = "registry.terraform.io/dell/powerscale" | ||
} | ||
} | ||
} | ||
|
||
provider "powerscale" { | ||
username = var.username | ||
password = var.password | ||
endpoint = var.endpoint | ||
insecure = var.insecure | ||
} |
29 changes: 29 additions & 0 deletions
29
examples/resources/powerscale_synciq_replication_job/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
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. | ||
*/ | ||
|
||
# Available actions: Create and Update updates the syncIQ Replication Job. Delete will delete job and clear the state file. | ||
# After `terraform apply` of this example file will perform action on the synciq replicaiton job according to the attributes set in the config | ||
|
||
# PowerScale SynIQ Replication Job allows you to manage the SyncIQ Replication Jobs on the Powerscale array | ||
resource "powerscale_synciq_replication_job" "job1" { | ||
action = "run" # action can be run, test, resync_prep, allow_write or allow_write_revert | ||
id = "TerraformPolicy" # id/name of the synciq policy, use synciq policy resource to create policy. | ||
is_paused = false # change job state to running or paused. | ||
} | ||
|
||
# There are other attributes values as well. Please refer the documentation. | ||
# After the execution of above resource block, job would have been extecuted/updated on the PowerScale array. For more information, Please check the terraform state file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
# 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. | ||
page_title: "Adding Asynchronous Operations" | ||
title: "Adding Asynchronous Operations" | ||
linkTitle: "Addding Asynchronous Operations" | ||
--- | ||
|
||
# Terraform Internal Behaviour | ||
Terraform's concurrent execution capabilities allow multiple operations to run in parallel, each thread responsible for managing the lifecycle of a resource. However, even with this parallel execution, each individual thread must still execute its operations in a synchronous manner. By default, Terraform's create, update, and delete operations wait for a resource to reach its expected lifecycle state before proceeding with the next step. | ||
|
||
For instance, when a resource is in the creation phase, Terraform will not advance to the subsequent step until the resource has successfully reached the completion phase. In scenarios where platform operations are performed asynchronously, which can result in extended creation times, Terraform will wait for the resource to reach the completion phase before proceeding, thereby introducing a delay in the overall workflow. | ||
|
||
# Consideration for Asynchronous Operations In Terraform | ||
When utilizing Terraform, it is essential to consider the implications of asynchronous operations of the platform. To ensure seamless automation, this guide provides recommendations for resources that support asynchronous operations, enabling users to effectively integrate these features into their infrastructure provisioning workflows. | ||
|
||
1. The state file doesn't have the full information of the resource because the resource is not yet created. | ||
2. The resource's stage must be refreshed to get its full information, including whether the resource failed to be created. | ||
3. Terraform does not check the stage of a resource again after initiating its creation or deletion. Failed operations are only shown in subsequent refreshes of the resource. | ||
4. The asynchronous resource must have no dependencies, because the resource is not fully created before another operation begins. | ||
|
||
# List of Asynchronous Resources | ||
1. SyncIQ replication Job | ||
2. Snapshot Restore (Only SnapRevert Operation) | ||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.