Skip to content

Commit d3188e2

Browse files
authored
feat!: (IAC-1021) NFS version default updated to 4.1 (#325)
1 parent 0625151 commit d3188e2

File tree

6 files changed

+46
-13
lines changed

6 files changed

+46
-13
lines changed

docs/CONFIG-VARS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ When `storage_type=ha` (high availability), [Microsoft Azure NetApp Files](https
315315
| :--- | ---: | ---: | ---: | ---: |
316316
| netapp_service_level | The target performance level of the file system. Valid values include Premium, Standard, or Ultra. | string | "Premium" | |
317317
| netapp_size_in_tb | Provisioned size of the pool in TB. Value must be between 4 and 500 | number | 4 | |
318-
| netapp_protocols | The target volume protocol expressed as a list. Supported single value include CIFS, NFSv3, or NFSv4.1. If argument is not defined, it defaults to NFSv3. Changing this forces a new resource to be created and data will be lost. | list of strings | ["NFSv3"] | |
318+
| netapp_protocols | The target volume protocol expressed as a list. Supported single value include CIFS, NFSv3, or NFSv4.1. If argument is not defined, it defaults to NFSv4.1. Changing this forces a new resource to be created and data will be lost. | list of strings | ["NFSv4.1"] | |
319319
| netapp_volume_path |A unique file path for the volume. Used when creating mount targets. Changing this forces a new resource to be created. | string | "export" | |
320320
| netapp_network_features |Indicates which network feature to use, accepted values are `Basic` or `Standard`, it defaults to `Basic` if not defined. | string | "Basic" | This is a feature in public preview. For more information about it and how to register, please refer to [Configure network features for an Azure NetApp Files volume](https://docs.microsoft.com/en-us/azure/azure-netapp-files/configure-network-features)|
321321

docs/Troubleshooting.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
# Troubleshooting
22

3+
- [Troubleshooting](#troubleshooting)
4+
- [Kubernetes Version is not supported in Azure region](#kubernetes-version-is-not-supported-in-azure-region)
5+
- [Failure to delete AKS Node Pool](#failure-to-delete-aks-node-pool)
6+
- [Import Azure Resource into Terraform state](#import-azure-resource-into-terraform-state)
7+
- [Not able to access AKS with kubectl](#not-able-to-access-aks-with-kubectl)
8+
- [Azure NetApp Files creation fails](#azure-netapp-files-creation-fails)
9+
- [Azure NetApp NFSv3 volume file lock issue](#azure-netapp-nfsv3-volume-file-lock-issue)
10+
311
## Kubernetes Version is not supported in Azure region
412
```bash
513
Error: creating Managed Kubernetes Cluster "viya-tst-aks" (Resource Group "viya-tst-rg"): containerservice.ManagedClustersClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="AgentPoolK8sVersionNotSupported" Message="Version 1.18.14 is not supported in this region. Please use [az aks get-versions] command to get the supported version list in this region. For more information, please check https://aka.ms/supported-version-list"
614

715
on modules/azure_aks/main.tf line 2, in resource "azurerm_kubernetes_cluster" "aks":
816
2: resource "azurerm_kubernetes_cluster" "aks" {
917
```
10-
**Resolution:**
18+
### Resolution:
1119
Run this Azure CLI command to get the supported Kubernetes versions in your Azure region and use value for `kubernetes_version` variable in input tfvars.
1220
```bash
1321
az aks get-versions --location <YOUR_AZURE_LOCATION> --output table
@@ -29,7 +37,7 @@ Error: waiting for the deletion of Node Pool "stateful" (Managed Kubernetes Clus
2937
Error: A resource with the ID "/subscriptions/REDACTED/resourcegroups/viya-tst-rg/providers/Microsoft.ContainerService/managedClusters/viya-tst-aks/agentPools/stateless" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_kubernetes_cluster_node_pool" for more information.
3038
```
3139
32-
**Resolution:**
40+
### Resolution:
3341
3442
```bash
3543
terraform import -var-file=sample-input.tfvars module.aks.azurerm_kubernetes_cluster.aks '/subscription/REDACTED/../../'
@@ -44,7 +52,7 @@ Error: authorization.RoleAssignmentsClient#Create: Failure responding to request
4452
18: resource "azurerm_role_assignment" "acr" {
4553
```
4654
47-
**Resolution:**
55+
### Resolution:
4856
Check values of environment variables - `ARM_* and TF_*`
4957
5058
## Azure NetApp Files creation fails
@@ -57,5 +65,25 @@ Error: Error creating NetApp Account "sse-vdsdp-ha1-netappaccount" (Resource Gro
5765
29: resource "azurerm_netapp_account" "anf" {
5866
```
5967
60-
**Resolution:**
68+
### Resolution:
6169
Check your Azure Subscription has been granted access to Azure NetApp Files service: [Azure Netapp Quickstart](https://docs.microsoft.com/en-us/azure/azure-netapp-files/azure-netapp-files-quickstart-set-up-account-create-volumes?tabs=azure-portal#before-you-begin)
70+
71+
72+
## Azure NetApp NFSv3 volume file lock issue
73+
In event of SAS Viya Platform deployment shutdown on an AKS cluster with Azure NetApp NFSv3 volume, the file locks persist and `sas-consul-server` cannot access raft.db until the file locks are broken.
74+
75+
### Resolution:
76+
There are two options to avoid this issue:
77+
78+
1. Break the file locks from Azure Portal. For details see [Troubleshoot file locks on an Azure NetApp Files volume](https://learn.microsoft.com/en-us/azure/azure-netapp-files/troubleshoot-file-locks).
79+
80+
2. Use Azure NetApp NFS volume version 4.1. Update to the latest version of `sassoftware/viya4-iac-azure` to use NFSv4.1 by default. If you are using sassoftware/viya4-iac-azure's release v7.2.0 or before, then add the variable `netapp_protocols` to your terraform.tfvars to switch to NFSv4.1.
81+
82+
**Note:** Changing this on existing cluster will result in data loss.
83+
84+
Example:
85+
```bash
86+
# Storage HA
87+
storage_type = "ha"
88+
netapp_protocols = ["NFSv4.1"]
89+
```

files/cloud-init/nfs/cloud-config

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,13 @@ runcmd:
5858
#
5959
- if [ "${aks_cidr_block}" != "${misc_cidr_block}" ]
6060
- then
61-
- echo "/export ${aks_cidr_block}(rw,no_root_squash,async,insecure,fsid=0,crossmnt,no_subtree_check)" >> /etc/exports
62-
- echo "/export ${misc_cidr_block}(rw,no_root_squash,async,insecure,fsid=0,crossmnt,no_subtree_check)" >> /etc/exports
61+
- echo "/ ${aks_cidr_block}(ro,fsid=0)" >> /etc/exports
62+
- echo "/ ${misc_cidr_block}(ro,fsid=0)" >> /etc/exports
63+
- echo "/export ${aks_cidr_block}(rw,no_root_squash,async,insecure,crossmnt,no_subtree_check)" >> /etc/exports
64+
- echo "/export ${misc_cidr_block}(rw,no_root_squash,async,insecure,crossmnt,no_subtree_check)" >> /etc/exports
6365
- else
64-
- echo "/export ${aks_cidr_block}(rw,no_root_squash,async,insecure,fsid=0,crossmnt,no_subtree_check)" >> /etc/exports
66+
- echo "/ ${aks_cidr_block}(ro,fsid=0)" >> /etc/exports
67+
- echo "/export ${aks_cidr_block}(rw,no_root_squash,async,insecure,crossmnt,no_subtree_check)" >> /etc/exports
6568
- fi
6669
#
6770
# Restart nfs-server service

modules/azurerm_netapp/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ variable "volume_path" {
5555
}
5656

5757
variable "protocols" {
58-
description = "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."
58+
description = "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 NFSv4.1. Changing this forces a new resource to be created and data will be lost."
5959
type = list(string)
60-
default = ["NFSv3"]
60+
default = ["NFSv4.1"]
6161
}
6262

6363
variable "allowed_clients" {

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,9 +451,9 @@ variable "netapp_size_in_tb" {
451451
}
452452

453453
variable "netapp_protocols" {
454-
description = "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."
454+
description = "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 NFSv4.1. Changing this forces a new resource to be created and data will be lost."
455455
type = list(string)
456-
default = ["NFSv3"]
456+
default = ["NFSv4.1"]
457457
}
458458

459459
variable "netapp_volume_path" {

vms.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ locals {
77
: var.storage_type == "ha" ? module.netapp[0].netapp_endpoint : module.nfs[0].private_ip_address
88
)
99

10+
protocol_version = var.storage_type == "ha" && startswith(var.netapp_protocols[0], "NFS") ? split("v", var.netapp_protocols[0])[1] : "4.1"
11+
1012
rwx_filestore_path = (var.storage_type == "none"
1113
? ""
1214
: var.storage_type == "ha" ? module.netapp[0].netapp_path : "/export"
@@ -19,7 +21,7 @@ locals {
1921
["${local.rwx_filestore_endpoint}:${local.rwx_filestore_path}",
2022
var.jump_rwx_filestore_path,
2123
"nfs",
22-
"_netdev,auto,x-systemd.automount,x-systemd.mount-timeout=10,timeo=14,x-systemd.idle-timeout=1min,relatime,hard,rsize=1048576,wsize=1048576,vers=3,tcp,namlen=255,retrans=2,sec=sys,local_lock=none",
24+
"_netdev,auto,x-systemd.automount,x-systemd.mount-timeout=10,timeo=14,x-systemd.idle-timeout=1min,relatime,hard,rsize=1048576,wsize=1048576,vers=${local.protocol_version},tcp,namlen=255,retrans=2,sec=sys,local_lock=none",
2325
"0",
2426
"0"
2527
])

0 commit comments

Comments
 (0)