Skip to content

Commit

Permalink
Merge pull request #348 from izapolsk/kill_broken_vm_anyway
Browse files Browse the repository at this point in the history
[RFR] remove broken vms in openshift
  • Loading branch information
mshriver authored Dec 13, 2018
2 parents f555070 + f590a4a commit d21c09a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wrapanapi/systems/container/rhopenshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,12 @@ def delete_vm(self, vm_name):
# openshift 3.6 has an issue. if pvc/pv are removed earlier than pods,
# pods get hung and cannot be removed.
# so, we need to stop all pods in project before removal
self.stop_vm(vm_name)
self.wait_vm_stopped(vm_name)
try:
self.stop_vm(vm_name)
self.wait_vm_stopped(vm_name, num_sec=60)
except BaseException as e:
self.logger.exception("vm %s couldn't be stopped because of '%s'. calling remove vm",
vm_name, e.message)
self.delete_project(name=vm_name)
return True

Expand Down

0 comments on commit d21c09a

Please sign in to comment.