Add a node powercycle command
This (somewhat big) patch adds support for remotely rebooting the nodes via whatever support the hypervisor has for such a concept. For KVM/fake (and containers in the future) this just uses sysrq plus a ‘reboot’ call if the sysrq method failed. For Xen, it first tries the above, and then Xen-hypervisor reboot (we first try sysrq since that just requires opening a file handle, whereas xen reboot means launching an external utility). The user interface is: # gnt-node powercycle node5 Are you sure you want to hard powercycle node node5? y/[n]/?: y Reboot scheduled in 5 seconds The node reboots hopefully after sending the reply. In case the clock is broken, “time.sleep(5)” might take ages (but then I suspect SSL negotiation wouldn't work). Signed-off-by:Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
Showing
- daemons/ganeti-noded 9 additions, 0 deletionsdaemons/ganeti-noded
- lib/backend.py 19 additions, 0 deletionslib/backend.py
- lib/cmdlib.py 45 additions, 0 deletionslib/cmdlib.py
- lib/hypervisor/hv_base.py 29 additions, 0 deletionslib/hypervisor/hv_base.py
- lib/hypervisor/hv_fake.py 7 additions, 0 deletionslib/hypervisor/hv_fake.py
- lib/hypervisor/hv_kvm.py 7 additions, 0 deletionslib/hypervisor/hv_kvm.py
- lib/hypervisor/hv_xen.py 17 additions, 0 deletionslib/hypervisor/hv_xen.py
- lib/mcpu.py 1 addition, 0 deletionslib/mcpu.py
- lib/opcodes.py 10 additions, 0 deletionslib/opcodes.py
- lib/rpc.py 10 additions, 0 deletionslib/rpc.py
- man/gnt-node.sgml 30 additions, 0 deletionsman/gnt-node.sgml
- scripts/gnt-node 24 additions, 0 deletionsscripts/gnt-node
Loading
Please register or sign in to comment