Rediger

Del via


Azure Hybrid Benefit for Linux virtual machines

You can use Azure Hybrid Benefit for Linux to easily switch the software subscription model for your Linux virtual machine (VM). Change your subscription model without redeploying your VM and with no risk of downtime. You gain flexibility and savings.

You can switch seamlessly between two subscription models on Azure by using Azure Hybrid Benefit:

  • Bring your own subscription (BYOS): In the BYOS model, you bring your own Red Hat Enterprise Linux (RHEL) or SUSE Linux Enterprise Server (SLES) subscription directly to Azure. You pay only for the infrastructure costs of your VM on Azure. The software fee is covered by your RHEL or SLES subscription.

  • Pay-as-you-go (PAYG): Use the PAYG subscription model in Azure to pay for RHEL and SLES subscriptions as you use them.

This article defines the BYOS and PAYG subscription models, compares the benefits of each model, and shows you how to use the Azure Hybrid Benefit to switch between the two subscription models for your Linux VMs on Azure.

This process applies to:

  • Azure Virtual Machine Scale Sets
  • Azure Spot Virtual Machines
  • Custom images

Azure Hybrid Benefit gives you the option to make seamless bidirectional conversions between the two subscription models on eligible VM instances.

You might see combined savings estimated to up to 76% with Azure Hybrid Benefit for Linux and three-year Azure Reserved VM Instances. Savings estimates are based on one standard D2s v5 Azure VM with an RHEL or SLES subscription in the East US region running at a PAYG rate versus a reduced rate for a three-year reserved instance plan. The savings estimates are based on Azure pricing as of September 2024. Prices are subject to change. Actual savings might vary based on location, instance type, or usage.

Tip

Try the Azure Hybrid Benefit savings calculator to visualize the cost-saving benefits of this feature.

PAYG vs. BYOS

Azure offers two main licensing pricing options: PAYG and BYOS. With PAYG, you pay only for the resources you use. You can scale up or scale down as needed.

With BYOS, you can use your existing license subscriptions. You don't pay the license fees in Azure.

Diagram that shows the use of Azure Hybrid Benefit to switch Linux VMs between pay-as-you-go and bring your own subscription models.

Note

VMs deployed from PAYG images or VMs converted from BYOS models incur both an infrastructure fee and a software fee. If you have your own license, use Azure Hybrid Benefit to convert from a PAYG model to a BYOS model.

You can use Azure Hybrid Benefit to switch between the two subscription options at any time.

Linux VMs you can use with Azure Hybrid Benefit

PAYG

The following PAYG RHEL and SLES Marketplace offers are eligible to use with Azure Hybrid Benefit:

Limitations

Only RHEL images published by Red Hat, Inc. are eligible to use with Azure Hybrid Benefit. Images that are published by other vendors aren't supported.

Red Hat-published RHEL PAYG offers eligible for Azure Hybrid Benefit

The following Red Hat-published RHEL PAYG offers are eligible to use with Azure Hybrid Benefit. Links to the offers in Azure Marketplace are included.

Within these offers, associated images are described as "Pay-As-You-Go".

BYOS

Azure Hybrid Benefit is also available for RHEL and SLES BYOS Azure Marketplace images.

Currently, one RHEL BYOS offer is available. This offer is a private listing. To gain access to this private listing, you must join the Red Hat Cloud Access program.

You can identify SLES BYOS marketplace offers by their name, which includes "BYOS". An example is the SUSE Enterprise Linux 12 SP5 - BYOS offering.

Azure dedicated host instances and SQL hybrid benefits aren't eligible to use with Azure Hybrid Benefit if you already use Azure Hybrid Benefit with Linux VMs.

Note

For Red Hat VMs, the Azure account must be part of the Red Hat Cloud Access program. Register with Red Hat Cloud Access before you try to enable Azure Hybrid Benefit on your VMs.

Enable Azure Hybrid Benefit

You can enable Azure Hybrid Benefit on new VMs, on existing VMs, and on multiple VMs.

New VM

You can invoke Azure Hybrid Benefit when you create a VM. The benefits of using this approach include:

  • You can provision both PAYG and BYOS VMs by using the same image and process.
  • You can change the licensing mode in the future.
  • The VM is connected to Red Hat Update Infrastructure (RHUI) by default, to help keep it up to date and secure. You can change the update method after deployment.

