Skip to content

Commit

Permalink
sometimes vms are broken and cannot be stopped. We anyway need to try…
Browse files Browse the repository at this point in the history
… to kill them
  • Loading branch information
izapolsk committed Dec 12, 2018
1 parent f555070 commit f590a4a
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 f590a4a

Please sign in to comment.