public override void powerOn(cancellableDateTime connectDeadline) { while (true) { if (getPowerStatus() == true) { break; } refCount <hypervisor_iLo_HTTP> ilo; lock (_ilos) { ilo = _ilos[_spec.iLoHostname]; } lock (ilo) { ilo.tgt.powerOn(); } connectDeadline.doCancellableSleep(TimeSpan.FromSeconds(5)); } // Wait until the host is up enough that we can ping it... waitForPingability(true, connectDeadline); // Now wait for it to be up enough that we can psexec to it. doWithRetryOnSomeExceptions(() => { _executor.testConnectivity(); return(0); }, connectDeadline); }
public override void powerOn(cancellableDateTime deadline) { // Sometimes I am seeing 'the attempted operation cannot be performed in the current state (Powered on)' here, // particularly under load, hence the retries. doWithRetryOnSomeExceptions(() => { VirtualMachine VM = VClient.getMachine(); if (VM.Runtime.PowerState == VirtualMachinePowerState.poweredOn) { return; } VM.PowerOnVM(VM.Runtime.Host); }, deadline, TimeSpan.FromSeconds(5)); // Wait for it to be ready if (_executionMethod == clientExecutionMethod.vmwaretools) { while (true) { VirtualMachine VM = VClient.getMachine(); if (VM.Guest.ToolsRunningStatus == VirtualMachineToolsRunningStatus.guestToolsRunning.ToString()) { break; } deadline.doCancellableSleep(TimeSpan.FromSeconds(3)); } } // No, really, wait for it to be ready doWithRetryOnSomeExceptions(() => { executor.testConnectivity(); return(""); }, deadline, TimeSpan.FromSeconds(5)); }