« Previous | Next » 

Revision b705748e

IDb705748e5e08a456a7686a9cb92553d476e1aa8b

Added by Christos Stavrakakis almost 7 years ago

cyclades: Check VM state when getting vnc console

vncauthproxy will return error status if the instance is not running.
Cyclades check that the VM in marked as started in DB before allowing a
console action. However, the VM may be stopped without Cyclades knowing
it (unsynced state). This commit fixes this issue by checking the VM is
actually running, by looking the 'oper_state' field in the result of the
query, that is already performed to get the instance host and port. In
case the VM is stopped, state is reconciled by issuing a mocked
'OP_INSTANCE_SHUTDOWN' Ganeti job, that will take care of state and
quotas.

Also, remove use of 'TEST' setting that was used for unittests. Instead,
properly mock Ganeti and vncauthproxy responses.

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences