Commit 26a93ba4 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Remove machine if ganeti job fails

Set the VM deleted flag when receiving a failure notification for a
Ganeti OP_INSTANCE_REMOVE operation, even if the VM operstate is not
ERROR. The server may not exist in the backend not only because the
creation failed, but also because a remove notification was lost.
parent 2e9dc7f0
......@@ -94,8 +94,7 @@ def process_op_status(vm, etime, jobid, opcode, status, logmsg):
# when no instance exists at the Ganeti backend.
# See ticket #799 for all the details.
if (status == 'error' and opcode == 'OP_INSTANCE_REMOVE' and
vm.operstate == 'ERROR'):
if (status == 'error' and opcode == 'OP_INSTANCE_REMOVE'):
vm.deleted = True
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment