Solved

How To Config VM Power On Sequence Or Config Delay

  • 9 June 2021
  • 3 replies
  • 771 views

My customer ask me about how to config vm power on sequence when start cluster 
Example 
Domain Controllers power on first
Exchange Server power on second
Application Server power on third

My customer have only PE.

Thank you for answer the questions.

icon

Best answer by EricUMD 14 June 2021, 19:52

View original

This topic has been closed for comments

3 replies

Userlevel 2
Badge +2

This could be accomplished through a powershell script with the Nutanix Cmdlets or with something that accesses the REST API of Prism.

 Please show me how to config please.

Userlevel 2
Badge +2

Install the Nutanix Powershell Cmdlets from the Prism console on to a system that can access the cluster. And then the script is fairly straight forward.

  1. Connect to cluster
  2. Power on first VM
  3. Wait for a set number for minutes or use a ping command to determine network status
  4. Power on second VM
  5. Repeat steps 3 and 4

Below is some fairly crude code that should work.

[cmdletbinding]
param(
[Parameter(mandatory=$true)][String[]]$VMNames
)

$ntnxpsLoaded = Get-PSSnapin -Name NutanixCmdletsPSSnapin -ErrorAction SilentlyContinue | %($_.Name)
if($ntnxpsLoaded -eq $null) {
Add-PSSnapin -Name NutanixCmdletsPSSnapin
}
Connect-NTNXCluster -Server <DNS/IP> -UserName <acct> -Password (Get-Credential).Password
foreach ($VM in $VMNames) {
Set-NTNXVMPowerOn -vmid (Get-NTNXVM -SearchString $VM).vmid
Start-Sleep -Seconds 300
}