Add a new disk in Virtual Machine Scale Set

Victor Gomes 20 Reputation points
2023-07-31T12:20:19.09+00:00

Hello,

I have a Virtual Machine Scale Set which has Linux instance running only with the OS disk. This VM was deployed using a Image.

Now, I must added a new Data disk to this instance.

I know it's possible to do it manually in the instance or in the Virtual Machine Scale Set, but I want to know how can I do it in the image, for future instances or in the case of this VM be redeployed. Is it possible to create a image of the currently instance or do I have to generate a new VM from the image, add the new disk and create a new image?

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.
365 questions
{count} votes

Accepted answer
  1. Andriy Bilous 11,176 Reputation points MVP
    2023-07-31T14:28:42.1466667+00:00

    Hello @Victor Gomes

    Unfortunately you cannot create VM custom image directly from VMSS, but you can use existing custom image that is used by VMSS and modify it.

    High Level steps are:

    • Create and configure a source VM from VMSS custom image
    • Create an Azure Compute Gallery
    • Create a specialized image definition
    • Create an image version from above VM
    • Create a scale set from a specialized image
    • Share an image gallery

    https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/tutorial-use-custom-image-cli

    https://learn.microsoft.com/en-us/azure/devtest-labs/devtest-lab-create-custom-image-from-vm-using-portal

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful