Example #1
0
        /// <summary>
        /// Power off the virtual machine
        /// </summary>
        /// <returns>true if succeeded, otherwise false</returns>
        public bool PowerOff()
        {
            IJob jobHandle = m_vmHandle.PowerOff(VixCOM.Constants.VIX_VMPOWEROP_NORMAL, null);

            m_vixError = jobHandle.WaitWithoutResults();

            return(m_vixError == VixCOM.Constants.VIX_OK);
        }
Example #2
0
        public void PowerOff()
        {
            VixCOM.IJob job = _virtualMachine.PowerOff(0, null);
            UInt64      err = job.WaitWithoutResults();

            if (lib.ErrorIndicatesFailure(err))
            {
                short  errCode = lib.ErrorCode(err);
                string errMsg;
                errMsg = lib.GetErrorText(err, null);

                throw new Exception("PowerOff: " + errMsg);
            }
        }