Create an Azure VM from Linux ISO

Adrian Evangelista 56 Reputation points
2021-02-07T01:31:35.933+00:00

Hi, I understand it is not possible to create an Azure VM from an ISO, but have read that there are situations where you can mount a ISO to a VM (by creating a VHD from the ISO). What I am trying to do is create an Azure VM from an older version of CentOS to that in the default images list. I want to install CentOS 7.9, as some of the software is not compatible with the CentOS8.2 version. I did try using a 7.9 version from the marketplace, but wasnt suitable whenever connecting to the vm seeing the publisher name. I'm trying to create a fresh (vanilla) image from the ISO to create a new VM. What's the best practices for doing so and can this image be used to create more than 1 vm? similar to generalising an image for a Windows OS..

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,014 questions
{count} votes

5 answers

Sort by: Most helpful
  1. SUNOJ KUMAR YELURU 15,256 Reputation points MVP Volunteer Moderator
    2021-02-07T02:27:14.947+00:00

    Hi @Adrian Evangelista

    You cannot create an Azure VM from an ISO file. you can only create VMs from VHDs, Managed Disks or Managed Disk Images/Snapshots.

    If you want to use this ISO in Azure you would need to use something like HyperV on premises to create a VM and then export the VHD and upload to Azure. Make sure you follow this guide to create the VHD in a format Azure can understand.

    Upload a generalized VHD and use it to create new VMs in Azure

    If the Answer is helpful, please click Accept Answer and up-vote, this can be beneficial to other community members.

    2 people found this answer helpful.
    0 comments No comments

  2. Andreas Baumgarten 123.4K Reputation points MVP Volunteer Moderator
    2021-02-07T09:27:47.713+00:00

    In addition to the answer of learn2skills this might be helpful as well:

    Prepare a CentOS-based virtual machine for Azure
    https://learn.microsoft.com/en-us/azure/virtual-machines/linux/create-upload-centos

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    2 people found this answer helpful.

  3. Andreas Baumgarten 123.4K Reputation points MVP Volunteer Moderator
    2021-02-09T18:28:42.8+00:00

    To make it easier: Why not choosing a "ready to go" CentOS 7.9 from the list of images (instead of CentOS 8.2)?

    66006-allimages.jpg

    66043-centos79.jpg

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    1 person found this answer helpful.

  4. Adrian Evangelista 56 Reputation points
    2021-02-10T00:05:14.453+00:00

    Just to clarify what i was doing (as we do not have a Hyper-v host in our domain environment) was creating a VM on my local surface pro (from Hyper-V) using the installation ISO, installing the OS and configuring the root pwd and users.
    I then went through the CentOS 7 section in the link (https://learn.microsoft.com/en-us/azure/virtual-machines/linux/create-upload-centos)
    After shutting down, I uploaded the VHD to a storage account in Azure
    Then created an VM using that Image
    FAILED during provisioning
    2021-02-09T23:13:55.142412Z WARNING Daemon cloud-init does not appear to be running
    2021-02-09T23:13:56.145909Z INFO Daemon Waiting for cloud-init to copy ovf-env.xml to /var/lib/waagent/ovf-env.xml [1755 retries remaining, sleeping 1s]


  5. Adrian Evangelista 56 Reputation points
    2021-03-18T23:43:09.647+00:00

    Hi, Just an update on this. I ended up doing the install and setup without using cloud-init. i configured the waagent.conf to use a swap file and everything worked perfect.

    I did reach out to Azure support and they mentioned it may have failed previously due to a typo in the /etc/cloud/cloud.cfg.d/91-azure_datasource.cfg file (it needed an indent in to format the config correctly). I didn't try this, as i already had a working solution, but thought to mention incase someone else had this issue.

    0 comments No comments

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.