admin管理员组

文章数量:1294340

I have a self hosted windows vmss with below source image for which docker is not installed by default.

source_image_reference {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2022-Datacenter"
version = "latest"
}

In order to install docker, every time I need to login to instance that was created in vmss and install it manually. If the instance was destroyed then again, I need to do the same for new instance and so on..

I used the custom script extension to install it through commands but that is not working because after execution of scripts, a vm instance should restart.

Is there any better way

I have a self hosted windows vmss with below source image for which docker is not installed by default.

source_image_reference {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2022-Datacenter"
version = "latest"
}

In order to install docker, every time I need to login to instance that was created in vmss and install it manually. If the instance was destroyed then again, I need to do the same for new instance and so on..

I used the custom script extension to install it through commands but that is not working because after execution of scripts, a vm instance should restart.

Is there any better way

Share asked Feb 12 at 13:07 user25982998user25982998 112 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

The best way to accomplish this is by creating a specialized image from one of your configured VMs. You can then store it in the Azure Compute Gallery and use it as the source for your VM scale set.

This approach ensures that all machines in the VMSS have the same image and configuration, aligning with Azure best practices.

I would strongly recommend you to take a closer look at following Azure documentation:

  • Create an image of a VM - https://learn.microsoft/en-us/azure/virtual-machines/capture-image-portal

  • Store or share images - https://learn.microsoft/en-us/azure/virtual-machines/shared-image-galleries?tabs=vmsource%2Cazure-cli

  • Create and use a custom image - https://learn.microsoft/en-us/azure/virtual-machine-scale-sets/tutorial-use-custom-image-powershell

本文标签: Docker on Azure windows VM Scale setStack Overflow