The SUSE workflow is the same as the RHEL example shown here.

To enable Azure Hybrid Benefit when you create a VM:

  1. In the Azure portal, go to Create a virtual machine.

    Screenshot of the portal pane for creating a virtual machine.

  2. In the Licensing section, select the checkbox that asks if you want to use an existing RHEL subscription. Select the checkbox to confirm that your subscription is eligible.

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

  3. Create a virtual machine by following the steps that are presented.

  4. On the VM service menu, select Operating System. Under Licensing, verify that the option is enabled.

    Screenshot of the Azure Hybrid Benefit configuration pane after you create a virtual machine.

Existing VM

You can enable Azure Hybrid Benefit on an existing VM.

To enable Azure Hybrid Benefit on an existing VM:

  1. In the Azure portal, go to the overview pane of the VM that you want to convert.
  2. Go to Operating System > Licensing. To enable the Azure Hybrid Benefit conversion, select Yes, and then select the confirmation checkbox.

Screenshot of the Azure portal that shows the Licensing section of the configuration page for Azure Hybrid Benefit.

Check the current licensing model of a VM that has Azure Hybrid Benefit enabled

The Azure Hybrid Benefit extension must be installed on the VM to switch the licensing model from BYOS to PAYG or vice versa. You can view whether the agent is installed by using the Azure CLI or the Azure Instance Metadata Service.

  1. You can use the az vm get-instance-view command to check whether the extension is installed. Look for the AHBForSLES or AHBForRHEL extension. If the corresponding extension is installed, the Azure Hybrid Benefit is enabled. Review the license type to determine which licensing model is applied to your VM.

    az vm get-instance-view -g MyResourceGroup -n myVm --query instanceView.extensions
    
  2. When the corresponding Red Hat or SUSE Azure Hybrid Benefit extension is installed, use the following command to review the license type that's applied to the VM:

    az vm get-instance-view -g MyResourceGroup -n myVM --query licenseType
    

    The following license types correspond to a PAYG subscription model:

    For RHEL:

    • RHEL_BASE
    • RHEL_EUS
    • RHEL_SAPAPPS
    • RHEL_SAPHA
    • RHEL_BASESAPAPPS
    • RHEL_BASESAPHA

    For SLES:

    • SLES
    • SLES_SAP
    • SLES_HPC

    These license types correspond to a BYOS subscription model:

    For RHEL:

    • RHEL_BYOS

    For SLES:

    • SLES_BYOS

    If the license type of the VM hasn't been modified, this command returns an empty string and the VM continues to use the billing model of the image that you used to deploy it.

Convert PAYG to BYOS

If you deployed an Azure Marketplace image by using a PAYG licensing model and want to convert licensing to BYOS, complete the following steps.


Convert a PAYG image to BYOS by using the Azure CLI

Use the Azure CLI to convert a PAYG Azure Marketplace image to a BYOS subscription model.

  1. Apply the RHEL_BYOS license type to the VM:

    # This enables BYOS on a RHEL PAYG VM by using Azure Hybrid Benefit.
    az vm update -g myResourceGroup -n myVmName --license-type RHEL_BYOS
    
  2. When the PAYG to BYOS conversion is finished, you must register the VM with Red Hat for system updates and usage compliance.

  3. If you want to return to a PAYG subscription model, set license-type to None. Otherwise, the subscription model continues to be BYOS.

    # If the image started as PAYG and and was converted to BYOS, the following command reverts it back to PAYG.
    az vm update -g myResourceGroup -n myVmName --license-type NONE
    

Convert BYOS to PAYG

