The start, shut down or restart sequence of vRealize Automation (vRA) isn’t that difficult, but if you throw in a load balancer or if you have a bigger distributed vRA environment then things get interesting.
Load Balancer
When you are using a load balancer in your configuration you need to check your load balancer for what kind of “health monitor” you are using for the vRA Appliances. Because if you are using the vRA Appliance service “health monitor”, you need to change it to just plain old ICMP or the vRA service won’t come online after a cold boot.
Start vRealize Automation
When you start vRA after a power outage or a controlled shut down, you must start the vRA components in this specified order :
- Boot the MSSQL Server / Cluster
- Wait until Service is up
- Boot the PostgresSQL Server / Cluster
- Wait until Service is up
- Boot the Identity Appliance or SSO Server
- Wait until Service is up
- Boot the Primary vRealize Appliance
- Wait until VM is up
- Boot the optional Secondary vRealize Appliance
- Wait until VM is up
- Boot the Primary Web Server
- Wait until VM is up
- Boot the optional Secondary Web Server
- Wait until VM is up and wait 5 minutes
- Boot all the Manager Servers
- Wait until VMs are up and wait 2-5 minutes
- Boot all the vRealize Automation Agent Servers
- Wait until VMs are up
- Boot all the Distributed Excecution Manager Orchestrator / Worker Servers
- Wait until VMs are up
Shut Down vRealize Automation
When you want to do a controlled shut down of vRA, you must shut down the vRA components in this specified order :
- Shut Down all the Distributed Excecution Manager Orchestrator / Worker Servers
- Wait until VMs are down
- Shut Down all the vRealize Automation Agent Servers
- Wait until VMs are down
- Shut Down all the Manager Servers
- Wait until VMs are down
- Shut Down the optional Secondary Web Server
- Wait until VM is down
- Shut Down the Primary Web Server
- Wait until VM is down
- Shut Down the optional Secondary vRealize Appliance
- Wait until VM is down
- Shut Down the Primary vRealize Appliance
- Wait until VM is down
- Shut Down the MSSQL Server / Cluster
- Wait until VM is down
- Shut Down the PostgresSQL Server / Cluster
- Wait until VM is down
- Shut Down the Identity Appliance or SSO Server
- Wait until VM is down
Restart vRealize Automation
I noticed that the documentation of VMware says that it is possible to restart the different components, but in the field I had some “challenges” with this method… So nowadays I just shut everything down and start everything from scratch. This way I know for sure all the services will come online OK.
To do this just follow the shut down sequence and the start sequence above. Or use this simple PowerCLI script below that shuts down the VMs and starts them again in the appropriate order. Because almost no vRA deployment is the same please check the VM names and maybe add or remove some lines if necessary.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
Function PowerOn ($VMName) { Write-Host "Starting : " $VMName Start-VM -VM $VMName -RunAsync -Confirm:$false | Out-Null Write-Host "Checking : " $VMName do{ Start-Sleep -Seconds 5; $VM = Get-VM $VMName $ToolsStatus = $VM.extensionData.Guest.ToolsStatus; Write-Host "Status : " $ToolsStatus }while($ToolsStatus -ne "toolsOk"); Write-Host -ForegroundColor Green "Done Booting : " $VMName } Function Shutdown ($VMName) { Write-Host "Shutting Down : " $VMname $VM = Get-VM -Name $VMName if($VM.PowerState -eq "PoweredOn"){ Shutdown-VMGuest -VM $VMName -confirm:$false | Out-Null do{ Start-Sleep -Seconds 5; $VM = Get-VM $VMName Write-Host "Status : " $VM.PowerState }while($VM.PowerState -eq "PoweredOn"); } Write-Host -ForegroundColor Green "Done Shutting Down : " $VMName } # VM name variables, if VM is not available please remove only the VM name $vRA_IdentitySSO = "VRIA001" $vRA_Appliance1 = "VRAP001" $vRA_Appliance2 = "VRAP002" $vRA_WebServer1 = "VRWS001" $vRA_WebServer2 = "VRWS002" $vRA_ManagerServer1 = "VRMS001" $vRA_ManagerServer2 = "VRMS002" $vRA_DEM1 = "VRDS001" $vRA_DEM2 = "VRDS002" $vRA_ProxyAgent1 = "VRPA001" $vRA_ProxyAgent2 = "VRPA002" # Read vCenter $vCenter = Read-Host "vCenter" # Read vCenter Username $vCenterUsername = Read-Host "vCenter Username" # Read vCenter Password with a little bit of security ;) $vCenterPassword = Read-Host -AsSecureString "vCenter Password" # Convert Password $BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($vCenterPassword) $vCenterPassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR) # Connect to vCenter Write-Host "Connecting to vCenter" Connect-VIServer $vCenter -User $vCenterUsername -Password $vCenterPassword -ErrorAction Stop | Out-Null # Shut Down VMs if($vRA_ProxyAgent2){ Shutdown $vRA_ProxyAgent2 } if($vRA_ProxyAgent1){ Shutdown $vRA_ProxyAgent1 } if($vRA_DEM2){ Shutdown $vRA_DEM2 } if($vRA_DEM1){ Shutdown $vRA_DEM1 } if($vRA_ManagerServer2){ Shutdown $vRA_ManagerServer2 } if($vRA_ManagerServer1){ Shutdown $vRA_ManagerServer1 } if($vRA_WebServer2){ Shutdown $vRA_WebServer2 } if($vRA_WebServer1){ Shutdown $vRA_WebServer1 } if($vRA_Appliance2){ Shutdown $vRA_Appliance2 } if($vRA_Appliance1){ Shutdown $vRA_Appliance1 } if($vRA_IdentitySSO){ Shutdown $vRA_IdentitySSO } # Starting VMs if($vRA_IdentitySSO){ PowerOn $vRA_IdentitySSO } if($vRA_Appliance1){ PowerOn $vRA_Appliance1 Write-Host "Waiting for 2min" Sleep 120 } if($vRA_Appliance2){ PowerOn $vRA_Appliance2 Write-Host "Waiting for 5min" Sleep 300 } if($vRA_WebServer1){ PowerOn $vRA_WebServer1 if($vRA_WebServer2){ PowerOn $vRA_WebServer2 } Write-Host "Waiting for 5min" Sleep 300 } if($vRA_ManagerServer1){ PowerOn $vRA_ManagerServer1 if($vRA_ManagerServer2){ PowerOn $vRA_ManagerServer2 } Write-Host "Waiting for 5min" Sleep 300 } if($vRA_DEM1){ PowerOn $vRA_DEM1 } if($vRA_DEM2){ PowerOn $vRA_DEM2 } if($vRA_ProxyAgent1){ PowerOn $vRA_ProxyAgent1 } if($vRA_ProxyAgent1){ PowerOn $vRA_ProxyAgent2 } |
Hi Marco,
Do you happen to have a script for vRA 7.0.1?
Hi Sean,
You can use the same script but be sure to leave the variable $vRA_IdentitySSO empty the rest is still the same!
Marco
Hi Marco,
Can I use the same script for vRA 7.5 as well?