Question

How To Config VM Power On Sequence Or Config Delay


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.


3 replies

Userlevel 1
Badge +1

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

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 1
Badge +1

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
}

 

Reply