ComputeCanada / magic_castle

Terraform modules to replicate the HPC user experience in the cloud
MIT License
131 stars 38 forks source link

Cannot use Marketplace image on Azure #201

Closed ocaisa closed 2 years ago

ocaisa commented 2 years ago

I am trying to use the AlmaLinux HPC image on Azure:

  image        = {
    publisher = "almalinux",
    offer     = "almalinux-hpc",
    sku       = "8_5-hpc-gen2"
  }

but I am getting the error

Error: waiting for creation of Linux Virtual Machine "eessi-azure-mgmt1" (Resource Group "eessi-azure_resource_group"): 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/03b53f0f-3af6-4cb4-9136-0ed3ea75498e/resourceGroups/eessi-azure_resource_group/providers/Microsoft.Compute/virtualMachines/eessi-azure-mgmt1'."

These images are useful because they come with GPUs and infiniband pre-configured.

ocaisa commented 2 years ago

For the time being I'm using CentOS-HPC but that suffers from https://www.svennd.be/nothing-provides-libsz-so-2-centos-8/

cmd-ntrf commented 2 years ago

To support Azure Marketplace, we would have to define a dynamic plan block that requires the three following arguments:

While the current source_image_reference can take the following arguments:

What we could do to support marketplace image is to look if the image hash contains name and product key. If it does, the user is requesting a marketplace image, and we define a dynamic plan block. If these keys are missing, the user is requesting a custom image and we define a source_image_reference block.

cmd-ntrf commented 2 years ago

Fixed by commit 1447632131c8c65a1170481019e74f403c590630