Converting to a PAYG subscription model is supported for Azure Marketplace images labeled "BYOS" and for machines imported from on-premises or from a third-party cloud provider.

  1. Install the Azure Hybrid Benefit extension on a running VM. You can use the following command via the Azure CLI:

    az vm extension set -n AHBForRHEL --publisher Microsoft.Azure.AzureHybridBenefit --vm-name myVMName --resource-group myResourceGroup
    
  2. After the extension is installed successfully, change the license type based on what you need:

    # This enables Azure Hybrid Benefit to fetch software updates for RHEL base/regular repositories.
    az vm update -g myResourceGroup -n myVmName --license-type RHEL_BASE
    
    # This enables Azure Hybrid Benefit to fetch software updates for RHEL EUS repositories.
    az vm update -g myResourceGroup -n myVmName --license-type RHEL_EUS
    
    # This enables Azure Hybrid Benefit to fetch software updates for RHEL SAP APPS repositories.
    az vm update -g myResourceGroup -n myVmName --license-type RHEL_SAPAPPS
    
    # This enables Azure Hybrid Benefit to fetch software updates for RHEL SAP HA repositories.
    az vm update -g myResourceGroup -n myVmName --license-type RHEL_SAPHA
    
    # This enables Azure Hybrid Benefit to fetch software updates for RHEL BASE SAP APPS repositories.
    az vm update -g myResourceGroup -n myVmName --license-type RHEL_BASESAPAPPS
    
    # This enables Azure Hybrid Benefit to fetch software updates for RHEL BASE SAP HA repositories.
    az vm update -g myResourceGroup -n myVmName --license-type RHEL_BASESAPHA
    
  3. Check to see if the "AHB for RHEL" feature flag is enabled:

    az feature list --namespace Microsoft.Compute | grep "AHBEnabledForRHEL" -A 3
    
  4. If you want to return to the BYOS model, set license-type to None. Otherwise, the subscription model continues to be PAYG.

    # If the image started as BYOS and was converted to PAYG, the following command reverts it back to BYOS.
    az vm update -g myResourceGroup -n myVmName --license-type NONE
    

Multiple VMs

The following command converts the VMs that are specified in the argument to BYOS:

# This enables BYOS on a RHEL virtual machine. In this example, ids.txt is an
# existing text file that contains a delimited list of resource IDs corresponding
# to the virtual machines that use Azure Hybrid Benefit.
az vm update -g myResourceGroup -n myVmName --license-type RHEL_BYOS --ids $(cat ids.txt)

The following examples show two methods you can use to get a list of resource IDs. One method applies to a resource group, and one method applies to the subscription.

# To get a list of all the resource IDs in a resource group:
az vm list -g MyResourceGroup --query "[].id" -o tsv

# To get a list of all the resource IDs of virtual machines in a subscription:
az vm list -o json | jq '.[] | {VirtualMachineName: .name, ResourceID: .id}'

Convert the license type in the VM operating system

To start using Azure Hybrid Benefit for Red Hat:

  1. Install the AHBForRHEL extension on the VM on which you want to apply the Azure Hybrid Benefit BYOS benefit. You can install the extension by using the Azure CLI or Azure PowerShell.

  2. Depending on the software updates that you want, change the license type to a relevant value. Here are the available license type values and the software updates associated with them:

    License type Software updates Allowed VMs
    RHEL_BASE Installs Red Hat regular/base repositories on your VM. RHEL BYOS VMs, RHEL custom image VMs
    RHEL_EUS Installs Red Hat Extended Update Support (EUS) repositories on your VM. RHEL BYOS VMs, RHEL custom image VMs
    RHEL_SAPAPPS Installs RHEL for SAP Business Apps repositories on your VM. RHEL BYOS VMs, RHEL custom image VMs
    RHEL_SAPHA Installs RHEL for SAP with High Availability (HA) repositories on your VM. RHEL BYOS VMs, RHEL custom image VMs
    RHEL_BASESAPAPPS Installs RHEL regular/base SAP Business Apps repositories on your VM. RHEL BYOS VMs, RHEL custom image VMs
    RHEL_BASESAPHA Installs regular/base RHEL for SAP with HA repositories on your VM. RHEL BYOS VMs, RHEL custom image VMs
  3. Wait one hour for the extension to read the license type value and install the repositories.

    Note

    If the extension isn't running by itself, you can run it on demand.

    You should now be connected to Azure Red Hat Update. The relevant repositories are installed on your machine.

  4. If you want to switch back to the BYOS model, set license-type to None and run the extension. This action removes all RHUI repositories from your VM and stops associated billing.

Note

In the unlikely event that the extension can't install repositories or if there are any other issues, switch the license type back to empty and contact Microsoft support. Taking this step ensures that you aren't billed for software updates.

Azure Hybrid Benefit for reserved instance VMs

Azure reservations (Azure Reserved Virtual Machine Instances) help you save money by committing to one-year or three-year plans for multiple products. Azure Hybrid Benefit for PAYG VMs is available for reserved instances.

