Azure/azvmimagebuilder

AiB Accepts the Deployment of a GEN 2 VM and the Distribution Process Fails.

frestevao opened this issue · 11 comments

Hello team!

On the public documentation, I see that the AiB does not support the GEN 2 VM.

https://docs.microsoft.com/en-us/azure/virtual-machines/image-builder-overview#hyper-v-generation

But it allows me to trigger the deployment and the process fails on the Image Distribution.

Source Image as a Gen 2 VM.

SourceImageV2

AiB template deployed with success.

AiB Template Deployed

AiB generates the Managed Image as generation 1

image

SIG image with Unknow state

image

AiB error on Azure Portal:

    "provisioningState": "Succeeded",
    "lastRunStatus": {
        "startTime": "2021-11-12T15:04:52.400830569Z",
        "endTime": "2021-11-12T15:28:44.353389414Z",
        "runState": "Failed",
        "message": "Failed in distributing 1 images out of total 1: Some error happened, please check the error details."
    },

Thanks, very interested in this bugfix/feature

Hey Guys!

The public document was updated!

image

I also did a test building a Generation 2 Image and it worked =D

image

Did you deploy the template with e.g. some powershell files you used to customize the image further?

Hello @schiffne,

My deployment runs a PowerShell script that enabled IIS and other settings on the Windows Server.

If you want, I can share the template with you.

Best regards,
Estevão

I will run my deployment now as well, installing MECM and AntiVirus, it does work with Gen1 images...
will let you know

This would be great if you can share it here: For us it fails here, where it shows yellow, the script currently contains only EXIT 0
image

This would be great if you can share it here: For us it fails here, where it shows yellow, the script currently contains only EXIT 0 image

What's the output on your customization.log file?

it looks similiar to this. The VM WIN11! does not proceed it just stops and waits for the timeout in the template and than does the cleanup and deletes itself, here is a screenshot, where the VM is just waiting to execute that one single script:
image
in the pipeline you get something like this:
image

Seeing the same issue. Same set of customization work fine with Gen1 (Win10), but any powershell customisation steps fail on a Gen2 (Win11) run.

Attempts to run the PS, but sits and waits until the timeout and then moves to cleanup.

@StevybSC did you ever find a solution to this? Currently seeing the same behaviour too

So after further experimentation today, adding "runAsSystem": true to the PowerShell customiser appears to resolve this issue. By default, if it isn't specified the value is false. Changing this allowed my builds to continue without hanging