danielsollondon / azvmimagebuilder

Azure VM Image Builder
181 stars 153 forks source link

Default VM configuration incompatible with Gen2 images #57

Open timtylin opened 4 years ago

timtylin commented 4 years ago

I'm using the following field in properties in order to get a Gen2 CentOS7 image:

                "vmProfile": {
                    "vmSize": "Standard_D2s_v3",
                    "osDiskSizeGB": 20
                },
                "source": {
                    "type": "PlatformImage",
                    "publisher": "OpenLogic",
                    "offer": "CentOS",
                    "sku": "7_8-gen2",
                    "version": "latest"
                }

However, when running the build, I'm noticing this in the logs:

PACKER OUT ==> azure-arm: ERROR: -> DeploymentFailed : At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.
PACKER ERR ==> azure-arm: ERROR:   -> BadRequest
PACKER OUT ==> azure-arm: ERROR:   -> BadRequest
PACKER ERR ==> azure-arm: ERROR:   -> BadRequest : Generation 2 Hypervisor Image and VM Size can only be used with managed-disk VMs.
PACKER OUT ==> azure-arm: ERROR:   -> BadRequest : Generation 2 Hypervisor Image and VM Size can only be used with managed-disk VMs.
PACKER ERR ==> azure-arm:

When I go to look at the deployment template that AIB is trying to provision in the temporary resource group, I noticed that the VM is seemingly hard-wired to use VHDs:

    "osDisk": {
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "[parameters('osDiskName')]",
        "vhd": {
            "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]"
        }
    }

So I'm basically wondering whether Gen2 images are supported?

danielsollondon commented 4 years ago

Hi @timtylin - Gen2 image are not yet supported with AIB. This is on the roadmap, I would hope by the end of the calendar year, but I will have a better idea in September.

timtylin commented 4 years ago

Ah okay. It would be great to have somewhere in the documentation a warning regarding this, as that would have saved me quite a few hours of digging around.

danielsollondon commented 4 years ago

Hi @timtylin , apologies for the delayed response and the lack of docs, I did update the docs a while ago, however, we do now have a workaround. As mentioned AB does not natively support distributing Gen2 images to the Shared Image Gallery (SIG), or Managed Images. However, you can select a Gen2 source, a distribute to a VHD, then as a post process, create a Managed Image from the VHD, and inject that as a Gen2 image into the SIG. Not ideal, but maybe useful.

virtualwebber commented 3 years ago

@danielsollondon I came across this whilst looking for gen2 support in AIB and SIG, do you know when its expected?

agm83 commented 3 years ago

Hi , same here... Any news? BTW, I was able to use above workaround. Thank you!

kof-f commented 3 years ago

Hey All,

I'm Kofi and I'm currently the PM for Azure Image Builder. Dan has transitioned to another team.

Gen2 support is expected by the end of the calendar year. We are deprecating this repo soon, so in the future please leave any issues/feature requests in our official repo: https://github.com/Azure/azvmimagebuilder

schiffne commented 3 years ago

HI Kofi, are there any updates in regards to Gen 2 support. Can we join a private preview to provide feedback to your team. Please let us know asap, as it would help our Windows 365 rollout, in order to decide how we would create our base image going forward. Thanks!

seemonrajs commented 2 years ago

Hi @danielsollondon ,

We are planning to implement AIP with Windows 11 multi-session for our production AVD rollout. Could you please suggest if AIB is fully supported for this scenario now, especially for Gen 2 VMs?