快速入門:設定 Azure NetApp Files 並建立 NFS 磁碟區Quickstart: Set up Azure NetApp Files and create an NFS volume

本文將示範如何快速設定 Azure NetApp Files 並建立磁碟區。This article shows you how to quickly set up Azure NetApp Files and create a volume.

在本快速入門中,您會設定下列項目:In this quickstart, you will set up the following items:

  • 註冊 Azure NetApp Files 和 NetApp 資源提供者Registration for Azure NetApp Files and NetApp Resource Provider
  • 一個 NetApp 帳戶A NetApp account
  • 一個容量集區A capacity pool
  • 一個適用於 Azure NetApp Files 的 NFS 磁碟區An NFS volume for Azure NetApp Files

如果您沒有 Azure 訂用帳戶,請在開始前建立免費帳戶If you don't have an Azure subscription, create a free account before you begin.

開始之前Before you begin

重要

您必須具備 Azure NetApp Files 服務的存取權。You need to be granted access to the Azure NetApp Files service. 若要要求服務的存取權,請參閱 Azure NetApp 檔案等候清單提交頁面 (英文)。To request access to the service, see the Azure NetApp Files waitlist submission page. 您必須等候 Azure NetApp Files 團隊發出官方確認電子郵件,然後再繼續。You must wait for an official confirmation email from the Azure NetApp Files team before continuing.

使用 Azure Cloud ShellUse Azure Cloud Shell

Azure Cloud Shell 是裝載於 Azure 中的互動式殼層環境,可在瀏覽器中使用。Azure hosts Azure Cloud Shell, an interactive shell environment that you can use through your browser. 您可以使用 Bash 或 PowerShell 搭配 Cloud Shell,與 Azure 服務共同使用。You can use either Bash or PowerShell with Cloud Shell to work with Azure services. Azure Cloud Shell 已預先安裝一些命令,可讓您執行本文提到的程式碼,而不必在本機環境上安裝任何工具。You can use the Cloud Shell preinstalled commands to run the code in this article without having to install anything on your local environment.

要啟動 Azure Cloud Shell:To start Azure Cloud Shell:

選項Option 範例/連結Example/Link
選取程式碼區塊右上角的 [試試看] 。Select Try It in the upper-right corner of a code block. 選取 [試用] 並不會自動將程式碼複製到 Cloud Shell 中。Selecting Try It doesn't automatically copy the code to Cloud Shell. Azure Cloud Shell 的試試看範例
請前往 https://shell.azure.com 或選取 [啟動 Cloud Shell] 按鈕,在瀏覽器中開啟 Cloud Shell。Go to https://shell.azure.com, or select the Launch Cloud Shell button to open Cloud Shell in your browser. 在新視窗中啟動 Cloud ShellLaunch Cloud Shell in a new window
選取 Azure 入口網站右上角功能表列中的 [Cloud Shell] 按鈕。Select the Cloud Shell button on the top-right menu bar in the Azure portal. Azure 入口網站中的 [Cloud Shell] 按鈕

若要在 Azure Cloud Shell 中執行本文中的程式碼:To run the code in this article in Azure Cloud Shell:

  1. 啟動 Cloud Shell。Start Cloud Shell.

  2. 選取程式碼區塊上的 [複製] 按鈕,複製程式碼。Select the Copy button on a code block to copy the code.

  3. 在 Windows 和 Linux 上選取 Ctrl+Shift+V;或在 macOS 上選取 Cmd+Shift+V,將程式碼貼到 Cloud Shell 工作階段中。Paste the code into the Cloud Shell session by selecting Ctrl+Shift+V on Windows and Linux or by selecting Cmd+Shift+V on macOS.

  4. 選取 Enter 鍵執行程式碼。Select Enter to run the code.


註冊 Azure NetApp Files 和 NetApp 資源提供者Register for Azure NetApp Files and NetApp Resource Provider

注意

註冊程序可能需要一些時間才能完成。The registration process can take some time to complete.

如需使用入口網站的註冊步驟,請如上所示開啟 Cloud Shell 工作階段,並遵循下列 Azure CLI 步驟:For registration steps using Portal, open a Cloud Shell session as indicated above and follow these Azure CLI steps:

  1. 指定已列入 Azure NetApp Files 白名單的訂用帳戶:Specify the subscription that has been whitelisted for Azure NetApp Files:

    az account set --subscription <subscriptionId>
    
  2. 註冊 Azure 資源提供者:Register the Azure Resource Provider:

    az provider register --namespace Microsoft.NetApp --wait  
    

建立 NetApp 帳戶Create a NetApp account

  1. 在 Azure 入口網站的搜尋方塊中,輸入 Azure NetApp Files,然後從顯示的清單中選取 [Azure NetApp Files] 。In the Azure portal’s search box, enter Azure NetApp Files and then select Azure NetApp Files from the list that appears.

    選取 Azure NetApp Files

  2. 按一下 [+ 新增] 以建立新的 NetApp 帳戶。Click + Add to create a new NetApp account.

    建立新的 NetApp 帳戶

  3. 在 [新增 NetApp 帳戶] 視窗中,提供下列資訊:In the New NetApp Account window, provide the following information:

    1. 輸入 myaccount1 作為帳戶名稱。Enter myaccount1 for the account name.

    2. 選取您的訂用帳戶。Select your subscription.

    3. 選取 [新建] 來建立新的資源群組。Select Create new to create new resource group. 輸入 myRG1 作為資源群組名稱。Enter myRG1 for the resource group name. 按一下 [確定] 。Click OK.

    4. 選取您的帳戶位置。Select your account location.

      新增 NetApp 帳戶視窗

      資源群組視窗

  4. 按一下 [建立] 以建立新的 NetApp 帳戶。Click Create to create your new NetApp account.

