public void Invoke() { try { IVimVm replicaVm = this._Vm(); if (replicaVm == null || !replicaVm.IsPoweredOn()) { return; } this._StopVm(replicaVm, this._VC(), this._Context.Logger, 120); } catch (Exception ex) { this._Logger.Warning(ex, "Exception caught powering down the replica. It may be down already and that's ok. Exception:"); } }
public void Invoke() { try { IVimVm vimVm = this._SourceVm(); if (vimVm == null || !vimVm.IsPoweredOn()) { return; } vimVm.PowerOff(this._ClientCtx()); } catch (Exception ex) { this._Logger.Warning(ex, "There was an exception powering off the VM, using backup strategy: "); this._ShutdownSource(); } }