探索適用於 Linux 虛擬機器擴展集的 Azure Hybrid Benefit

Azure Hybrid Benefit 可以降低執行 Red Hat Enterprise Linux (RHEL) 和 SUSE Linux Enterprise Server (SLES) 虛擬機器擴展集的成本。 適用於 Linux 虛擬機器擴展集的 Azure Hybrid Benefit 目前已正式發行。 其適用於 Azure Marketplace 中所有 RHEL 和 SLES 隨用隨付映像。

當您啟用 Azure Hybrid Benefit 時,您會產生的唯一費用就是擴展集基礎結構的成本。

注意

本發行項著重於以統一協調流程模式執行的虛擬機器擴展集。 我們建議針對新的工作負載使用彈性協調流程。 如需詳細資訊,請參閱 Azure 中虛擬機器擴展集的協調流程模式

什麼是適用於 Linux 虛擬機器擴展集的 Azure Hybrid Benefit?

Azure Hybrid Benefit 可讓您將虛擬機器擴展集切換為自備訂用帳戶 (BYOS) 計費。 您可以使用來自 Red Hat 或 SUSE 的雲端存取授權進行此作業。 您也可以將隨用隨付執行個體切換為 BYOS,而不需重新部署。

如果已啟用 Azure Hybrid Benefit,則從隨用隨付 Azure Marketplace 映像部署的虛擬機器擴展集會被收取基礎結構和軟體費用。

Diagram that shows the effect of Azure Hybrid Benefit on costs for Linux virtual machines.

哪些 Linux 虛擬機器可以使用 Azure Hybrid Benefit?

Azure Hybrid Benefit 可用於,Azure Marketplace 中所有 RHEL 和 SLES 隨用隨付映像。 Azure Hybrid Benefit 還無法用於 Azure Marketplace 中的 RHEL 或 SLES BYOS 映像或自訂映像。

如果您已經使用 Linux 虛擬機器搭配 Azure Hybrid Benefit,則 Azure 專用主機執行個體和 SQL 混合式權益不符合 Azure Hybrid Benefit 的資格。

開始使用

啟用適用於 Red Hat 虛擬機器擴展集的 Azure Hybrid Benefit

適用於 RHEL 的 Azure Hybrid Benefit 適用於符合以下準則的 Red Hat 客戶:

  • 符合用於 Azure 資格的作用中或未使用 RHEL 訂用帳戶
  • 已正確啟用一或多個訂用帳戶,以在 Azure 中搭配 Red Hat Cloud Access 方案使用

若要開始使用適用於 Red Hat 的 Azure Hybrid Benefit:

  1. 使用 Red Hat Cloud Access 客戶介面,在 Azure 中啟用合格的 RHEL 訂用帳戶。

    您在 Red Hat Cloud Access 啟用流程中提供的 Azure 訂用帳戶將獲准使用 Azure Hybrid Benefit。

  2. 將 Azure Hybrid Benefit 套用至任何現有和新的 RHEL 隨用隨付虛擬機器擴展集。 您可以使用 Azure 入口網站或 Azure CLI 來啟用 Azure Hybrid Benefit。

  3. 遵循建議的後續步驟,以設定 RHEL 虛擬機器的更新來源和 RHEL 訂閱合規性指導。

啟用適用於 SUSE 虛擬機器擴展集的 Azure Hybrid Benefit

若要開始使用適用於 SUSE 的 Azure Hybrid Benefit:

  1. 向 SUSE 公用雲端程式註冊。
  2. 透過 Azure 入口網站或 Azure CLI,將 Azure Hybrid Benefit 套用至新建立或現有的虛擬機器擴展集。
  3. 使用個別的更新來源來註冊接收 Azure Hybrid Benefit 的虛擬機器。

啟用 Azure 入口網站中的 Azure Hybrid Benefit

在虛擬機器擴展集建立期間啟用 Azure Hybrid Benefit

  1. 前往 Azure 入口網站

  2. 前往建立虛擬機器擴展集

    Screenshot of the portal page for creating a Virtual Machine Scale Set.

  3. 在 [授權] 區段中,選取詢問您是否要使用現有的 RHEL 訂閱,以及確認您訂閱符合資格的核取方塊。

    Screenshot of the Azure portal that shows checkboxes selected for licensing.

  4. 遵循下一組指示來建立虛擬機器擴展集。

  5. 在 [作業系統] 窗格中,確認選項已啟用。

    Screenshot of the Azure Hybrid Benefit pane for the operating system after you create a virtual machine.

