Error Failing to Create VM off Image from CIS VM from Marketplace


Product Name

CIS Hardened Images® (Azure)

Product Version

 

Date

Dec 8, 2021



Problem

A user creates a CIS VM from Azure Marketplace after purchasing. The user then deprovisions, dellocates, generalizes that VM and creates an image from it. Upon creating a VM off that image, the VM fails to create with error message similar to:

","details":[{"code":"VMMarketplaceInvalidInput","message":"Creating a virtual machine from Marketplace image or a custom image sourced from a Marketplace image requires Plan information in the request. VM: '/subscriptions/95a577ee-21c2-4fd5-9baf-dc9bcac91e07/resourceGroups/cisLinux/providers/Microsoft.Compute/virtualMachines/cisub20-offimg'."}]}

Solution

  1. Create CIS HI of choice from Marketplace

  2. SSH into the CIS Marketplace HI and deprovision

    1. To do this: run the commands below as on the CIS Marketplace HI

      sudo -s waagent -force -deprovision export HISTSIZE=0
    2. Stop the VM in Dashboard

  3. Wait until Marketplace VM is stopped and run CLI as administrator and sign into Azure CLI

    Run deallocate $ az vm deallocate --resource-group [insert rg name] --name [insert name of marketplace cis hi] Run Generalize $ az vm generalize --resource-group [insert rg name] --name [insert name of marketplace cis hi] Create Image $ az image create --resource-group [insert rg name] --name [insert name you want image to have] --source [insert name of marketplace cis hi] --location "[insert location]"

     

  4. Go to Dashboard and ensure image is created from Azure CLI

  5. Create VM off the image through the dashboard

  6. When creating a VM off the image, “plan information” must be included in the VM deployment. This is an Azure process that CIS has no control or input on.

  7. When creating a VM off an image through the dashboard, go to the image and create VM off the image as you normally would. Fill in all information (resource group, VM name, user name and pass or key, network security group, etc.)

  8. When you get to the “Review and create” page click the “Download a template for automation” link at the bottom of the page

  9. Click “Deploy” then “Edit Template”

  10. Locate the section of the template that has the parameters defined for virtual machine and add the plan information below the location section

    "plan": { "name": "cis-ubuntu2004-l1", "publisher": "center-for-internet-security-inc", "product": "cis-ubuntu-linux-2004-l1" },
  11. See example above - make sure alignment/syntax is correct

  12. Save and create (will likely need to type in password again so scroll down on the page and fill that in)

  13. Create

 



Keywords;

Content by Label


Copyright © 2020

Center for Internet Security®