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.
- Connect to cluster
- Power on first VM
- Wait for a set number for minutes or use a ping command to determine network status
- Power on second VM
- 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
}