Skip to main content
Answer

How To Config VM Power On Sequence Or Config Delay

  • June 9, 2021
  • 3 replies
  • 1434 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.

Best answer by EricUMD

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
}

 

This topic has been closed for replies.

3 replies

Forum|alt.badge.img+2
  • Trailblazer
  • June 10, 2021

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


  • Author
  • Voyager
  • June 14, 2021

 Please show me how to config please.


Forum|alt.badge.img+2
  • Trailblazer
  • Answer
  • June 14, 2021

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
}