I need to create custom VM Image out of single VM in Virtual Machine ScaleSet

Divyanshu Raj 20 Reputation points Microsoft Employee
2025-01-09T06:21:51.4233333+00:00

I need to create a custom cbl-mariner based image, to do that i need to first deploy a vm using vmss ( deploying a single vm is not recommended due to security reasons) and then customize it, post that need to generalize the vm and make Image out of it.

i also got to know that we cannot generalize vmss vms, so i am deploying another vm separately and attaching it to existing vmss created using arm template.

I need to do it using arm templates, however upon some tries i could not get satisfactory result.

what is the best way to achieve the above expectations.

Thank you

Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
424 questions
0 comments No comments
{count} votes

Accepted answer
  1. Nikhil Duserla 3,880 Reputation points Microsoft Vendor
    2025-01-09T13:26:18.6833333+00:00

    Hi @Divyanshu Raj,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    Yes, correct. If you want to create a custom image from a VM in a VMSS, you will need to deploy another VM separately and attach it to the existing VMSS. Then, you can customize the VM, generalize it, and create an image from it. Once the image is created, you can use it to create new VMs and VMSS.

    Firstly, remove machine specific information by deprovisioning or generalizing a VM before creating an image by going through this https://zcusa.951200.xyz/en-us/azure/virtual-machines/generalize.

    The best way to achieve the above expectations- Create and use a custom image for Virtual Machine Scale Sets with the Azure CLI

    If you have any further queries, do let us know. We are happy to assist you!

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.