On some machines, "xm shutdown -w" hangs randomly on some machines. Just
re-issuing the same command (or a "xm destroy") correctly shuts the machine
down. To prevent Ganeti to wait forever (i.e.: until the RPC timeout) for "xm
shutdown -w" to terminate, propagate the already existing shutdown timeout value
to the execution of that command as well, and if it hasn't finished yet, kill
it, allowing ganeti to reissue it, or a "destroy".

Also, given that the "Stop" function is defined in the hypervisor base class,
implement a similar mechanism in the other hypervisors as well.

Michele Tartara (4):
  Fix wrong docstring
  Allow xen commands to have a timeout
  Allow KVM commands to have a timeout
  Enable a timeout for instance shutdown

 lib/backend.py                               |  2 +-
 lib/hypervisor/hv_base.py                    |  7 ++++-
 lib/hypervisor/hv_chroot.py                  | 12 ++++++--
 lib/hypervisor/hv_fake.py                    |  5 +++-
 lib/hypervisor/hv_kvm.py                     | 18 +++++++++---
 lib/hypervisor/hv_lxc.py                     | 15 +++++++---
 lib/hypervisor/hv_xen.py                     | 42 ++++++++++++++++++++--------
 test/py/ganeti.hypervisor.hv_xen_unittest.py | 13 +++++++--
 8 files changed, 87 insertions(+), 27 deletions(-)

--
1.9.0.279.gdc9e3eb

Reply via email to