• Iustin Pop's avatar
    Add a node powercycle command · f5118ade
    Iustin Pop authored
    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: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>