-
Notifications
You must be signed in to change notification settings - Fork 3.4k
CLI for Netapp volume version convention from nfsv3 to nfsv4 issue #33037
Description
From our official document https://learn.microsoft.com/en-us/azure/azure-netapp-files/convert-nfsv3-nfsv41
If we convert from portal, there is no other additional steps to do.
However if we try with CLI, we need to manually add the Export Policy value. The following is how I reproduce the issue:
without debug option
tong [ ~ ]$ az netappfiles volume update -g netapp --account-name anf --pool-name test --name nfs3to4 --protocol-types NFSv4.1
(InvalidExportPolicyRule) Protocol type NFSv4.1 must have at least one export policy rule that does not contain NFSv3 as true
Code: InvalidExportPolicyRule
Message: Protocol type NFSv4.1 must have at least one export policy rule that does not contain NFSv3 as true
with debug:
az netappfiles volume update -g netapp --account-name anf --pool-name test --name nfs3to4 --protocol-types NFSv4.1 --debug
Error:
Message: Protocol type NFSv4.1 must have at least one export policy rule that does not contain NFSv3 as true
cli.azure.cli.core.azclierror: (InvalidExportPolicyRule) Protocol type NFSv4.1 must have at least one export policy rule that does not contain NFSv3 as true
Code: InvalidExportPolicyRule
Message: Protocol type NFSv4.1 must have at least one export policy rule that does not contain NFSv3 as true
az_command_data_logger: (InvalidExportPolicyRule) Protocol type NFSv4.1 must have at least one export policy rule that does not contain NFSv3 as true
Code: InvalidExportPolicyRule
Message: Protocol type NFSv4.1 must have at least one export policy rule that does not contain NFSv3 as true
How I mitigate this issue:
I manually add the export policy rule
az netappfiles volume update
--resource-group netapp
--account-name anf
--pool-name test
--name nfs3to4
--protocol-types NFSv4.1
--export-policy-rules '[
{
"ruleIndex": 1,
"allowedClients": "0.0.0.0/0",
"nfsv3": false,
"nfsv41": true,
"unixReadWrite": true,
"unixReadOnly": false,
"kerberos5ReadOnly": false,
"kerberos5ReadWrite": false,
"kerberos5iReadOnly": false,
"kerberos5iReadWrite": false,
"kerberos5pReadOnly": false,
"kerberos5pReadWrite": false,
"cifs": false,
"hasRootAccess": true
}
]'
My ask: Can we make this command be easier just like the portal and explain it from code level