|
| 1 | +--- |
| 2 | +title: Red Hat Enterprise Linux bring-your-own-susbcription Azure images | Microsoft Docs |
| 3 | +description: Learn about bring-your-own-subscription images for Red Hat Enterprise Linux on Azure |
| 4 | +services: virtual-machines-linux |
| 5 | +documentationcenter: '' |
| 6 | +author: asinn826 |
| 7 | +manager: BorisB2015 |
| 8 | +editor: '' |
| 9 | + |
| 10 | +ms.assetid: f495f1b4-ae24-46b9-8d26-c617ce3daf3a |
| 11 | +ms.service: virtual-machines-linux |
| 12 | +ms.devlang: na |
| 13 | +ms.topic: article |
| 14 | +ms.tgt_pltfrm: vm-linux |
| 15 | +ms.workload: infrastructure-services |
| 16 | +ms.date: 6/6/2019 |
| 17 | +ms.author: alsin |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +# Red Hat Enterprise Linux Bring-Your-Own-Subscription Gold Images in Azure |
| 22 | +Red Hat Enterprise Linux (RHEL) images are available in Azure via a pay-as-you-go (PAYG) or bring-your-own-subscription (Red Hat Gold Image) model. This document provides an overview of the Red Hat Gold Images in Azure. |
| 23 | + |
| 24 | +## Important points to consider |
| 25 | + |
| 26 | +- The Red Hat Gold Images provided in this program are production-ready RHEL images similar the RHEL PAYG images in the Azure Gallery/Marketplace. The registration process to obtain the images is in preview. |
| 27 | + |
| 28 | +- The images follow our current policies described in [Red Hat Enterprise Linux images on Azure](./redhat-images.md) |
| 29 | + |
| 30 | +- Standard support policies apply to VMs created from these images |
| 31 | + |
| 32 | +- The VMs provisioned from Red Hat Gold Images do not carry RHEL fees associated with RHEL PAYG images |
| 33 | + |
| 34 | +- The images are unentitled, so you must use subscription-manager to register and subscribe the VMs to get updates from Red Hat directly |
| 35 | + |
| 36 | +- It is currently not possible to dynamically switch between BYOS and PAYG billing models for Linux images. Redeploying the VM from the respective image is required to switch the billing model |
| 37 | + |
| 38 | +- Azure Disk Encryption (ADE) is supported on these Red Hat Gold Images. ADE support is currently in preview. You must register with Red Hat using subscription-manager before configuring ADE. Once registered, to configure ADE refer to: [Enable Azure Disk Encryption for Linux IaaS VMs](https://docs.microsoft.com/azure/virtual-machines/linux/disk-encryption-overview) |
| 39 | + |
| 40 | +- While the images won’t change (beyond standard updates and patches), the registration process is in preview and the flow will be further improved to streamline the process |
| 41 | + |
| 42 | +- You have full control of the VMs already provisioned from these images or its snapshots regardless of the final implementation |
| 43 | + |
| 44 | +## Requirements and conditions to access the Red Hat Gold Images |
| 45 | + |
| 46 | +1. Get familiar with the [Red Hat Cloud Access program](https://www.redhat.com/en/technologies/cloud-computing/cloud-access) terms and enable your Red Hat subscriptions for Cloud Access at [Red Hat Subscription Manager](https://access.redhat.com/management/cloud). You will need to have on hand the Azure subscription(s) that are going to be registered for Cloud Access. |
| 47 | + |
| 48 | +1. If you have enabled Red Hat subscriptions for Cloud Access that meet the proper eligibility requirements, your Azure subscription(s) will be automatically be enabled for Gold Image access. |
| 49 | + |
| 50 | +### Expected time for image access |
| 51 | + |
| 52 | +Upon completing the Cloud Access enablement steps, Red Hat will validate your eligibility for the Red Hat Gold Images. If validation is successful, you will receive access to the Gold Images within three hours. |
| 53 | + |
| 54 | +## Use the Red Hat Gold Images from the Azure portal |
| 55 | + |
| 56 | +1. After your Azure subscription receives access to Red Hat Gold images, you can locate them in the [Azure portal](https://portal.azure.com) by navigating to **Create a Resource** and then **See all**. |
| 57 | + |
| 58 | +1. At the top of the page, you will see that you have private offers. |
| 59 | + |
| 60 | +  |
| 61 | + |
| 62 | +1. You can click on the purple link or scroll down to the bottom of the page to see your private offers. |
| 63 | + |
| 64 | +1. The rest of provisioning in the UI will be no different to any other existing Red Hat image. Choose your RHEL version and follow the prompts to provision your VM. This process will also let you accept the terms of the image at the final step. |
| 65 | + |
| 66 | +>[!NOTE] |
| 67 | +>These steps so far will not enable your Red Hat Gold Image image for programmatic deployment – an additional step will be required as described in the “Additional Information” section below. |
| 68 | +
|
| 69 | +The rest of this document focuses on the CLI method to provision and accept terms on the image. The UI and CLI are fully interchangeable as far as the final result (a provisioned RHEL Gold Image VM) is concerned. |
| 70 | + |
| 71 | +## Use the Red Hat Gold Images from the Azure CLI |
| 72 | +The following set of instructions will walk you through the initial deployment process for a RHEL VM using the Azure CLI. These instructions assume that you have the [Azure CLI installed](https://docs.microsoft.com/cli/azure/install-azure-cli). |
| 73 | + |
| 74 | +>[!IMPORTANT] |
| 75 | +>Make sure you use all lowercase letters in the publisher, offer, plan, and image references for all the following commands |
| 76 | +
|
| 77 | +1. Check that you are in your desired subscription: |
| 78 | + ```azurecli |
| 79 | + az account show -o=json |
| 80 | + ``` |
| 81 | +
|
| 82 | +1. Create a resource group for your Red Hat Gold Image VM: |
| 83 | + ```azurecli |
| 84 | + az group create --name <name> --location <location> |
| 85 | + ``` |
| 86 | +
|
| 87 | +1. Accept the image terms: |
| 88 | + ```azurecli |
| 89 | + az vm image terms accept --publisher redhat --offer rhel-byos --plan <SKU value here> -o=jsonc |
| 90 | +
|
| 91 | + # Example: |
| 92 | + az vm image terms accept --publisher redhat --offer rhel-byos --plan rhel-lvm75 -o=jsonc |
| 93 | +
|
| 94 | + OR |
| 95 | +
|
| 96 | + az vm image terms accept --urn RedHat:rhel-byos:rhel-lvm8:8.0.20190620 |
| 97 | + ``` |
| 98 | + >[!NOTE] |
| 99 | + >These terms need to be accepted *once per Azure subscription, per image SKU*. |
| 100 | +
|
| 101 | +1. (Optional) Validate your VM deployment with the following command : |
| 102 | + ```azurecli |
| 103 | + az vm create -n <VM name> -g <resource group name> --image <image urn> --validate |
| 104 | +
|
| 105 | + # Example: |
| 106 | + az vm create -n rhel-byos-vm -g rhel-byos-group --image RedHat:rhel-byos:rhel-lvm75:7.5.20190620 |
| 107 | + ``` |
| 108 | +
|
| 109 | +1. Provision your VM by running the same command as above without the `--validate` argument: |
| 110 | + ```azurecli |
| 111 | + az vm create -n <VM name> -g <resource group name> --image <image urn> --validate |
| 112 | + ``` |
| 113 | +
|
| 114 | +1. SSH into your VM and verify that you have an unentitled image. To do this, run `sudo yum repolist` (for RHEL 8 use `sudo dnf repolist`). The output will ask you to use subscription-manager to register the VM with Red Hat. |
| 115 | +
|
| 116 | +>[!NOTE] |
| 117 | +>On RHEL 8 `dnf` and `yum` are interchangeable, more about this in the [RHEL 8 Admin Guide](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/installing-software-with-yum_configuring-basic-system-settings). |
| 118 | +
|
| 119 | +
|
| 120 | +## Use the Red Hat Gold Images from the Azure PowerShell Cmdlet |
| 121 | +The following is an example script. You should replace the Resource Group, location, VM name, login information, and other variables with the configuration of your choosing. Publisher and plan information must be lowercase. |
| 122 | +```powershell-interactive |
| 123 | + # Variables for common values |
| 124 | + $resourceGroup = "testbyos" |
| 125 | + $location = "canadaeast" |
| 126 | + $vmName = "test01" |
| 127 | +
|
| 128 | + # Define user name and blank password |
| 129 | + $securePassword = ConvertTo-SecureString 'Desjardinslab1!' -AsPlainText -Force |
| 130 | + $cred = New-Object System.Management.Automation.PSCredential("azureuser",$securePassword) |
| 131 | + Get-AzureRmMarketplaceTerms -Publisher RedHat -Product rhel-byos -Name rhel-lvm75 | SetAzureRmMarketplaceTerms -Accept |
| 132 | + |
| 133 | + # Create a resource group |
| 134 | + New-AzureRmResourceGroup -Name $resourceGroup -Location $location |
| 135 | + |
| 136 | + # Create a subnet configuration |
| 137 | + $subnetConfig = New-AzureRmVirtualNetworkSubnetConfig -Name mySubnet -AddressPrefix 192.168.1.0/24 |
| 138 | +
|
| 139 | + # Create a virtual network |
| 140 | + $vnet = New-AzureRmVirtualNetwork -ResourceGroupName $resourceGroup -Location |
| 141 | + $location `-Name MYvNET -AddressPrefix 192.168.0.0/16 -Subnet $subnetConfig |
| 142 | +
|
| 143 | + # Create a public IP address and specify a DNS name |
| 144 | + $pip = New-AzureRmPublicIpAddress -ResourceGroupName $resourceGroup -Location |
| 145 | + $location `-Name "mypublicdns$(Get-Random)" -AllocationMethod Static -IdleTimeoutInMinutes 4 |
| 146 | + |
| 147 | + # Create an inbound network security group rule for port 22 |
| 148 | + $nsgRuleSSH = New-AzureRmNetworkSecurityRuleConfig -Name |
| 149 | + myNetworkSecurityGroupRuleSSH -Protocol Tcp ` |
| 150 | + -Direction Inbound -Priority 1000 -SourceAddressPrefix * -SourcePortRange * - |
| 151 | + DestinationAddressPrefix * `-DestinationPortRange 22 -Access Allow |
| 152 | +
|
| 153 | + # Create a network security group |
| 154 | + $nsg = New-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroup -Location |
| 155 | + $location `-Name myNetworkSecurityGroup -SecurityRules $nsgRuleSSH |
| 156 | +
|
| 157 | + # Create a virtual network card and associate with public IP address and NSG |
| 158 | + $nic = New-AzureRmNetworkInterface -Name myNic -ResourceGroupName $resourceGroup - |
| 159 | + Location $location `-SubnetId $vnet.Subnets[0].Id -PublicIpAddressId $pip.Id -NetworkSecurityGroupId $nsg.Id |
| 160 | +
|
| 161 | + # Create a virtual machine configuration |
| 162 | + $vmConfig = New-AzureRmVMConfig -VMName $vmName -VMSize Standard_D3_v2 | |
| 163 | + Set-AzureRmVMOperatingSystem -Linux -ComputerName $vmName -Credential $cred | |
| 164 | + Set-AzureRmVMSourceImage -PublisherName redhat -Offer rhel-byos -Skus rhel-lvm75 -Version latest | Add- AzureRmVMNetworkInterface -Id $nic.Id |
| 165 | + Set-AzureRmVMPlan -VM $vmConfig -Publisher redhat -Product rhel-byos -Name "rhel-lvm75" |
| 166 | + |
| 167 | + # Configure SSH Keys |
| 168 | + #$sshPublicKey = Get-Content "$env:USERPROFILE\.ssh\id_rsa.pub" |
| 169 | + #Add-AzureRmVMSshPublicKey -VM $vmconfig -KeyData $sshPublicKey -Path "/home/azureuser/.ssh/authorized_keys" |
| 170 | + |
| 171 | + # Create a virtual machine |
| 172 | + New-AzureRmVM -ResourceGroupName $resourceGroup -Location $location -VM $vmConfig |
| 173 | +``` |
| 174 | + |
| 175 | +## Additional information |
| 176 | +- If you attempt to provision a VM on a subscription that is not enabled for this offer, you will get the following error and you should contact Microsoft or Red Hat to enable your subscription. |
| 177 | + ``` |
| 178 | + "Offer with PublisherId: redhat, OfferId: rhel-byos, PlanId: rhel-lvm75 is private and can not be purchased by subscriptionId: GUID" |
| 179 | + ``` |
| 180 | +
|
| 181 | +- If you create a snapshot from the RHEL BYOS image AND publish the image in [Shared Image Gallery](https://docs.microsoft.com/azure/virtual-machines/linux/shared-image-galleries), you will need to provide plan information that matches the original source of the snapshot. For example, the command might look like (note the plan parameters in the final line): |
| 182 | + ```azurecli |
| 183 | + az vm create –image \ |
| 184 | + "/subscriptions/GUID/resourceGroups/GroupName/providers/Microsoft.Compute/galleries/GalleryName/images/ImageName/versions/1.0.0" \ |
| 185 | + -g AnotherGroupName --location EastUS2 -n VMName \ |
| 186 | + --plan-publisher redhat --plan-product rhel-byos --plan-name rhel-lvm75 |
| 187 | + ``` |
| 188 | +
|
| 189 | +- If you are using automation to provision VMs from the RHEL BYOS images, you will need to provide plan parameters similar to what was shown above. For example, if you are using Terraform, you would provide the plan information in a [plan block](https://www.terraform.io/docs/providers/azurerm/r/virtual_machine.html#plan). |
| 190 | +
|
| 191 | +## Next steps |
| 192 | +* Step-by-step guides and program details for Cloud Access are available in the [Red Hat Cloud Access documentation.](https://access.redhat.com/documentation/en-us/red_hat_subscription_management/1/html/red_hat_cloud_access_reference_guide/index) |
| 193 | +* Learn more about the [Azure Red Hat Update Infrastructure](./redhat-rhui.md). |
| 194 | +* To learn more about the Red Hat images in Azure, go to the [documentation page](./redhat-images.md). |
| 195 | +* Information on Red Hat support policies for all versions of RHEL can be found on the [Red Hat Enterprise Linux Life Cycle](https://access.redhat.com/support/policy/updates/errata) page. |
0 commit comments