

























Overview:
A golden image is a prebuilt, approved system template that represents the ideal baseline for deployment. It includes:
Architecture:
Golden Image Refresh for VM Scale Sets (VMSS):
Instead of updating instances individually:
Virtual Machine Scale Set (VMSS) deployments use a custom image that is baked on top of a Golden Image.
The Golden Image version is pinned in the environment-specific Packer variables (pkrvariables) files.
Refreshing a VMSS Golden Image involves baking a new custom image using an updated Golden Image version and deploying it via the VMSS pipelines.
Image Dependency Flow
Golden Image Version Management (VMSS)
VMSS Golden Image Refresh Procedure
1.Select Golden Image Version
2. Update Packer Variables
3.Merge Changes
Custom Image Creation
VMSS Deployment
Once the custom image is successfully created, deploy it using one of the following approaches:
Option 1: Operational Pipeline
option 2: Infrastructure Pipeline Update
Terraform Behavior
Validation and Verification
After deployment:
Image Team will provide the golden image and then we need to create custom image.
After retrieval of Custom image used in Infra code.
The Golden image refresh in infra code, requires a activity which is called upgrade and there are 2 kinds of upgrade in VMSS :
Automatic upgrade - VMSS instances will upgrade automatically, and this requires downtime.
All VMSS instances will start upgrading simultaneously and application will be down till VMSS instances is up and running.
Manual upgrade - VMSS instances need to be manually upgraded, and this requires 10 - 15 minutes of degradation.
As part of this Upgrade - we need to manually upgrade VMSS instance one by one and so other instances will be up. There will be no downtime for the application.
Bydefault VMSS will consider automatic upgrade which requires downtime. If we do not require Automatic upgrade then we need to change the setting in provider like below.
provider "azurerm" {
features {
virtual_machine_scale_set {
reimage_on_manual_upgrade = false
roll_instances_when_required = false
}
}
After updating above code in provider.tf as part of manual upgrade then update the terraform code for new golden image.
Example:
source_image_id = "/subscriptions/subscriptionid/resourceGroups/rgname/providers/Microsoft.Compute/images/confluence-prd-v-24052450"
data_disks = [
{
storage_account_type = "Premium_LRS"
caching = "ReadWrite"
create_option = "FromImage"
lun = 0
disk_size_gb = "500"
disk_encryption_set_id = null
ultra_ssd_disk_iops_read_write = null
ultra_ssd_disk_mbps_read_write = null
}
]
instances = 3
automatic_instance_repair = [{
enabled = false
grace_period = "PT30M"
}]
computer_name_prefix = "Appname-prd"
overprovision = false
edge_zone = null
health_probe_id = null
upgrade_mode = "Manual"
single_placement_group = true
secure_boot_enabled = false
Apply Terraform Configuration: Run terraform apply to apply the updated configuration. This will update the scale set to use the new image.
After the Apply - Upgrade type is Manual then upgrade the VMSS instances one by one to make the service up and running.
Golden Image Refresh for VM Scale Sets (VM)
Scope
For RHEL 7.9 , there is no golden image hence needs to create custom image. To refresh the image, change the image from (example from 1.0 to 1.1)
Resource Changes (VMTRF):
RHEL 8.10
To refresh the image, change the image from (example from 1.0 to 1.1)
Resource Changes (VM STD):
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。