If you purchased compute costs at a discounted rate by using reserved instances, you can apply Azure Hybrid Benefit on the licensing costs for RHEL and SUSE. The steps to apply Azure Hybrid Benefit for a reserved instance are exactly the same as for a regular VM.

Screenshot of the interface for purchasing reservations for VMs.

Note

If you already purchased reservations for RHEL or SUSE PAYG software in Azure Marketplace, wait for the reservation tenure to finish before you use Azure Hybrid Benefit for PAYG VMs.

Compliance

Customers who use Azure Hybrid Benefit for PAYG RHEL VMs agree to the standard legal terms and privacy statement associated with Azure Marketplace RHEL offers.

Customers who use Azure Hybrid Benefit for PAYG RHEL VMs have three options for providing software updates and patches to those VMs:

Customers can use RHUI as the main update source for Azure Hybrid Benefit for PAYG RHEL VMs without attaching subscriptions. Customers who choose the RHUI option are responsible for ensuring RHEL subscription compliance.

Customers who choose either Red Hat Satellite Server or Red Hat Subscription Manager should remove the RHUI configuration and then attach a cloud-access-enabled RHEL subscription to Azure Hybrid Benefit for PAYG RHEL VMs.

For more information about Red Hat subscription compliance, software updates, and sources for Azure Hybrid Benefit for PAYG RHEL VMs, see the Red Hat article about using RHEL subscriptions with Azure Hybrid Benefit.

Customers who use the Azure Hybrid Benefit BYOS to PAYG capability for RHEL agree to the standard legal terms and privacy statement associated with Azure Marketplace RHEL offerings.

Frequently asked questions

  • Q: Can I use a license type of RHEL_BYOS with a SLES image or vice versa?

    • A: No, you can't. Trying to enter a license type that incorrectly matches the distribution running on your VM won't update any billing metadata. But if you accidentally enter the wrong license type, updating your VM again to the correct license type still enables Azure Hybrid Benefit.
  • Q: I've registered with Red Hat Cloud Access but still can't enable Azure Hybrid Benefit on my RHEL VMs. What should I do?

    • A: It might take some time for your Red Hat Cloud Access subscription registration to propagate from Red Hat to Azure. If you still see the error after one business day, contact Microsoft support.
  • Q: I've deployed a VM by using a RHEL BYOS "golden image." Can I convert the billing on this image from BYOS to PAYG?

    • A: Yes, you can use Azure Hybrid Benefit for BYOS VMs to convert this subscription model.
  • Q: I've uploaded my own RHEL or SLES image from on-premises (via Azure Migrate, Azure Site Recovery, or otherwise) to Azure. Can I convert the billing on these images from BYOS to PAYG?

    • A: Yes, you can use Azure Hybrid Benefit for BYOS VMs to convert this subscription model.
  • Q: I've uploaded my own RHEL or SLES image from on-premises (via Azure Migrate, Azure Site Recovery, or otherwise) to Azure. Do I need to do anything to benefit from Azure Hybrid Benefit?

    • A: No, you don't. RHEL or SLES images that you upload are already considered BYOS, and you're charged only for Azure infrastructure costs. You're responsible for RHEL subscription costs, just as you are for your on-premises environments.
  • Q: Can I use Azure Hybrid Benefit for PAYG VMs for Azure Marketplace RHEL and SLES SAP images?

    • A: Yes. You can use the license type of RHEL_BYOS for RHEL VMs and SLES_BYOS for conversions of VMs deployed from Azure Marketplace RHEL and SLES SAP images.
  • Q: Can I use Azure Hybrid Benefit for PAYG VMs on virtual machine scale sets for RHEL and SLES?

    • A: Yes. Azure Hybrid Benefit on virtual machine scale sets for RHEL and SLES is available to all users. You can learn more about this benefit and how to use it.
  • Q: Can I use Azure Hybrid Benefit for PAYG VMs on reserved instances for RHEL and SLES?

    • A: Yes. Azure Hybrid Benefit for PAYG VMs on reserved instances for RHEL and SLES is available to all users.
  • Q: Can I use Azure Hybrid Benefit for PAYG VMs on a VM deployed for SQL Server on RHEL images?

    • A: No, you can't. There's no plan to support these VMs.
  • Q: Can I use Azure Hybrid Benefit on my RHEL for Virtual Datacenters subscription?

    • A: No. RHEL for Virtual Datacenters isn't supported on Azure at all, including for Azure Hybrid Benefit.