How To Config VM Power On Sequence Or Config Delay | Nutanix Community
Skip to main content
Solved

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.

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
}

 

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

3 replies

Forum|alt.badge.img+2
  • Trailblazer
  • 28 replies
  • 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
  • 2 replies
  • June 14, 2021

 Please show me how to config please.


Forum|alt.badge.img+2
  • Trailblazer
  • 28 replies
  • 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
}