透過 Azure 入口網站 在 Azure Stack Edge Pro GPU 裝置上部署 VM

適用于: Yes for Pro GPU SKU Azure Stack Edge Pro - GPU Yes for Pro 2 SKU Azure Stack Edge Pro 2 Yes for Pro R SKU Azure Stack Edge Pro R Yes for Mini R SKU Azure Stack Edge Mini R

您可以使用 Azure 入口網站、範本和 Azure PowerShell Cmdlet,以及透過 Azure CLI 或 Python 腳本,在 Azure Stack Edge Pro GPU 裝置上建立和管理虛擬機器(VM)。 本文說明如何使用 Azure 入口網站,在 Azure Stack Edge Pro GPU 裝置上建立和管理 VM。

重要

您必須為管理從雲端部署在裝置上的 VM 和映射的使用者啟用多重要素驗證。 如果使用者未啟用多重要素驗證,雲端作業將會失敗。 如需啟用多重要素驗證的步驟,請參閱 啟用 Microsoft Entra 多重要素驗證

VM 部署工作流程

部署工作流程的高階摘要如下所示:

  1. 在 Azure Stack Edge 裝置上啟用計算的網路介面。 此步驟會在指定的網路介面上建立虛擬交換器。

  2. 從Azure 入口網站啟用 VM 的雲端管理。

  3. 使用 Azure 儲存體 Explorer 將 VHD 上傳至Azure 儲存體帳戶。

  4. 使用上傳的 VHD 將 VHD 下載到裝置,並從 VHD 建立 VM 映射。

  5. 使用在先前步驟中建立的資源:

    1. 您建立的 VM 映射。
    2. 與您啟用計算之網路介面相關聯的虛擬交換器。
    3. 與虛擬交換器相關聯的子網。

    並內嵌建立或指定下列資源:

    1. VM 名稱,選擇支援的 VM 大小、VM 的登入認證。
    2. 建立新的資料磁片或連結現有的資料磁片。
    3. 設定 VM 的靜態或動態 IP。 如果您要提供靜態 IP,請選擇已啟用計算之網路介面子網範圍內的免費 IP。

    使用上述資源來建立 VM。

必要條件

在您開始透過Azure 入口網站在裝置上建立和管理 VM 之前,請確定:

  1. 您已完成 Azure Stack Edge Pro GPU 裝置上的網路設定,如步驟 1:設定 Azure Stack Edge Pro GPU 裝置 中所述

    1. 您已啟用用於計算的網路介面。 此網路介面 IP 可用來建立 VM 部署的虛擬交換器。 在裝置的本機 UI 中,移至 [計算 ]。 選取您將用來建立虛擬交換器的網路介面。

      重要

      您只能設定一個用於計算的埠。

    2. 在網路介面上啟用計算。 Azure Stack Edge Pro GPU 會建立和管理對應至該網路介面的虛擬交換器。

  2. 您可以存取您要建立之 VM 的 Windows 或 Linux VHD。

部署 VM

請遵循下列步驟,在 Azure Stack Edge Pro GPU 裝置上建立 VM。

新增 VM 映像

  1. 將 VHD 上傳至Azure 儲存體帳戶。 請遵循使用 儲存體總管 進行上傳 中的 步驟。

    如需準備 VHD 的相關資訊,請參閱 從 Windows VHD 準備一般化映射。

    針對 VM 映射上傳進行 疑難排解。

  2. 在Azure 入口網站中,移至您裝置的 Azure Stack Edge 資源。 然後移至 Edge 服務 > 虛擬機器。

    Screenshot showing the Overview pane of an Azure Stack Edge device, with the Virtual machines option, under Edge Services, highlighted.

  3. 在 [概 觀] 頁面上。 選取 [ 啟用 ] 以啟用虛擬機器雲端管理。

    Screenshot of the Overview pane in Virtual Machines view for an Azure Stack Edge device. The Enable button, to enable VM cloud management, is highlighted.

  4. 第一個步驟是新增 VM 映射。 您已在先前的步驟中將 VHD 上傳至儲存體帳戶。 您將使用此 VHD 來建立 VM 映射。

    選取 [+ 新增映射 ] 以從儲存體帳戶下載 VHD,並將其新增至裝置。 下載程式需要幾分鐘的時間,視 VHD 的大小和可供下載的網際網路頻寬而定。

    Screenshot of the Overview pane for Virtual Machines, with the Plus Add Image button highlighted.

  5. 在 [ 新增影像 ] 窗格上,進行下欄欄位專案。 然後選取 [新增]。

    欄位 描述
    從儲存體 Blob 下載 流覽至您上傳 VHD 的儲存體帳戶中儲存體 Blob 的位置。
    下載至 自動設定為您要部署 VM 的目前裝置。
    Edge 資源群組 選取要新增映射的資源群組。
    將映射儲存為 您要從上傳至儲存體帳戶的 VHD 建立的 VM 映射名稱。
    OS 類型 從 Windows 或 Linux 中選擇作為您將用來建立 VM 映射的 VHD 作業系統。
    VM 世代 選擇 [Gen 1] 或 [Gen 2] 作為您將用來建立 VM 的映射世代。 針對第 2 代 VM,預設會啟用安全開機。

    Screenshot showing the Add image page for a virtual machine with the Add button highlighted.

  6. VHD 會下載,並建立 VM 映射。 映射建立需要幾分鐘的時間才能完成。 您會看到 VM 映射成功完成的通知。

    Screenshot of the Overview for Virtual machines on an Azure Stack Edge device. On the Images pane, a newly created VM is highlighted.

  7. 成功建立 VM 映射之後,它會新增至 [映射 ] 窗格上的 映射清單。

    Screenshot that shows the Images pane in Virtual Machines view of an Azure Stack Edge device.

    [ 部署] 窗格會 更新,以指出部署的狀態。

    Screenshot showing the Deployments pane in Virtual Machines view of an Azure Stack Edge device. The entry for a deployed VM is highlighted.

    新新增的影像也會顯示在 [ 概觀 ] 頁面上。

    Screenshot that shows the Overview pane for Virtual Machines on an Azure Stack Edge device. A newly added VM image is highlighted.

