How-to Deploy Windows Virtual Machines using a Golden Image, Templates and Guest OS Specification.
Introduction
In this How-to we will use a Golden Image, Templates, and Guest OS Specification to demonstrate an efficient virtual machine deployment process.
Before diving into the deployment process, let's briefly discuss the key components involved:
Golden Image: A Golden Image is a pre-configured and optimized VM that serves as a blueprint for creating new VMs. It includes the operating system, applications, patches, and configurations needed for your environment.
Templates: A virtual machine template is a main copy of a virtual machine that can be used to create and provision new virtual machines. Templates streamline the deployment process by ensuring consistent configurations across VMs.
Guest OS Specification: A Guest OS Specification is a set of customized settings that can be applied during the VM creation process, such as hostname, network configuration, time zone, and domain membership.
TLDR Steps:
Create a Golden Image Virtual Machine
Convert the Golden Image virtual machine to a template
Use the Golden Image Template to deploy VMs with Guest OS Customization Specification
Applying updates to VM Templates
Detailed step-by-step guide:
Create a Golden Image Virtual Machine:
VM Creation: Start by creating a new VM, either from scratch or by cloning an existing VM.
OS Installation: Install the Windows operating system on the VM, along with any necessary updates, patches, and drivers.
Application Installation: Install the required applications and software that will be included in the Golden Image.
Configuration: Configure the OS and applications according to your departments standards. This might include security settings, networking configurations, and other customizations.
Optimization: Fine-tune the VM for performance by optimizing settings, disabling unnecessary services, and cleaning up unnecessary files.
Sysprep: Run the System Preparation Tool (Sysprep) to generalize the VM, removing unique identifiers and preparing it for duplication.
Convert the Golden Image virtual machine to a template:
Login to the ITS Private Cloud Portal:
Click the pen icon to edit the Golden Image VM.
If the VM is powered on, toggle the Power Status button to turn it off and click UPDATE to apply.
Once the VM is powered off, convert the VM to Template by toggling the Template button and accepting the Template Message.
Congratulations you have created a Golden Image VM Template, it can now be used to efficiently deploy VMs!
Use the Golden Image Template to deploy VMs with Guest OS Customization Specification:
To create a new VM using the Template, start by clicking the + button in the top right.
On the SPECS page click Build From * field and select VM Template.
Click the Source Template* field and select your template from the drop down list.
Click the Name* field and enter a VM name, confirm the remaining setting on the page or make adjustments as required.
Click on the DISKS tab and confirm or adjust the settings
Click on the NETWORKS tab and confirm or adjust the settings
Click on the ADMIN tab and confirm or adjust the settings.
NOTE: All fields marked with an * must be filled in order to create the VM (confirm the Phone*).
Create the Guest OS Customization Specification in JSON format.
NOTE: Ensure the JSON is formatted properly, you can confirm the formatting with an online JSON viewer.
NOTE: The number of interfaces in the Specification must match the number of interfaces on the VM.
EXAMPLE 1: Set hostname, dns server, static IP address for one network interface card and timezone
NOTE: Microsoft uses numbered time zones, 35 is Eastern Standard Time Microsoft Time Zone Index Values
{
"hostname": "win2022-fm-template",
"domain": "dept.utoronto.ca",
"dns": [
"128.100.100.128"
],
"interfaces": [
{
"dhcp": false,
"ip": "10.1.1.101",
"mask": "255.255.255.0",
"gateway": [
"10.1.1.1"
]
}
],
"time_zone": 35
}
EXAMPLE 2: Set hostname, dhcp address for 2 network interface cards and timezone
{
"hostname": "win2022-fm-template",
"domain": "dept.utoronto.ca",
"interfaces": [
{
"dhcp": true,
},
{
"dhcp": true,
}
],
"time_zone": 35
}
Click on the OTHER tab select the Restore options, paste the Specification JSON (Example 1) in the input box and click CREATE.
Logging in to the virtual machine we can confirm the Guest OS Customization Specification was applied.
Applying updates to VM Templates:
Click the Menu button in the top right corner.
Select Templates from the Menu.
Find the template that needs to be updated and click the edit button.
Convert the Template to a VM by clicking the Template toggle button.
Once the Template has been converted to a VM, you can boot the
and apply updates or make configuration changes.
When the updates are complete, power down the VM and convert it back into a template.
Related articles
Guest OS customization runs on Windows Guests
Deploy and reconfigure Instance from Clone
Deploy and reconfigure Instance from Template
University of Toronto - Since 1827