From 769ce02003db66419530eed7fdab7e5bc1e0b69d Mon Sep 17 00:00:00 2001 From: Jonny Rylands Date: Fri, 5 Jan 2024 17:10:21 +0000 Subject: [PATCH] Update start runbook to start core VMs --- CHANGELOG.md | 1 + docs/tre-admins/start-stop.md | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f79260fc5a..af5f7e54b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ FEATURES: ENHANCEMENTS: * Switch from OpenCensus to OpenTelemetry for logging ([#3762](https://github.com/microsoft/AzureTRE/pull/3762)) +* Extend PowerShell auto start script to start core VMs ([#3811](https://github.com/microsoft/AzureTRE/issues/3811)) * Use managed identity for API connection to CosmosDB ([#345](https://github.com/microsoft/AzureTRE/issues/345)) * Switch to Structured Firewall Logs ([#3816](https://github.com/microsoft/AzureTRE/pull/3816)) diff --git a/docs/tre-admins/start-stop.md b/docs/tre-admins/start-stop.md index f52a528b6e..2d60b46e60 100644 --- a/docs/tre-admins/start-stop.md +++ b/docs/tre-admins/start-stop.md @@ -122,7 +122,7 @@ foreach ($Group in $ResourceGroups) { ### Automating `start` -To restart the TRE core services (Firewall, Application Gateway(s), Virtual Machine Scale Sets, and MySQL), you can use `make tre-start`. Depending on your workflow, you might not be able to easily execute the `make` target. Alternatively, you can create a second Runbook and execute it manually. The PowerShell code to start TRE core services is below: +To restart the TRE core services (Firewall, Application Gateway(s), Virtual Machine Scale Sets, Virtual Machines, and MySQL), you can use `make tre-start`. Depending on your workflow, you might not be able to easily execute the `make` target. Alternatively, you can create a second Runbook and execute it manually. The PowerShell code to start TRE core services is below: ```powershell try { @@ -189,5 +189,12 @@ foreach ($Group in $ResourceGroups) { Write-Output "Starting VMSS '$($item.Name)'" Start-AzVmss -ResourceGroupName $item.ResourceGroupName -VMScaleSetName $item.Name } + + # Start VMs + $VM = Get-AzVM -ResourceGroupName $Group.ResourceGroupName + foreach ($item in $VM) { + Write-Output "Starting VM '$($item.Name)'" + Start-AzVm -ResourceGroupName $item.ResourceGroupName -Name $item.Name + } } ```