How to get SKU and Version of RHEL 8.6 (LVM) -X64 Gen2 Image

Sandeep Goyal 40 Reputation points
2023-07-19T15:41:12.36+00:00

Hi Everyone

I need to create a RHEL 8.6 VM using Terraform and need SKU and Version information for that.

I want to use RHEL 8.6 (LVM) -X64 Gen2 Image.

I provided below input parameters, but got the error that no matching image found. What should be correct sku and version ?

    publisher = "RedHat"
    offer     = "RHEL"
    sku       = "8.6"
    version   = "latest"
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,077 questions
{count} votes

Accepted answer
  1. B santhiswaroop naik 405 Reputation points
    2023-07-19T15:44:52.8866667+00:00

    To create a Red Hat Enterprise Linux (RHEL) 8.6 virtual machine using Terraform, you need to provide the correct combination of publisher, offer, sku, and version. The error you encountered ("no matching image found") suggests that the combination you provided did not match any available images in the Azure Marketplace.

    For RHEL 8.6, the correct values for publisher, offer, and sku are as follows:

    publisher = "RedHat"

    offer = "RHEL"

    sku = "8.6-LVM"

    Regarding the version, you should set it to "latest" to ensure that the most recent version of the RHEL 8.6 image is used. If there's a specific version you want to use, you can specify it, but "latest" will typically suffice.

    So, the correct input parameters for creating the RHEL 8.6 VM using Terraform should look like this:

    provider "azurerm" {
      # Your Azure provider configuration here
    }
    
    resource "azurerm_virtual_machine" "example" {
      name                  = "example-vm"
      location              = "East US"
      resource_group_name   = "your-resource-group-name"
      network_interface_ids = [azurerm_network_interface.example.id]
      vm_size               = "Standard_DS2_v2"
    
      storage_image_reference {
        publisher = "RedHat"
        offer     = "RHEL"
        sku       = "8.6-LVM"
        version   = "latest"
      }
    
      os_disk {
        name              = "example-osdisk"
        caching           = "ReadWrite"
        create_option     = "FromImage"
        managed_disk_type = "Standard_LRS"
      }
    
      # Additional configuration for the VM
    }
    

    Make sure you have the correct Azure provider configuration above the resource block, and replace "your-resource-group-name" with the name of your desired resource group. Adjust the location, vm_size, and other configurations as per your requirements.

    After setting up the correct parameters, you should be able to create the RHEL 8.6 VM using Terraform successfully.

    Hope this information helps.

    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.