Skip to content

Commit a1d532d

Browse files
Merge pull request #261527 from b-ahibbard/terraform-az
terraform-managed volume for az placement
2 parents 1190301 + 5e968bf commit a1d532d

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

articles/azure-netapp-files/manage-availability-zone-volume-placement.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ You can deploy new volumes in the logical availability zone of your choice. You
3636

3737
[!INCLUDE [Availability Zone volumes have the same level of support as other volumes in the subscription](includes/availability-zone-service-callout.md)]
3838

39+
>[!IMPORTANT]
40+
>It's not recommended that you use availability zones for Terraform-managed volumes. If you do, you must [add the zone property to your volume](#populate-availability-zone-for-terraform-managed-volumes).
41+
3942
## Create a volume with an availability zone
4043

4144
1. Select **Volumes** from your capacity pool. Then select **+ Add volume** to create a volume.
@@ -84,13 +87,35 @@ You can deploy new volumes in the logical availability zone of your choice. You
8487
1. Navigate to the volume that you want to populate with availability zone information.
8588
1. Select **Populate availability zone**.
8689
1. The Populate Availability Zone window appears and displays the availability zone in which the Azure NetApp Files volume is deployed.
87-
1. Click **Save** if you want to populate this availability zone to the volume, or click **Cancel** if you want to keep the volume regional.
90+
1. Select **Save** if you want to populate this availability zone to the volume, or select **Cancel** if you want to keep the volume regional.
8891
8992
> [!IMPORTANT]
9093
> Availability zone information can only be populated as provided. You can't select an availability zone or move the volume to another availability zone by using this feature. If you want to move this volume to another availability zone, consider using [cross-zone replication](create-cross-zone-replication.md) (after populating the volume with the availability zone information).
9194
>
9295
> :::image type="content" source="../media/azure-netapp-files/populate-availability-zone.png" alt-text="Screenshot of the Populate Availability Zone window." lightbox="../media/azure-netapp-files/populate-availability-zone.png":::
96+
97+
## Populate availability zone for Terraform-managed volumes
98+
99+
The populate availability zone features requires a `zone` property on the volume. You can set the zone property only when you create the Terraform-managed volume, but you cannot modify it. Adding the `zone` property after the volume has been created can cause data loss or loss of the volume if the specified zone value does not match the availability zone.
100+
101+
1. Navigate to the Terraform module `terraform.tfstate`. The `"zone"` property should be an empty string.
102+
1. In the Terraform-managed volume's configuration file (`main.tf`), locate the lifecycle configuration block. Modify the block with `ignore_changes = [zone]`. If no lifecycle configuration block exists, add it:
103+
```
104+
lifecycle {
105+
ignore_changes = [zone]
106+
}
107+
```
108+
1. In the Azure portal, locate the Terraform module. In the volume **Overview**, select **Populate availability zone** and make note of the availability zone. Do _not_ select save.
109+
110+
:::image type="content" source="../media/azure-netapp-files/populate-availability-zone.png" alt-text="Screenshot of the Populate Availability Zone menu." lightbox="../media/azure-netapp-files/populate-availability-zone.png":::
93111
112+
1. In the volume's configuration file (`main.tf`), add a value for `zone`, entering the numerical value you retrieved in the previous step. For example, if the volume's availability zone is 2, enter `zone = 2`. Save the file.
113+
1. Return to the Azure portal. Select **Save** to populate the availability zone.
114+
1. Run `terraform plan` to confirm that no changes will be made to your volume. The CLI output should display: `No changes. Your infrastructure matches the configuration.`
115+
1. Run `terraform apply` to apply the changes. You should see the same CLI output as in the previous step.
116+
117+
If you need to delete and recreate the volume in a different availability zone, remove the `ignore_changes = [zone]` line in the configuration file then run `terraform plan`. If the output indicates that no changes will be made to the volume, you can successfully populate the availability zone.
118+
94119
## Next steps
95120
96121
* [Use availability zones for high availability](use-availability-zones.md)

articles/azure-netapp-files/use-availability-zones.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Azure NetApp Files' [availability zone volume placement](manage-availability-zon
3232

3333
[!INCLUDE [Availability Zone volumes have the same level of support as other volumes in the subscription](includes/availability-zone-service-callout.md)]
3434

35-
All Virtual Machines within the region in (peered) VNets can access all Azure NetApp Files resources (blue arrows). Virtual Machines accessing Azure NetApp Files volumes in the same zone (green arrows) share the availability zone failure domain.
35+
All virtual machines (VMs) within the region in (peered) VNets can access all Azure NetApp Files resources (blue arrows). VMs accessing Azure NetApp Files volumes in the same zone (green arrows) share the availability zone failure domain.
3636

3737
Azure NetApp Files deployments will occur in the availability of zone of choice if Azure NetApp Files is present in that availability zone and has sufficient capacity.
3838

@@ -43,6 +43,9 @@ You can co-locate your compute, storage, networking, and data resources across a
4343

4444
Latency is subject to availability zone latency for within availability zone access and the regional latency envelope for cross-availability zone access.
4545

46+
>[!IMPORTANT]
47+
>It's not recommended that you use availability zones with Terraform-managed volumes. If you do, you must [add the zone property to your volume](manage-availability-zone-volume-placement.md#populate-availability-zone-for-terraform-managed-volumes).
48+
4649
## Azure regions with availability zones
4750

4851
For a list of regions that currently support availability zones, see [Azure regions with availability zone support](../reliability/availability-zones-service-support.md).

0 commit comments

Comments
 (0)