示例#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)