在現有虛擬機器擴展集中啟用 Azure Hybrid Benefit

  1. 前往 Azure 入口網站
  2. 開啟您要套用轉換的虛擬機器擴展集頁面。
  3. 移至 [作業系統]> [授權]。 若要啟用 Azure Hybrid Benefit 轉換,請選取 [是],然後選取確認核取方塊。

Screenshot of the Azure portal that shows the Licensing section of the pane for the operating system.

使用 Azure CLI 啟用和停用 Azure Hybrid Benefit

在 Azure CLI 中,您可以使用 az vmss update 命令來啟用 Azure Hybrid Benefit。 針對 RHEL 虛擬機器,請使用 RHEL_BYOS--license-type 參數來執行命令。 針對 SLES 虛擬機器,請使用 SLES_BYOS--license-type 參數來執行命令。

# This will enable Azure Hybrid Benefit on a RHEL Virtual Machine Scale Set
az vmss update --resource-group myResourceGroup --name myVmName --license-type RHEL_BYOS

# This will enable Azure Hybrid Benefit on a SLES Virtual Machine Scale Set
az vmss update --resource-group myResourceGroup --name myVmName --license-type SLES_BYOS

若要停用 Azure Hybrid Benefit,請使用 None--license-type 值:

# This will disable Azure Hybrid Benefit on a virtual machine
az vmss update -g myResourceGroup -n myVmName --license-type None

注意

擴展集具有升級原則,可決定藉由最新擴展集模型,將虛擬機器更新至最新狀態的方式。

如果您的擴展集有自動升級原則,會在虛擬機器更新時自動套用 Azure Hybrid Benefit。 如果您的擴展集有滾動升級原則,則會根據排程的更新套用 Azure Hybrid Benefit。

如果您的擴展集有手動升級原則,您必須使用 Azure CLI 手動升級虛擬機器:

# This will bring Virtual Machine Scale Set instances up to date with the latest Virtual Machine Scale Set model 
az vmss update-instances --resource-group myResourceGroup --name myScaleSet --instance-ids {instanceIds}

在建立時將 Azure Hybrid Benefit 套用至虛擬機器擴展集

重要

自 2023 年 11 月起,如果未指定協調流程模式,則使用 PowerShell 和 Azure CLI 建立的 VM 擴展集會預設為彈性協調流程模式。 如需此變更的詳細資訊,以及您應該採取的動作,請移至 針對 VMSS PowerShell/CLI 客戶的中斷性變更 - Microsoft 社群中樞

除了將 Azure Hybrid Benefit 套用至現有的隨用隨付虛擬機器擴展集外,您也可以在建立虛擬機器擴展集時予以叫用。 這樣做具有多種好處:

  • 您可以使用相同的映像和流程,來佈建隨用隨付和 BYOS 虛擬機器擴展集。
  • 其允許未來的授權模式變更。 這些變更不適用於僅限 BYOS 的映像。
  • 虛擬機器依預設會連線至 Red Hat 更新基礎結構 (RHUI),以確保其維持在最新且安全狀態。 您可以隨時在部署後變更更新後的機制。

若要使用 Azure CLI 在建立時,將 Azure Hybrid Benefit 套用至虛擬機器擴展集,請使用下列其中一個命令:

# This will enable Azure Hybrid Benefit while creating a RHEL Virtual Machine Scale Set
az vmss create --name myVmName --resource-group myResourceGroup --orchestration-mode Uniform --vnet-name myVnet --subnet mySubnet  --image myRedHatImageURN --admin-username myAdminUserName --admin-password myPassword --instance-count myInstanceCount --license-type RHEL_BYOS 

# This will enable Azure Hybrid Benefit while creating a SLES Virtual Machine Scale Set
az vmss create --name myVmName --resource-group myResourceGroup --orchestration-mode Uniform --vnet-name myVnet --subnet mySubnet  --image myRedHatImageURN --admin-username myAdminUserName --admin-password myPassword --instance-count myInstanceCount --license-type SLES_BYOS

下一步