Reputation: 363
I have successfully created a non-CIS virtual machine from the Azure marketplace (Windows Server 2022 Datacenter -x64 Gen2).
The objective is take a CIS image and use Azure Image Builder to create a golden (base) image.
From what I have tried and read, it doesn’t look like it’s possible to take a CIS L1 or L2 Azure marketplace image and customize it with Azure Image Builder:
CIS Windows 2019 Azure Images not supported by Packer
I am hoping the work-around is that we:
In step #5, I started with the Source looking like this:
"source": {
"type": "SharedImageVersion",
"imageVersionID": "/subscriptions/somesubid/resourceGroups/myRg/providers/Microsoft.Compute/galleries/mygal/images/mywinimage/versions/latest"
},
Encountered a deployment failure.
VMMarketplaceInvalidInput : Creating a virtual machine from Marketplace image or a custom image sourced from a Marketplace image requires Plan information in the request.
I am unable to find documentation on what does SharedImageVersion looks like with planInfo.
Here’s my guess:
"source": {
"type": "SharedImageVersion",
"imageVersionID": "/subscriptions/somesubid/resourceGroups/myRg/providers/Microsoft.Compute/galleries/mygal/images/mywinimage/versions/latest",
"planInfo": {
"planName": "cis-windows-server-2022-l1",
"planProduct": "cis-windows-server-2022-l1-gen2",
"planPublisher": "center-for-internet-security-inc"
}
},
Again, got the same error:
VMMarketplaceInvalidInput : Creating a virtual machine from Marketplace image or a custom image sourced from a Marketplace image requires Plan information in the request.
Do you know how it should look like for SharedImageVersion for plan info or is there another approach?
TIA!
Upvotes: 1
Views: 1170
Reputation: 5560
Created Azure virtual machine non-cis and generalized the vm:
To generalize vm -> connect with virtual machine -> Win+R -> type sysprep and select generalize and shutdown like below:
Deallocated the virtual machine click on capture to create an image.
In the image create a gallery or select existing gallery, in the target vm image definition create a custom image with Publisher, offer, SKU like below:
Once deployed on your resource group in vm definition click on version you can create custom image vm directly.
Or you can create a virtual machine, in image select shared image like below:
Now, custom image sourced from a Marketplace image deployed successfully like below:
Upvotes: 0