Skip to content

Commit f3f3843

Browse files
Documentation update to fix issue #5871 (#10820)
PR to update documentation for clearer guidance on how to create dual protocol volumes (NFSv3+CIFS) fixes #5871
1 parent 86da175 commit f3f3843

File tree

4 files changed

+82
-3
lines changed

4 files changed

+82
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Example: NetApp Files Volume Dual-Protocol (CIFS+NFSv3) enabled
2+
3+
This example shows how to create an Azure NetApp Files Volume with dual protocol, CIFS and NFSv3.
4+
5+
For more information, please refer to [Create a dual-protocol (NFSv3 and SMB) volume for Azure NetApp Files](https://docs.microsoft.com/en-us/azure/azure-netapp-files/create-volumes-dual-protocol).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
provider "azurerm" {
2+
features {}
3+
}
4+
5+
resource "azurerm_resource_group" "example" {
6+
name = "${var.prefix}-resources"
7+
location = var.location
8+
}
9+
10+
resource "azurerm_netapp_account" "example" {
11+
name = "${var.prefix}-netappaccount"
12+
location = azurerm_resource_group.example.location
13+
resource_group_name = azurerm_resource_group.example.name
14+
15+
active_directory {
16+
username = "pmcadmin"
17+
password = var.password
18+
smb_server_name = "SMBSERVER"
19+
dns_servers = ["10.2.0.4"]
20+
domain = "anf.local"
21+
}
22+
}
23+
24+
resource "azurerm_netapp_pool" "example" {
25+
name = "${var.prefix}-netapppool"
26+
location = azurerm_resource_group.example.location
27+
resource_group_name = azurerm_resource_group.example.name
28+
account_name = azurerm_netapp_account.example.name
29+
service_level = "Standard"
30+
size_in_tb = 4
31+
}
32+
33+
resource "azurerm_netapp_volume" "example" {
34+
lifecycle {
35+
prevent_destroy = true
36+
}
37+
38+
name = "${var.prefix}-netappvolume"
39+
location = azurerm_resource_group.example.location
40+
resource_group_name = azurerm_resource_group.example.name
41+
account_name = azurerm_netapp_account.example.name
42+
pool_name = azurerm_netapp_pool.example.name
43+
volume_path = "${var.prefix}-netappvolume"
44+
service_level = "Standard"
45+
protocols = ["CIFS","NFSv3"]
46+
subnet_id = var.subnet_id
47+
storage_quota_in_gb = 100
48+
49+
export_policy_rule {
50+
rule_index = 1
51+
allowed_clients = ["0.0.0.0/0"]
52+
cifs_enabled = true
53+
nfsv3_enabled = true
54+
nfsv4_enabled = false
55+
unix_read_write = true
56+
}
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
variable "location" {
2+
description = "The Azure location where all resources in this example should be created."
3+
}
4+
5+
variable "prefix" {
6+
description = "The prefix used for all resources used by this NetApp Volume"
7+
}
8+
9+
variable "password" {
10+
description = "User Password to create ActiveDirectory object"
11+
}
12+
13+
variable "subnet_id" {
14+
description = "Subnet id (delegated to Microsoft.Netapp/volumes) to attach the volume to"
15+
}

website/docs/r/netapp_volume.html.markdown

+5-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ resource "azurerm_netapp_volume" "example" {
7878
endpoint_type = "dst"
7979
remote_volume_location = azurerm_resource_group.example_primary.location
8080
remote_volume_resource_id = azurerm_netapp_volume.example_primary.id
81-
replication_frequency = "_10minutely"
81+
replication_frequency = "10minutes"
8282
}
8383
}
8484
```
@@ -101,7 +101,7 @@ The following arguments are supported:
101101

102102
* `service_level` - (Required) The target performance of the file system. Valid values include `Premium`, `Standard`, or `Ultra`.
103103

104-
* `protocols` - (Optional) The target volume protocol expressed as a list. Supported single value include `CIFS`, `NFSv3`, or `NFSv4.1`. If argument is not defined it will default to `NFSv3`. Changing this forces a new resource to be created and data will be lost.
104+
* `protocols` - (Optional) The target volume protocol expressed as a list. Supported single value include `CIFS`, `NFSv3`, or `NFSv4.1`. If argument is not defined it will default to `NFSv3`. Changing this forces a new resource to be created and data will be lost. Dual protocol scenario is supported for CIFS and NFSv3, for more information, please refer to [Create a dual-protocol volume for Azure NetApp Files](https://docs.microsoft.com/en-us/azure/azure-netapp-files/create-volumes-dual-protocol) document.
105105

106106
* `subnet_id` - (Required) The ID of the Subnet the NetApp Volume resides in, which must have the `Microsoft.NetApp/volumes` delegation. Changing this forces a new resource to be created.
107107

@@ -111,7 +111,9 @@ The following arguments are supported:
111111

112112
* `tags` - (Optional) A mapping of tags to assign to the resource.
113113

114-
-> **Note**: It is highly recommended to use the **lifecycle** property as noted in the example since it will prevent an accidental deletion of the volume if the `protocols` argument changes to a different protocol type.
114+
An example on how to create a dual protocol volume can be found at [`./examples/netapp/volume_dual_protocol` directory within the Github Repository](https://github.com/terraform-providers/terraform-provider-azurerm/tree/master/examples/netapp/volume_dual_protocol)
115+
116+
-> **Note**: It is highly recommended to use the **lifecycle** property as noted in the example since it will prevent an accidental deletion of the volume if the `protocols` argument changes to a different protocol type.
115117

116118
---
117119

0 commit comments

Comments
 (0)