新增 VM

遵循下列步驟,在建立 VM 映射之後建立 VM。

  1. 在 [ 虛擬機器 ] 頁面上,選取 [ + 新增虛擬機器 ]。

    Screenshot that shows the Overview pane for virtual machines on an Azure Stack Edge device. The Plus Add Virtual Machine button is highlighted.

  2. 在 [ 基本] 索引 標籤上,輸入下列參數。

    參數 描述
    虛擬機器名稱 輸入新虛擬機器的名稱。
    Edge 資源群組 為與 VM 相關聯的所有資源建立新的資源群組。
    映像 從裝置上可用的 VM 映射中選取。
    大小 支援的 VM 大小 中選擇。
    針對 GPU VM,從 NCasT4-v3 系列 選取 VM 大小。
    使用者名稱 使用系統管理員的預設使用者名稱 azureuser 來登入 VM。
    驗證類型 從 SSH 公開金鑰或使用者定義密碼中選擇。
    SSH 公開金鑰 當您選取 SSH 公開金鑰 驗證類型時顯示。 貼上 SSH 公開金鑰。
    密碼 當您選取 密碼 驗證類型時顯示。 輸入密碼以登入 VM。 密碼長度至少必須有 12 個字元,而且符合定義的複雜度需求
    確認密碼 再次輸入密碼。

    Screenshot showing the Basics tab in the Add Virtual Machine wizard for Azure Stack Edge. The Basics tab and the Next: Disks button are highlighted.

    完成時,選取 [下一步: 磁碟]。

  3. 在 [ 磁片] 索引標籤上,您將將磁片連結至 VM。

    1. 您可以選擇建立 並連結新的磁片 ,或 連結現有的磁片

      Screenshot showing the Disks tab in the Add Virtual Machine wizard for Azure Stack Edge. The Create and attach a new disk option is highlighted.

    2. 選取 [ 建立] 並連結新的磁片 。 在 [ 建立新的磁片 ] 窗格中,提供磁片的名稱和 GiB 的大小。

      Screenshot showing the

    3. 重複上述程式以新增更多磁片。 建立磁片之後,它們會顯示在 [磁片 ] 索引標籤上 。選取 [下一步:網路]。

  4. 在 [ 網路] 索引 標籤上,您將設定 VM 的網路連線能力。

    參數 描述
    虛擬網路 從下拉式清單中,選取您在網路介面上啟用計算時,于 Azure Stack Edge 裝置上建立的虛擬交換器。
    子網路 此欄位會自動填入與您啟用計算之網路介面相關聯的子網。
    IP 位址 為您的 VM 提供靜態或動態 IP。 靜態 IP 應該是來自指定子網範圍的可用免費 IP。

    Screenshot of the Networking tab in

    選取 [下一步: 進階]。 在 [ 進階 ] 索引標籤上,您可以選取要在 VM 部署期間安裝的擴充功能,並指定要自訂 VM 的 cloud-init 腳本。

  5. 如果您想要在建立 VM 時在 VM 上安裝擴充功能,請選擇 [ 選取要安裝的 擴充功能]。 然後在 [ 新增擴充功能] 畫面上選取延伸模組

    如需在 VM 部署期間安裝 GPU 擴充功能的詳細步驟,請參閱 部署 GPU VM

    Illustration of 2 steps to add a GPU extension to the Advanced tab of

  6. 如果您想要使用 cloud-init 公用程式在第一次開機時自訂新的 VM,請在 [進階 ] 索引標籤上,將腳本貼 cloud-init [自訂資料和雲端 init] 下的 [自訂資料 ] 方塊 中。

    如需使用 cloud-init 的詳細資訊,請參閱 Cloud-init 概觀

    Screenshot that shows the Advanced tab of the Create a new virtual machine wizard, with a cloud init script in the Custom data box highlighted.

    完成時,選取 [下一步:檢閱 + 建立]。

  7. 在 [ 檢閱 + 建立] 索引標籤上,檢閱 VM 的規格。 然後選取建立

    Screenshot that shows the Review Plus Create tab of the

  8. VM 建立會啟動,最多可能需要 20 分鐘的時間。 您可以移至 [ 部署 ] 來監視 VM 的建立。

    Screenshot that shows the Deployments pane in Virtual Machines view of an Azure Stack Edge device. The entry for a deployed VM is highlighted.

  9. 成功建立 VM 之後,您會在 [概觀 ] 窗格中看到新的 VM。

    Screenshot that shows the Overview pane for Virtual Machines on an Azure Stack Edge device. A new virtual machine is highlighted in the list.

  10. 選取新建立的 VM 以移至 [虛擬機器 ]。

    Screenshot showing the Virtual Machines pane of an Azure Stack Edge device. The Virtual Machines label and a virtual machine entry are highlighted.

    選取 VM 以查看詳細資料。

    Screenshot that shows the Details tab on the Overview pane for a virtual machine in Azure Stack Edge. The Overview label and the IP Address in Networking are highlighted.

    您將使用網路介面的 IP 位址來連線到 VM。