設定容量集區Set up a capacity pool

  1. 從 Azure NetApp Files 管理刀鋒視窗中,選取您的 NetApp 帳戶 (myaccount1)。From the Azure NetApp Files management blade, select your NetApp account (myaccount1).

    選取 NetApp 帳戶

  2. 從您 NetApp 帳戶的 Azure NetApp Files 管理刀鋒視窗中,按一下 [容量集區] 。From the Azure NetApp Files management blade of your NetApp account, click Capacity pools.

    按一下容量集區

  3. 按一下 [+ 新增集區] 。Click + Add pools.

    按一下新增集區

  4. 提供容量集區的資訊:Provide information for the capacity pool:

    1. 請輸入 mypool1 作為集區名稱。Enter mypool1 as the pool name.
    2. 選取 [進階] 作為服務等級。Select Premium for the service level.
    3. 指定 4 (TiB) 作為集區大小。Specify 4 (TiB) as the pool size.
  5. 按一下 [確定] 。Click OK.

建立適用於 Azure NetApp Files 的 NFS 磁碟區Create NFS volume for Azure NetApp Files

  1. 從您 NetApp 帳戶的 Azure NetApp Files 管理刀鋒視窗中,按一下 [磁碟區] 。From the Azure NetApp Files management blade of your NetApp account, click Volumes.

    按一下磁碟區

  2. 按一下 [+ 新增磁碟區] 。Click + Add volume.

    按一下新增磁碟區

  3. 在 [建立磁碟區] 視窗中,提供磁碟區的資訊:In the Create a Volume window, provide information for the volume:

    1. 輸入 myvol1 作為磁碟區名稱。Enter myvol1 as the volume name.

    2. 選取您的容量集區 (mypool1)。Select your capacity pool (mypool1).

    3. 針對配額,請使用預設值。Use the default value for quota.

    4. 在 [虛擬網路] 下,按一下 [新建] 來建立新的 Azure 虛擬網路 (Vnet)。Under virtual network, click Create new to create a new Azure virtual network (Vnet). 然後填寫下列資訊︰Then fill in the following information:

      • 輸入 myvnet1 作為 Vnet 名稱。Enter myvnet1 as the Vnet name.
      • 針對您的設定來指定位址空間,例如 10.7.0.0/16Specify an address space for your setting, for example, 10.7.0.0/16
      • 輸入 myANFsubnet 作為子網路名稱。Enter myANFsubnet as the subnet name.
      • 指定子網路位址範圍,例如 10.7.0.0/24。Specify the subnet address range, for example, 10.7.0.0/24. 您無法與其他資源共用專用子網路。You cannot share the dedicated subnet with other resources.
      • 針對子網路委派,請選取 [Microsoft.NetApp/磁碟區] 。Select Microsoft.NetApp/volumes for subnet delegation.
      • 按一下 [確定] 以建立 Vnet。Click OK to create the Vnet.
    5. 在子網路中,選取新建立的 Vnet (myvnet1) 作為委派子網路。In subnet, select the newly created Vnet (myvnet1) as the delegate subnet.

      建立磁碟區視窗

      建立虛擬網路視窗

  4. 按一下 [通訊協定] ,然後完成下列動作:Click Protocol, and then complete the following actions:

    • 選取 [NFS] 作為磁碟區的通訊協定類型。Select NFS as the protocol type for the volume.
    • 輸入 myfilepath1,作為用來建立磁碟區匯出路徑的檔案路徑。Enter myfilepath1 as the file path that will be used to create the export path for the volume.
    • 選取磁碟區的 NFS 版本 (NFSv3NFSv4.1)。Select the NFS version (NFSv3 or NFSv4.1) for the volume.
      請參閱有關 NFS 版本的考量最佳做法See considerations and best practice about NFS versions.

為快速入門指定 NFS 通訊協定

  1. 按一下 [檢閱 + 建立] 。Click Review + create.

    檢閱與建立視窗

  2. 檢閱磁碟區的資訊,然後按一下 [建立] 。Review information for the volume, then click Create.
    建立的磁碟區會出現在 [磁碟區] 刀鋒視窗中。The created volume appears in the Volumes blade.

    已建立的磁碟區

清除資源Clean up resources

完成之後可以選擇刪除資源群組。When you are done and if you want to, you can delete the resource group. 刪除資源群組是無法回復的動作。The action of deleting a resource group is irreversible.

重要

資源群組內的所有資源都將永久刪除且無法復原。All resources within the resource groups will be permanently deleted and cannot be undone.

  1. 在 Azure 入口網站的搜尋方塊中,輸入 Azure NetApp Files,然後從顯示的清單中選取 [Azure NetApp Files] 。In the Azure portal’s search box, enter Azure NetApp Files and then select Azure NetApp Files from the list that appears.

  2. 在訂用帳戶清單中,按一下您想要刪除的資源群組 (myRG1)。In the list of subscriptions, click the resource group (myRG1) you want to delete.

    瀏覽至資源群組

  3. 在 [資源群組] 頁面中,按一下 [刪除資源群組] 。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.

  4. 輸入資源群組名稱 (myRG1) 以確認您想要永久刪除該資源群組和所有資源,然後按一下 [刪除] 。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.

    刪除資源群組

後續步驟Next steps