private void PowerOff(SimReserved simulator) { Thread.CurrentThread.SetName(simulator.AssetId); UpdateItemStatus(simulator, "Checking power status..."); if (VMController.IsPoweredOn(simulator.VirtualMachine)) { if (JediSimulatorManager.IsSimulatorReady(simulator.HostAddress)) { UpdateItemStatus(simulator, "Shutting down simulator..."); JediSimulatorManager.ShutdownSimulator(simulator.VirtualMachine); UpdateItemStatus(simulator, "Simulator Shutdown complete."); } UpdateItemStatus(simulator, "Powering Off VM..."); VMController.Shutdown(simulator.VirtualMachine); UpdateItemStatus(simulator, "Power Off complete."); } else { UpdateItemStatus(simulator, "Already powered off."); } }
/// <summary> /// Performs a guest shutdown on a VM. /// </summary> /// <param name="wait">if set to <c>true</c> [wait until powered off].</param> public void Shutdown(bool wait = true) { VMController.Shutdown(Name, wait); }