diff --git a/src/api/vm.coffee b/src/api/vm.coffee index cb70dcb10..252203462 100644 --- a/src/api/vm.coffee +++ b/src/api/vm.coffee @@ -383,7 +383,9 @@ exports.restart = -> # Attempts a clean reboot. xapi.call 'VM.clean_reboot', VM.ref catch error - throw error unless error[0] is 'VM_MISSING_PV_DRIVERS' + return unless error[0] is 'VM_MISSING_PV_DRIVERS' + + @throw 'INVALID_PARAMS' unless force xapi.call 'VM.hard_reboot', VM.ref @@ -430,7 +432,9 @@ exports.stop = -> # Attempts a clean shutdown. xapi.call 'VM.clean_shutdown', VM.ref catch error - throw error unless error[0] is 'VM_MISSING_PV_DRIVERS' + return unless error[0] is 'VM_MISSING_PV_DRIVERS' + + @throw 'INVALID_PARAMS' unless force xapi.call 'VM.hard_shutdown', VM.ref