Here’s a quick post on how to subscribe and use the preview enabling you to test/use the RHEL image in BYOS (Bring Your Own Subscription) model.
If you are reading this you probably already have found the RHEL image named rhel-byos in azure, but you were unable to use them because it was private.
I was going to share the link here, but as far as I’ve been told, I can’t. So please contact your Redhat rep or Microsoft rep if you want to join the preview. You probably can open a ticket on azure portal.
Important thing to know once you’re in the preview program:
You have to accept the Terms, don’t forget the:
| Set-AzureRmMarketplaceTerms -Accept
Even if the publisher name is RedHat when you lookup the image, when you want to use it, you have to use “redhat” all lowercase.
Here’s the powershell script I used to test the deployment once I was in the preview.
# Variables for common values $resourceGroup = "testbyos" $location = "canadaeast" $vmName = "test02" # Define user name and blank password $securePassword = ConvertTo-SecureString 'XXXXXX!' -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential ("azureuser", $securePassword) Get-AzureRmMarketplaceTerms -Publisher redhat -Product rhel-byos -Name rhel-lvm75 | Set-AzureRmMarketplaceTerms -Accept # Create a resource group New-AzureRmResourceGroup -Name $resourceGroup -Location $location # Create a subnet configuration $subnetConfig = New-AzureRmVirtualNetworkSubnetConfig -Name mySubnet -AddressPrefix 192.168.1.0/24 # Create a virtual network $vnet = New-AzureRmVirtualNetwork -ResourceGroupName $resourceGroup -Location $location ` -Name MYvNET -AddressPrefix 192.168.0.0/16 -Subnet $subnetConfig # Create a public IP address and specify a DNS name $pip = New-AzureRmPublicIpAddress -ResourceGroupName $resourceGroup -Location $location ` -Name "mypublicdns$(Get-Random)" -AllocationMethod Static -IdleTimeoutInMinutes 4 # Create an inbound network security group rule for port 22 $nsgRuleSSH = New-AzureRmNetworkSecurityRuleConfig -Name myNetworkSecurityGroupRuleSSH -Protocol Tcp ` -Direction Inbound -Priority 1000 -SourceAddressPrefix * -SourcePortRange * -DestinationAddressPrefix * ` -DestinationPortRange 22 -Access Allow # Create a network security group $nsg = New-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroup -Location $location ` -Name myNetworkSecurityGroup -SecurityRules $nsgRuleSSH # Create a virtual network card and associate with public IP address and NSG $nic = New-AzureRmNetworkInterface -Name myNic -ResourceGroupName $resourceGroup -Location $location ` -SubnetId $vnet.Subnets[0].Id -PublicIpAddressId $pip.Id -NetworkSecurityGroupId $nsg.Id # Create a virtual machine configuration $vmConfig = New-AzureRmVMConfig -VMName $vmName -VMSize Standard_D3_v2 | Set-AzureRmVMOperatingSystem -Linux -ComputerName $vmName -Credential $cred | Set-AzureRmVMSourceImage -PublisherName redhat -Offer rhel-byos -Skus rhel-lvm75 -Version latest | Add-AzureRmVMNetworkInterface -Id $nic.Id Set-AzureRmVMPlan -VM $vmConfig -Publisher redhat -Product rhel-byos -Name rhel-lvm75 # Configure SSH Keys #$sshPublicKey = Get-Content "$env:USERPROFILE\.ssh\id_rsa.pub" #Add-AzureRmVMSshPublicKey -VM $vmconfig -KeyData $sshPublicKey -Path "/home/azureuser/.ssh/authorized_keys" # Create a virtual machine New-AzureRmVM -ResourceGroupName $resourceGroup -Location $location -VM $vmConfig