title | description | author | ms.author | ms.service | ms.workload | ms.topic | ms.date | ms.custom |
---|---|---|---|---|---|---|---|---|
Quickstart: Set up Azure NetApp Files and NFS volume |
Quickstart - Describes how to quickly set up Azure NetApp Files and create a volume. |
b-hchen |
anfdocs |
azure-netapp-files |
storage |
quickstart |
10/04/2021 |
devx-track-azurecli, subject-armqs, mode-ui |
This article shows you how to quickly set up Azure NetApp Files and create an NFS volume.
In this quickstart, you will set up the following items:
- Registration for NetApp Resource Provider
- A NetApp account
- A capacity pool
- An NFS volume for Azure NetApp Files
If you don't have an Azure subscription, create a free account before you begin.
To see all features that you can enable for an NFS volume and relevant considerations, see Create an NFS volume.
Note
The registration process can take some time to complete.
For registration steps using Portal, open a Cloud Shell session as indicated above and follow these Azure CLI steps:
[!INCLUDE azure-netapp-files-cloudshell-include]
This how-to article requires the Azure PowerShell module Az version 2.6.0 or later. Run Get-Module -ListAvailable Az
to find your current version. If you need to install or upgrade, see Install Azure PowerShell module. If you prefer, you can use Cloud Shell console in a PowerShell session instead.
-
In a PowerShell command prompt (or PowerShell Cloud Shell session), specify the subscription that has been approved for Azure NetApp Files:
Select-AzSubscription -Subscription <subscriptionId>
-
Register the Azure Resource Provider:
Register-AzResourceProvider -ProviderNamespace Microsoft.NetApp
Prepare your environment for the Azure CLI.
[!INCLUDE azure-cli-prepare-your-environment-no-header.md]
[!INCLUDE azure-netapp-files-cloudshell-include]
None.
Use the Azure portal, PowerShell, or the Azure CLI to register for NetApp Resource Provider.
-
In the Azure portal's search box, enter Azure NetApp Files and then select Azure NetApp Files from the list that appears.
-
Click + Create to create a new NetApp account.
-
In the New NetApp Account window, provide the following information:
-
Click Create to create your new NetApp account.
-
Define some variables so we can refer to them throughout the rest of the examples:
$resourceGroup = "myRG1" $location = "eastus" $anfAccountName = "myaccount1"
[!NOTE] Please refer to Products available by region for a list of supported regions. To obtain the region name that is supported by our command line tools, please use
Get-AzLocation | select Location
-
Create a new resource group by using the New-AzResourceGroup command:
New-AzResourceGroup -Name $resourceGroup -Location $location
-
Create Azure NetApp Files account with New-AzNetAppFilesAccount command:
New-AzNetAppFilesAccount -ResourceGroupName $resourceGroup -Location $location -Name $anfAccountName
-
Define some variables so we can refer to them throughout the rest of the examples:
RESOURCE_GROUP="myRG1" LOCATION="eastus" ANF_ACCOUNT_NAME="myaccount1"
[!NOTE] Please refer to Products available by region for a list of supported regions. To obtain the region name that is supported by our command line tools, please use
az account list-locations --query "[].{Region:name}" --out table
-
Create a new resource group by using the az group create command:
az group create \ --name $RESOURCE_GROUP \ --location $LOCATION
-
Create Azure NetApp Files account with az netappfiles account create command:
az netappfiles account create \ --resource-group $RESOURCE_GROUP \ --location $LOCATION \ --account-name $ANF_ACCOUNT_NAME
[!INCLUDE About Azure Resource Manager]
The following code snippet shows how to create a NetApp account in an Azure Resource Manager template (ARM template), using the Microsoft.NetApp/netAppAccounts resource. To run the code, download the full ARM template from our GitHub repo.
:::code language="json" source="~/quickstart-templates/quickstarts/microsoft.netapp/anf-nfs-volume/azuredeploy.json" range="177-183":::
-
From the Azure NetApp Files management blade, select your NetApp account (myaccount1).
-
From the Azure NetApp Files management blade of your NetApp account, click Capacity pools.
-
Click + Add pools.
-
Provide information for the capacity pool:
- Enter mypool1 as the pool name.
- Select Premium for the service level.
- Specify 4 (TiB) as the pool size.
- Use the Auto QoS type.
-
Click Create.
-
Defining some new variables for future reference
$poolName = "mypool1" $poolSizeBytes = 4398046511104 # 4TiB $serviceLevel = "Premium" # Valid values are Standard, Premium and Ultra
-
Create a new capacity pool by using the New-AzNetAppFilesPool
New-AzNetAppFilesPool -ResourceGroupName $resourceGroup -Location $location -AccountName $anfAccountName -Name $poolName -PoolSize $poolSizeBytes -ServiceLevel $serviceLevel
-
Defining some new variables for future reference
POOL_NAME="mypool1" POOL_SIZE_TiB=4 # Size in Azure CLI needs to be in TiB unit (minimum 4 TiB) SERVICE_LEVEL="Premium" # Valid values are Standard, Premium and Ultra
-
Create a new capacity pool by using the az netappfiles pool create
az netappfiles pool create \ --resource-group $RESOURCE_GROUP \ --location $LOCATION \ --account-name $ANF_ACCOUNT_NAME \ --pool-name $POOL_NAME \ --size $POOL_SIZE_TiB \ --service-level $SERVICE_LEVEL
The following code snippet shows how to create a capacity pool in an Azure Resource Manager template (ARM template), using the Microsoft.NetApp/netAppAccounts/capacityPools resource. To run the code, download the full ARM template from our GitHub repo.
:::code language="json" source="~/quickstart-templates/quickstarts/microsoft.netapp/anf-nfs-volume/azuredeploy.json" range="184-196":::
-
From the Azure NetApp Files management blade of your NetApp account, click Volumes.
-
Click + Add volume.
-
In the Create a Volume window, provide information for the volume:
-
Enter myvol1 as the volume name.
-
Select your capacity pool (mypool1).
-
Use the default value for quota.
-
Under virtual network, click Create new to create a new Azure virtual network (Vnet). Then fill in the following information:
- Enter myvnet1 as the Vnet name.
- Specify an address space for your setting, for example, 10.7.0.0/16
- Enter myANFsubnet as the subnet name.
- Specify the subnet address range, for example, 10.7.0.0/24. You cannot share the dedicated subnet with other resources.
- Select Microsoft.NetApp/volumes for subnet delegation.
- Click OK to create the Vnet.
-
In subnet, select the newly created Vnet (myvnet1) as the delegate subnet.
-
-
Click Protocol, and then complete the following actions:
- Select NFS as the protocol type for the volume.
- Enter myfilepath1 as the file path that will be used to create the export path for the volume.
- Select the NFS version (NFSv3 or NFSv4.1) for the volume. See considerations and best practice about NFS versions.
-
Click Review + create to display information for the volume you are creating.
-
Click Create to create the volume. The created volume appears in the Volumes blade.
-
Create a subnet delegation to "Microsoft.NetApp/volumes" with New-AzDelegation command.
$anfDelegation = New-AzDelegation -Name ([guid]::NewGuid().Guid) -ServiceName "Microsoft.NetApp/volumes"
-
Create a subnet configuration by using New-AzVirtualNetworkSubnetConfig command.
$subnet = New-AzVirtualNetworkSubnetConfig -Name "myANFSubnet" -AddressPrefix "10.7.0.0/24" -Delegation $anfDelegation
-
Create the virtual network by using the New-AzVirtualNetwork command.
$vnet = New-AzVirtualNetwork -Name "myvnet1" -ResourceGroupName $resourceGroup -Location $location -AddressPrefix "10.7.0.0/16" -Subnet $subnet
-
Create the volume by using the New-AzNetAppFilesVolume command.
$volumeSizeBytes = 1099511627776 # 100GiB $subnetId = $vnet.Subnets[0].Id New-AzNetAppFilesVolume -ResourceGroupName $resourceGroup ` -Location $location ` -AccountName $anfAccountName ` -PoolName $poolName ` -Name "myvol1" ` -UsageThreshold $volumeSizeBytes ` -SubnetId $subnetId ` -CreationToken "myfilepath1" ` -ServiceLevel $serviceLevel ` -ProtocolType NFSv3
-
Defining some variables for later usage.
VNET_NAME="myvnet1" SUBNET_NAME="myANFSubnet"
-
Create virtual network without subnet by using the az network vnet create command.
az network vnet create \ --resource-group $RESOURCE_GROUP \ --name $VNET_NAME \ --location $LOCATION \ --address-prefix "10.7.0.0/16"
-
Create a delegated subnet by using az network vnet subnet create command.
az network vnet subnet create \ --resource-group $RESOURCE_GROUP \ --vnet-name $VNET_NAME \ --name $SUBNET_NAME \ --address-prefixes "10.7.0.0/24" \ --delegations "Microsoft.NetApp/volumes"
-
Create the volume by using the az netappfiles volume create command.
VNET_ID=$(az network vnet show --resource-group $RESOURCE_GROUP --name $VNET_NAME --query "id" -o tsv) SUBNET_ID=$(az network vnet subnet show --resource-group $RESOURCE_GROUP --vnet-name $VNET_NAME --name $SUBNET_NAME --query "id" -o tsv) VOLUME_SIZE_GiB=100 # 100 GiB UNIQUE_FILE_PATH="myfilepath2" # Please note that creation token needs to be unique within subscription and region az netappfiles volume create \ --resource-group $RESOURCE_GROUP \ --location $LOCATION \ --account-name $ANF_ACCOUNT_NAME \ --pool-name $POOL_NAME \ --name "myvol1" \ --service-level $SERVICE_LEVEL \ --vnet $VNET_ID \ --subnet $SUBNET_ID \ --usage-threshold $VOLUME_SIZE_GiB \ --file-path $UNIQUE_FILE_PATH \ --protocol-types "NFSv3"
The following code snippets show how to set up a VNet and create an Azure NetApp Files volume in an Azure Resource Manager template (ARM template). VNet setup uses the Microsoft.Network/virtualNetworks resource. Volume creation uses the Microsoft.NetApp/netAppAccounts/capacityPools/volumes resource. To run the code, download the full ARM template from our GitHub repo.
:::code language="json" source="~/quickstart-templates/quickstarts/microsoft.netapp/anf-nfs-volume/azuredeploy.json" range="148-176":::
:::code language="json" source="~/quickstart-templates/quickstarts/microsoft.netapp/anf-nfs-volume/azuredeploy.json" range="197-229":::
When you are done and if you want to, you can delete the resource group. The action of deleting a resource group is irreversible.
Important
All resources within the resource groups will be permanently deleted and cannot be undone.
-
In the Azure portal's search box, enter Azure NetApp Files and then select Azure NetApp Files from the list that appears.
-
In the list of subscriptions, click the resource group (myRG1) you want to delete.
-
In the resource group page, click Delete resource group.
A window opens and displays a warning about the resources that will be deleted with the resource group.
-
Enter the name of the resource group (myRG1) to confirm that you want to permanently delete the resource group and all resources in it, and then click Delete.
When you are done and if you want to, you can delete the resource group. The action of deleting a resource group is irreversible.
Important
All resources within the resource groups will be permanently deleted and cannot be undone.
-
Delete resource group by using the Remove-AzResourceGroup command.
Remove-AzResourceGroup -Name $resourceGroup
When you are done and if you want to, you can delete the resource group. The action of deleting a resource group is irreversible.
Important
All resources within the resource groups will be permanently deleted and cannot be undone.
-
Delete resource group by using the az group delete command.
az group delete \ --name $RESOURCE_GROUP
None.
Use the Azure portal, PowerShell, or the Azure CLI to delete the resource group.
[!div class="nextstepaction"] Storage hierarchy of Azure NetApp Files
[!div class="nextstepaction"] Service levels for Azure NetApp Files
[!div class="nextstepaction"] Create an NFS volume
[!div class="nextstepaction"] Solution architectures using Azure NetApp Files