Пример #1
0
def start(uuid):
    """
    Starts up the domain with the given UUID.
    """
    state = poller.poll_state(uuid)
    if state.is_crashed():
        destroy(uuid)
        start(uuid)
    elif state.is_paused():
        resume(uuid)
    else:
        start_domain.start_domain(uuid)
Пример #2
0
def start(uuid):
    """
    Starts up the domain with the given UUID.
    """
    state = poller.poll_state(uuid)
    if state.is_crashed():
        destroy(uuid)
        start(uuid)
    elif state.is_paused():
        resume(uuid)
    else:
        start_domain.start_domain(uuid)
Пример #3
0
def shutdown(uuid):
    """
    Shuts down the domain with the given UUID.  If the instance is crashed, it
    is destroyed.  If the instance is paused, it is unpaused and shutdown
    cleanly.
    """
    state = poller.poll_state(uuid)
    if state.is_crashed():
        destroy(uuid)
    elif state.is_paused():
        resume(uuid)
        shutdown(uuid)
    else:
        _call_domain_control_routine(uuid, "shutdown")
Пример #4
0
def shutdown(uuid):
    """
    Shuts down the domain with the given UUID.  If the instance is crashed, it
    is destroyed.  If the instance is paused, it is unpaused and shutdown
    cleanly.
    """
    state = poller.poll_state(uuid)
    if state.is_crashed():
        destroy(uuid)
    elif state.is_paused():
        resume(uuid)
        shutdown(uuid)
    else:
        _call_domain_control_routine(uuid, "shutdown")
Пример #5
0
def reboot(uuid):
    """
    Reboots the domain with the given UUID.  If the system is paused, we
    unpause and reboot it.  If the system is stopped, we start it.  If the
    system is crashed, we destroy and restart it.
    """
    state = poller.poll_state(uuid)
    if state.is_stopped():
        start(uuid)
    elif state.is_paused():
        resume(uuid)
        reboot(uuid)
    elif state.is_crashed():
        destroy(uuid)
        start(uuid)
    else:
        _call_domain_control_routine(uuid, "reboot", 0)
Пример #6
0
def reboot(uuid):
    """
    Reboots the domain with the given UUID.  If the system is paused, we
    unpause and reboot it.  If the system is stopped, we start it.  If the
    system is crashed, we destroy and restart it.
    """
    state = poller.poll_state(uuid)
    if state.is_stopped():
        start(uuid)
    elif state.is_paused():
        resume(uuid)
        reboot(uuid)
    elif state.is_crashed():
        destroy(uuid)
        start(uuid)
    else:
        _call_domain_control_routine(uuid, "reboot", 0)