在 Azure Stack Hub 中提供虛擬機器擴展集Make virtual machine scale sets available in Azure Stack Hub

虛擬機器擴展集是 Azure Stack Hub 計算資源。Virtual machine scale sets are an Azure Stack Hub compute resource. 您可以使用擴展集來部署和管理一組相同的虛擬機器 (VM)。You can use scale sets to deploy and manage a set of identical virtual machines (VMs). 由於所有 VM 都以相同的方式進行設定,因此擴展集不需要預先佈建 VM。With all VMs configured in the same way, scale sets do not require pre-provisioning of VMs. 您可以更輕鬆地針對大量計算、巨量資料和容器化工作負載,建置大規模服務。It's easier to build large-scale services that target big compute, big data, and containerized workloads.

本文引導您完成讓擴展集可在 Azure Stack Hub Marketplace 中使用的程序。This article guides you through the process of making scale sets available in the Azure Stack Hub Marketplace. 完成此程序之後,您的使用者可以將虛擬機器擴展集新增至其訂用帳戶。After you complete this procedure, your users can add virtual machine scale sets to their subscriptions.

Azure Stack Hub 上的虛擬機器擴展集類似 Azure 上的虛擬機器擴展集。Virtual machine scale sets on Azure Stack Hub are similar to virtual machine scale sets on Azure. 如需詳細資訊,請參閱下列視訊:For more information, see the following videos:

在 Azure Stack Hub 上,虛擬機器擴展集不支援自動調整。On Azure Stack Hub, virtual machine scale sets do not support autoscale. 您可以使用 Resource Manager 範本、CLI 或 PowerShell 將更多執行個體新增到擴展集。You can add more instances to a scale set using Resource Manager templates, CLI, or PowerShell.

PrerequisitesPrerequisites

  • Azure Stack Hub Marketplace: 向全域 Azure 註冊 Azure Stack Hub 以便讓 Azure Stack Hub Marketplace 中的項目可供使用。Azure Stack Hub Marketplace: Register Azure Stack Hub with global Azure to enable the availability of items in the Azure Stack Hub Marketplace. 請遵循向 Azure 註冊 Azure Stack Hub 中的指示。Follow the instructions in Register Azure Stack Hub with Azure.
  • 作業系統映像: 能夠建立虛擬機器擴展集之前,您必須先從 Azure Stack Hub Marketplace 下載要在擴展集中使用的 VM 映像。Operating system image: Before a virtual machine scale set can be created, you must download the VM images for use in the scale set from the Azure Stack Hub Marketplace. 該映像必須已經存在,使用者才能建立新的擴展集。The images must already be present before a user can create a new scale set.

使用 Azure Stack Hub 入口網站Use the Azure Stack Hub portal

  1. 登入 Azure Stack Hub 入口網站。Sign in to the Azure Stack Hub portal. 然後,依序移至 [所有服務] 和 [虛擬機器擴展集] ,接著在 [計算] 底下,選取 [虛擬機器擴展集] 。Then, go to All services, then Virtual machine scale sets, and then under COMPUTE, select Virtual machine scale sets. 選取虛擬機器擴展集Select virtual machine scale sets

  2. 選取 [新增]。Select Add.

    建立虛擬機器擴展集

  3. 填寫空白欄位,從 [作業系統磁碟映像] 、[訂用帳戶] 和 [執行個體大小] 的下拉式清單選擇。Fill in the empty fields, choose from the dropdowns for Operating system disk image, Subscription, and Instance size. 針對 [使用受控磁碟] 選擇 [是] 。Select Yes for Use managed disks. 然後,選取 [Create] (建立)。Then, select Create. 設定及建立虛擬機器擴展集Configure and create virtual machine scale sets

  4. 若要查看新的虛擬機器擴展集,請移至 [所有資源] ,搜尋虛擬機器擴展集的名稱,然後在搜尋中選取其名稱。To see your new virtual machine scale set, go to All resources, search for the virtual machine scale set name, and then select its name in the search. 查看虛擬機器擴展集View the virtual machine scale set

更新虛擬機器擴展集中的映像Update images in a virtual machine scale set

建立虛擬機器擴展集之後,使用者可以更新擴展集中的映像,而不必重新建立擴展集。After you create a virtual machine scale set, users can update images in the scale set without the scale set having to be recreated. 更新映像的程序取決於下列案例:The process to update an image depends on the following scenarios:

  1. 虛擬機器擴展集部署範本會指定 最新version (版本)Virtual machine scale set deployment template specifies latest for version:

    version 在擴展集範本的 imageReference 區段中設定為 latest 時,擴展集的相應放大作業會針對擴展集執行個體使用映像可用的最新版本。When the version is set to latest in the imageReference section of the template for a scale set, scale-up operations on the scale set use the newest available version of the image for the scale set instances. 相應放大完成之後,您可以刪除較舊的虛擬機器擴展集執行個體。After a scale-up is complete, you can delete older virtual machine scale sets instances. publisheroffersku 的值維持不變。The values for publisher, offer, and sku remain unchanged.

    下列的 JSON 範例會指定 latestThe following JSON example specifies latest:

    "imageReference": {
        "publisher": "[parameters('osImagePublisher')]",
        "offer": "[parameters('osImageOffer')]",
        "sku": "[parameters('osImageSku')]",
        "version": "latest"
        }
    
  2. 虛擬機器擴展集部署範本 不會指定最新的 version ,而會改為指定一個版本號碼:Virtual machine scale set deployment template does not specify latest for version and specifies a version number instead:

    如果 Azure Stack 操作員下載較新版本的映像 (並刪除較舊的版本),擴展集就無法擴大。If the Azure Stack operator downloads an image with a newer version (and deletes the older version), the scale set cannot scale up. 這是因為根據設計,擴展集範本中指定的映像版本必須可以使用。This is by design, as the image version specified in the scale set template must be available.

如需詳細資訊,請參閱作業系統磁碟和映像For more information, see operating system disks and images.

調整虛擬機器擴展集Scale a virtual machine scale set

您可以變更虛擬機器擴展集的大小,使其變大或變小。You can change the size of a virtual machine scale set to make it larger or smaller.

  1. 在入口網站中,選取您的擴展集,然後選取 [調整] 。In the portal, select your scale set and then select Scaling.

  2. 使用滑桿調整此虛擬機器擴展集的新層級,然後按一下 [儲存] 。Use the slide bar to set the new level of scaling for this virtual machine scale set, and then click Save.

    調整虛擬機器集合Scale the virtual machine set

後續步驟Next steps