Task 15: Complete Combined Script (All Steps)
The automated OS configuration run covers this task in every step of this phase, for every node, in one run, with method detection, a plan, an approval gate and a verification pass. Use the manual steps below when you can't use the run, or to understand or troubleshoot what it does. See how the run works.
DOCUMENT CATEGORY: Runbook SCOPE: Optional combined script that runs Tasks 02–10 in a single execution for fast... PURPOSE: Optional combined script that runs Tasks 02–10 in a single execution for faster deployment MASTER REFERENCE: Azure Local Pre-deployment Checklist
Status: Active
Overview
Optional combined script that runs Tasks 02–10 in a single execution. Use this instead of running each task individually if preferred.
Tasks 11–14 are not included in this combined script — they are conditional and must be run separately when applicable. Task 11 applies to redeployments on existing hardware; Tasks 12–14 apply only to SAN disaggregated deployments.
The OS configuration reaches the nodes over WinRM. Complete Task 01 (Enable WinRM) on each node first, by console or SConfig, unless os_configuration.remoting.bootstrap_transport lets the run reach a node that does not answer over WinRM yet.
Prerequisites
| Requirement | Details |
|---|---|
| Task 01 complete on all nodes | WinRM enabled via console/SConfig |
infrastructure.yml populated | All node IPs, hostnames, network values set |
Values from infrastructure.yml
The values for this task come from infrastructure.yml (schema 5). Every key, with its type, default and example, is in the variables reference.
- Direct (On Node)
- Orchestrated Script
Run locally on each node. Set all REPLACE_ variables before running.
# Task 15 - Complete Combined Script (direct, run on each node)
# Set all REPLACE_ variables before running
$StaticIP = "REPLACE_WITH_STATIC_IP" # nodes[].network_adapters[].ip_address
$Gateway = "REPLACE_WITH_GATEWAY" # networking.management.gateway
$PrefixLength = 24 # network.management.prefix
$DNSPrimary = "REPLACE_WITH_DNS_PRIMARY" # networking.management.dns_servers
$DNSSecondary = "REPLACE_WITH_DNS_SECONDARY" # networking.management.dns_servers
$NTPServer = "REPLACE_WITH_NTP_SERVER" # ntp.server
$NewHostname = "REPLACE_WITH_HOSTNAME" # nodes[].name
if ($StaticIP -match "^REPLACE_" -or $NewHostname -match "^REPLACE_") {
Write-Host "Set all REPLACE_ variables before running" -ForegroundColor Red; exit 1
}
# Task 02 - Enable RDP
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections -Value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
# Tasks 03-04 - Static IP / Disable DHCP
$adapter = Get-NetAdapter | Where-Object { $_.Status -eq "Up" } | Select-Object -First 1
Set-NetIPInterface -InterfaceIndex $adapter.ifIndex -Dhcp Disabled
Get-NetIPAddress -InterfaceIndex $adapter.ifIndex -AddressFamily IPv4 -ErrorAction SilentlyContinue | Remove-NetIPAddress -Confirm:$false
New-NetIPAddress -InterfaceIndex $adapter.ifIndex -IPAddress $StaticIP -PrefixLength $PrefixLength -DefaultGateway $Gateway
# Task 05 - DNS
Set-DnsClientServerAddress -InterfaceIndex $adapter.ifIndex -ServerAddresses @($DNSPrimary, $DNSSecondary)
# Task 07 - NTP
w32tm /config /manualpeerlist:$NTPServer /syncfromflags:manual /update | Out-Null
Restart-Service w32time
w32tm /resync | Out-Null
# Task 08 - ICMP
Enable-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)"
# Task 09 - Disable unused adapters
Get-NetAdapter | Where-Object { $_.Status -eq "Disconnected" } | Disable-NetAdapter -Confirm:$false
Get-NetAdapter | Format-Table Name, Status, LinkSpeed -AutoSize
# Task 10 - Hostname
Rename-Computer -NewName $NewHostname -Force
Write-Host "Restart required to apply the hostname change. Run Restart-Computer -Force when you are ready."
PowerShell
One script for every step. The earlier combined scripts of the task folder (
Invoke-Phase03OsConfiguration-Orchestrated.ps1andStart-Phase03OsConfiguration.ps1) are removed. The OS configuration replaces them.
Script
| Script | What it does |
|---|---|
scripts/deploy/04-cluster-deployment/phase-03-os-configuration/Invoke-AzureLocalOsConfiguration.ps1 | OS configuration for a whole Azure Local instance in one run: every node, plan, apply, verify, one report. It runs Set-AzureLocalNodeConfiguration.ps1 for each node, which reads the node, changes only what differs from infrastructure.yml, and reports. |
The steps are RemoteManagement, Sbe, Drivers, NicNames, Network, Dns, Time, Hostname, UnusedAdapters, DomainJoin, LocalAdmin, Mpio, SanVerify, ClearStorage and ArcRegistration. Without -Step the run does the steps of each node's method.
The nodes' local administrator comes from identity.local_admin of infrastructure.yml (the password is a secret reference), or from -Credential. The script never prompts. Run settings go in a JSON file given with -SettingsFile.
Run
# Plan (the default): read every node and list what would change
./Invoke-AzureLocalOsConfiguration.ps1 -InfrastructureFile ./infrastructure.yml -ReportDirectory ./out
# Apply
./Invoke-AzureLocalOsConfiguration.ps1 -InfrastructureFile ./infrastructure.yml -Mode Apply -ReportDirectory ./out
Exit codes: 0 every node converged; 1 a node failed, is blocked or did not converge; 2 bad input or nothing reachable. See how the run works.
Validation Checklist
- All nodes restarted successfully
- Hostnames match
infrastructure.yml - Static IPs set and DHCP disabled
- DNS resolves correctly
- NTP synchronized
- ICMP responds from all nodes
Troubleshooting
| Issue | Cause | Resolution |
|---|---|---|
| Script fails on one node but succeeds on others | WinRM connectivity issue or credential mismatch | Verify Enter-PSSession -ComputerName <node> works; re-run Enable-PSRemoting -Force on the failing node |
| Hostname not changed after reboot | Rename-Computer requires a restart to take effect | Confirm the script includes -Restart flag; manually reboot if needed: Restart-Computer -Force |
| Static IP not applied | DHCP still enabled on the management adapter | Run Set-NetIPInterface -InterfaceAlias "Management" -Dhcp Disabled before assigning the static IP |
| DNS resolution fails after configuration | DNS server addresses not set or wrong order | Verify with Get-DnsClientServerAddress; re-run the DNS configuration step with correct IPs from infrastructure.yml |
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
← Task 11: Clear Storage (S2D) · ← Task 14: Verify LUN Presentation (SAN) · ↑ Phase 03 · Task 16: Verification →
Version Control
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0.0 | 2025-03-25 | Azure Local Cloud | Initial release |