連線至 VM

視您建立 Linux 或 Windows VM 而定,連線的步驟可能不同。 您無法透過Azure 入口網站連線到裝置上部署的 VM。 請遵循步驟來連線到您的 Linux 或 Windows VM。

連線至 Linux VM (英文)

請遵循下列步驟來連線到 Linux VM。

使用您在建立 VM 期間傳遞的私人 IP,將連線至 VM。

  1. 開啟 SSH 會話以與 IP 位址連線。

    ssh -l <username> <ip address>
    
  2. 出現提示時,請提供您在建立 VM 時所使用的密碼。

    如果您需要提供 SSH 金鑰,請使用此命令。

    ssh -i c:/users/Administrator/.ssh/id_rsa Administrator@5.5.41.236

    以下是連線到 VM 時的範例輸出:

    PS C:\WINDOWS\system32> ssh -l myazuser "10.126.76.60"
    The authenticity of host '10.126.76.60 (10.126.76.60)' can't be established.
    ECDSA key fingerprint is SHA256:V649Zbo58zAYMKreeP7M6w7Na0Yf9QPg4SM7JZVV0E4.
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    Warning: Permanently added '10.126.76.60' (ECDSA) to the list of known hosts.
    myazuser@10.126.76.60's password:
    Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.18.0-1013-azure x86_64)
    
     * Documentation:  https://help.ubuntu.com
     * Management:     https://landscape.canonical.com
     * Support:        https://ubuntu.com/advantage
    
     System information disabled due to load higher than 1.0
    
      Get cloud support with Ubuntu Advantage Cloud Guest:
        http://www.ubuntu.com/business/services/cloud
    
    284 packages can be updated.
    192 updates are security updates. 
    
    The programs included with the Ubuntu system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.
    
    Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
    applicable law.
    
    To run a command as administrator (user "root"), use "sudo <command>".
    See "man sudo_root" for details.
    
    myazuser@myazvmfriendlyname:~$ client_loop: send disconnect: Connection reset
    PS C:\WINDOWS\system32>
    

連線至 Windows VM

請遵循下列步驟來連線到 Windows VM。

連線透過您在建立 VM 期間傳遞的 IP,使用遠端桌面通訊協定 (RDP) 連線到 Windows VM。

  1. 在您的用戶端上,開啟 RDP。

  2. 移至 [ 開始] ,然後輸入 mstsc

  3. 在 [ 遠端桌面連線ion ] 窗格中,輸入 VM 的 IP 位址,以及您在 VM 範本參數檔案中使用的存取認證。 然後選取 [連線]。

    Screenshot of the Remote Desktop Connection pane for connecting via RDP to your Windows VM.

    注意

    您可能需要核准連線到不受信任的電腦。

您現在已登入在設備上執行的 VM。

下一步