Task 11: Deploy Management VMs
DOCUMENT CATEGORY: Runbook
SCOPE: Management VM provisioning
PURPOSE: Deploy all management VMs from Azure Marketplace images
MASTER REFERENCE: Microsoft Learn - Create VM
Status: Active
Overview
This task deploys all five management VMs needed for the Azure Local environment. Each VM is deployed from Azure Marketplace images into the management subnet. OS-level configuration (AD DS, utilities, etc.) is handled in Tasks 12–16.
Execution Target: Azure-Only (control-plane API operation) Tab Profile: 3 tabs — Azure Portal · PowerShell · Azure CLI
VM admin passwords are stored in Key Vault. Never hardcode passwords. Retrieve the admin password from keyvault://kv-{name}/azlocal-admin-password at deploy time.
Module: azurelocal-toolkit
Files: nic.tf, VM resources
Mode: Management
VMs to Deploy
| VM Key | Name | Role | OS | Size | IP | Config Path |
|---|---|---|---|---|---|---|
| dc01 | vm-azrldc-{env}-{region}-01 | Primary Domain Controller | Windows Server 2025 | Standard_D2s_v4 | Per config | landing_zone.virtual_machines[] |
| dc02 | vm-azrldc-{env}-{region}-02 | Secondary Domain Controller | Windows Server 2025 | Standard_D2s_v4 | Per config | landing_zone.virtual_machines[] |
| utility | vm-util-{env}-{region}-01 | Utility/Management Server | Windows Server 2025 | Standard_D2as_v6 | Per config | landing_zone.virtual_machines[] |
| ndm | vm-ndm-{env}-{region}-01 | NDM (SYSLOG/SNMP) | Ubuntu 24.04 LTS | Standard_D2s_v4 | Per config | landing_zone.virtual_machines[] |
| lighthouse | vm-lh-{env}-{region}-01 | Lighthouse Central Mgmt | OpenGear Lighthouse | Standard_D2s_v4 | Per config | landing_zone.virtual_machines[] |
Prerequisites
- Task 01: Virtual Network completed — Management subnet exists
- Task 10: Key Vault completed — Admin password stored in Key Vault
- VM sizes available in target region (check quotas)
- Marketplace terms accepted for OpenGear Lighthouse image (if deploying)
Values from infrastructure.yml
The script reads these keys from infrastructure.yml (schema 5). Each key, with its type, default and example, is in the variables reference.
azure.tenant_id, azure.location, tags
landing_zone.virtual_machines[]: name, hostname, role, deploy_target, subscription, resource_group, network, subnet, private_ip, size, os,
admin_username, admin_password
landing_zone.networks[].name, .subscription, .resource_group, .location where the network is
landing_zone.subscriptions[].name, .id the subscription that holds the network
Keys added in registry 5.0.62 (schema 5.6.28, all optional) for the Terraform compute module and the Ansible domain-controller role, so that neither keeps a value of its own:
| Key | What it is | Default |
|---|---|---|
landing_zone.virtual_machines[].os_disk_size_gb | Size of the OS disk in GB (VMs in Azure) | 128 |
landing_zone.virtual_machines[].os_disk_type | Storage type of the OS disk: Standard_LRS, StandardSSD_LRS, StandardSSD_ZRS, Premium_LRS, Premium_ZRS | Premium_LRS |
landing_zone.virtual_machines[].os_disk_caching | Caching of the OS disk: None, ReadOnly, ReadWrite | ReadWrite |
landing_zone.virtual_machines[].image_version | Version of the Marketplace image of os: latest, or a version such as 26100.1234.250101 | latest |
landing_zone.virtual_machines[].dc_promotion | For a machine with role domain_controller: new_forest (the first domain controller: it creates the forest of identity.active_directory.domain_fqdn) or replica | |
landing_zone.virtual_machines[].dsrm_password | For a machine with role domain_controller: a Key Vault reference (keyvault://<vault>/<secret>) to the Directory Services Restore Mode password; the role reads it on the controller and never generates one | |
identity.active_directory.forest_functional_level, .domain_functional_level | Functional levels of a new forest and its domain that the Ansible domain-controller role creates: WinThreshold or Win2025 | WinThreshold |
identity.active_directory.dns_forwarders | DNS forwarders of the domain controllers the role promotes; when empty, Azure DNS for a VM in Azure only |
Single Subscription Model
Landing Zone Placement
| Field | Value | Config Path |
|---|---|---|
| Subscription | Customer subscription | landing_zone.subscriptions[].id |
| Resource Group | rg-azrlmgmt-{env}-{region}-01 | landing_zone.virtual_machines[] |
| Subnet | Management subnet | landing_zone.virtual_machines[] |
Execution Options
- Azure Portal
- Orchestrated Script
- Azure CLI
Azure Portal
When to use: Learning Azure Local, single deployment, prefer visual interface
Procedure (repeat for each VM)
- Create Virtual Machine:
- Search for Virtual machines → + Create → Azure virtual machine
-
Basics: | Field | Value | Source | |-------|-------|--------| | Name | Per VM table above |
landing_zone.virtual_machines[]| | Region | Your region |landing_zone.virtual_machines[]| | Image | Per VM table |landing_zone.virtual_machines[]| | Size | Per VM table |landing_zone.virtual_machines[]| | Username |azureadmin| Standard | | Password | From Key Vault |keyvault://<vault>/azlocal-admin-password| -
Disks: | Field | Value | Source | |-------|-------|--------| | OS disk type | Premium SSD |
landing_zone.virtual_machines[].os_disk_type(Terraform route; defaultPremium_LRS) | | OS disk size | Per config |landing_zone.virtual_machines[].os_disk_size_gb(Terraform route; default 128) | -
Networking: | Field | Value | Source | |-------|-------|--------| | Virtual network | Management VNet |
landing_zone.networks[].name| | Subnet | Management subnet |landing_zone.virtual_machines[]| | Public IP | None | No public IPs on mgmt VMs | | NIC name | Per config |landing_zone.virtual_machines[]| -
Advanced → IP Configuration: Set static private IP: | Field | Value | Source | |-------|-------|--------| | Private IP | Static |
landing_zone.virtual_machines[]| -
Review + create: Verify → Click Create
-
Repeat for all 5 VMs
Validation
- All 5 VMs provisioning state: Succeeded
- Each VM has correct static private IP
- No public IPs assigned
- All VMs accessible via Bastion (Task 05)
Links
PowerShell
When to use: Run the task from a management workstation or a pipeline. The script reads
infrastructure.ymland carries no values of its own.
Script
| Script | What it does |
|---|---|
scripts/deploy/02-azure-foundation/phase-04-azure-management-infrastructure/02-manual-deployment/task-11-deploy-management-vms/powershell/Deploy-ManagementVMs.ps1 | Creates the management virtual machines that landing_zone.virtual_machines of infrastructure.yml lists for Azure. Supports -WhatIf. |
Requires: PowerShell 7.
Run
./Deploy-ManagementVMs.ps1 -InfrastructureFile ./infrastructure.yml -WhatIf
Azure CLI
When to use: Run the task from a host that has the Azure CLI and not the Az PowerShell modules. The script is PowerShell 7 that calls
az; it readsinfrastructure.ymland carries no values of its own.
Script
| Script | What it does |
|---|---|
scripts/deploy/02-azure-foundation/phase-04-azure-management-infrastructure/02-manual-deployment/task-11-deploy-management-vms/azurecli/Deploy-ManagementVMs.azcli.ps1 | Creates the management virtual machines that landing_zone.virtual_machines of infrastructure.yml lists for Azure, with the Azure CLI. Supports -WhatIf. |
Requires: PowerShell 7 and the Azure CLI, signed in with az login --tenant <azure.tenant_id>.
It creates a network interface with the static address of the entry and the machine on it; entries whose deploy_target is azure_local or onprem are skipped. It installs nothing inside the machine: Active Directory, DNS and the rest are set up in the guest afterwards. The administrator password is a secret reference, read at run time (a keyvault:// reference with az keyvault secret show). az vm create takes the password as an argument, so it is on the command line of that one az process for the seconds the call lasts. On Windows az is a batch file (az.cmd), which reads &, |, <, >, ^, % and " in an argument as commands or variables. The script refuses a secret or any value from the file that holds one of them (exit code 2) and sends nothing to Azure; choose a secret without them. -WhatIf does not read the password.
Run
./Deploy-ManagementVMs.azcli.ps1 -InfrastructureFile ./infrastructure.yml -WhatIf
./Deploy-ManagementVMs.azcli.ps1 -InfrastructureFile ./infrastructure.yml
Validation
- All 5 VMs running
- Correct static IPs assigned
- No public IPs
- Bastion connectivity works to each VM
CAF/WAF Landing Zone Model
In the CAF/WAF model, management VMs are deployed in the Management subscription in a spoke VNet peered to the Hub.
Landing Zone Placement
| Field | Value | Config Path |
|---|---|---|
| Subscription | Management subscription | landing_zone.subscriptions[].id |
| Resource Group | rg-azrlmgmt-{env}-{region}-01 | landing_zone.virtual_machines[] |
| VNet/Subnet | Management spoke | May differ from single-sub |
Execution Options
- Azure Portal
- Orchestrated Script
- Azure CLI
Azure Portal
Follow the same procedure, targeting the Management subscription and spoke VNet.
PowerShell
When to use: Run the task from a management workstation or a pipeline. The script reads
infrastructure.ymland carries no values of its own.
Script
| Script | What it does |
|---|---|
scripts/deploy/02-azure-foundation/phase-04-azure-management-infrastructure/02-manual-deployment/task-11-deploy-management-vms/powershell/Deploy-ManagementVMs.ps1 | Creates the management virtual machines that landing_zone.virtual_machines of infrastructure.yml lists for Azure. Supports -WhatIf. |
Requires: PowerShell 7.
Run
./Deploy-ManagementVMs.ps1 -InfrastructureFile ./infrastructure.yml -WhatIf
Azure CLI
When to use: Run the task from a host that has the Azure CLI and not the Az PowerShell modules. The script is PowerShell 7 that calls
az; it readsinfrastructure.ymland carries no values of its own.
Script
| Script | What it does |
|---|---|
scripts/deploy/02-azure-foundation/phase-04-azure-management-infrastructure/02-manual-deployment/task-11-deploy-management-vms/azurecli/Deploy-ManagementVMs.azcli.ps1 | Creates the management virtual machines that landing_zone.virtual_machines of infrastructure.yml lists for Azure, with the Azure CLI. Supports -WhatIf. |
Requires: PowerShell 7 and the Azure CLI, signed in with az login --tenant <azure.tenant_id>.
It creates a network interface with the static address of the entry and the machine on it; entries whose deploy_target is azure_local or onprem are skipped. It installs nothing inside the machine: Active Directory, DNS and the rest are set up in the guest afterwards. The administrator password is a secret reference, read at run time (a keyvault:// reference with az keyvault secret show). az vm create takes the password as an argument, so it is on the command line of that one az process for the seconds the call lasts. On Windows az is a batch file (az.cmd), which reads &, |, <, >, ^, % and " in an argument as commands or variables. The script refuses a secret or any value from the file that holds one of them (exit code 2) and sends nothing to Azure; choose a secret without them. -WhatIf does not read the password.
Run
./Deploy-ManagementVMs.azcli.ps1 -InfrastructureFile ./infrastructure.yml -WhatIf
./Deploy-ManagementVMs.azcli.ps1 -InfrastructureFile ./infrastructure.yml
Validation
- VMs in Management subscription
- Reachable via Bastion from Connectivity Hub
Troubleshooting
| Issue | Root Cause | Remediation |
|---|---|---|
| VM size not available | Quota or region limitation | Request quota increase or change region |
| Marketplace terms not accepted | OpenGear Lighthouse requires acceptance | Set-AzMarketplaceTerms -Publisher opengear -Product lighthouse -Name lighthouse -Accept |
| Static IP conflict | IP already in use | Verify IP availability in subnet |
| Password too weak | Azure policy enforced | Use 12+ chars with upper, lower, number, special |
| NIC creation fails | Subnet NSG blocking | Check NSG rules on management subnet |
Alternatives
The procedures in this task use the methods shown in the tabs above. The toolkit is PowerShell 7 only and has no Bash scripts. A few tasks that act on Azure also have an Azure CLI script written in PowerShell. The script status page of the toolkit lists which task has which script.
Navigation
| Previous | Up | Next |
|---|---|---|
| Task 10: Key Vault | Manual Deployment Index | VM Configuration |
Version Control
- Created: 2025-09-15 by Hybrid Cloud Solutions
- Last Updated: 2026-03-03 by Hybrid Cloud Solutions
- Version: 4.0.0
- Tags: azure-local, virtual-machines, management, deployment
- Keywords: VM deployment, domain controller, utility server, NDM, Lighthouse, Azure VM
- Author: Hybrid Cloud Solutions
Version Control
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0.0 | 2025-03-25 | Azure Local Cloud | Initial release |