Traditionally IT Admins have been using a concept of a Gold Image to deploy a consistent server environment within their organization. In Oder to create a gold image template, they first install an operating system in a VM and then install all the organizational prerequisites on this VM and finally Sysprep the VM to create it as an image.
once a gold image template is created, this image can be reused for deploying multiple VMs with the same configuration and consistency. Azure also supports the concept of gold image to deploy a desired and consistent environment.
- VM Image will be created at the same Azure Datacenter where the captured VM was running
- if you deploy workloads to multiple Azure regions, create multiple VM images for multiple Azure Regions
- Newly created VMs from VM Image will only use Azure managed disk
- Windows update for VM image isn’t possible. you will need to update the newly created VM immediately after its creation
Let’s create a gold image step by step –
Create a new Azure VM. I installed a new VM with Windows 2012 R2 operating system
Once VM is installed, Install all the prerequisites required for your organization, I installed .Net framework 3.5 from add/remove features
Login to newly created VM and open a command prompt and Sysprep the VM by running:
Select the options as shown in print screen. this will shutdown the VM once syspreped is completed
Login to Azure portal. select the VM which was recently syspreped and select Capture from the options
Use following option:
- Provide a name for the Image – Use a meaningful name
- Select the resource Group
- Select Automatically delete this virtual machine after creating the image
Once completed, Syspreped VM will be deleted. open the Azure portal and navigate to Image.
Since my VM was running in southeast Asia. a new VM Image is also created at Southeast Asia
Select the Image and it will allow to create a new VM from this image
New VM can only be created at the same location where the Image is. this cant be changed
New VM can only use Azure managed disk
Once completed a new VM will be created from the VM Image. You can repeat these steps to create multiple VMs from this gold image.