def pre_series_upgrade():
    log("Running prepare series upgrade hook", "INFO")
    # In order to indicate the step of the series upgrade process for
    # administrators and automated scripts, the charm sets the paused and
    # upgrading states.
    set_unit_paused()
    set_unit_upgrading()
def pre_series_upgrade():
    log("Running prepare series upgrade hook", "INFO")
    # In order to indicate the step of the series upgrade process for
    # administrators and automated scripts, the charm sets the paused and
    # upgrading states.
    set_unit_paused()
    set_unit_upgrading()
Beispiel #3
0
def pre_series_upgrade():
    log("Running prepare series upgrade hook", "INFO")
    if not is_unit_paused_set():
        for service in SWIFT_SVCS:
            stopped = service_stop(service)
            if not stopped:
                raise Exception("{} didn't stop cleanly.".format(service))
        set_unit_paused()
    set_unit_upgrading()
def pre_series_upgrade():
    hookenv.log("Running prepare series upgrade hook", "INFO")
    # NOTE: In order to indicate the step of the series upgrade process for
    # administrators and automated scripts, the charm sets the paused and
    # upgrading states.
    set_unit_paused()
    set_unit_upgrading()
    hookenv.status_set(
        "blocked", "Ready for do-release-upgrade and reboot. "
        "Set complete when finished.")
Beispiel #5
0
def pause(args):
    """Pause all the swift services.

    @raises Exception if any services fail to stop
    """
    for service in args.services:
        stopped = service_pause(service)
        if not stopped:
            raise Exception("{} didn't stop cleanly.".format(service))
    set_unit_paused()
    assess_status(CONFIGS, args.services)
Beispiel #6
0
def pause(args):
    """Pause all the swift services.

    @raises Exception if any services fail to stop
    """
    for service in args.services:
        stopped = service_pause(service)
        if not stopped:
            raise Exception("{} didn't stop cleanly.".format(service))
    set_unit_paused()
    assess_status(CONFIGS, args.services)
def pause(args):
    """Pause the ceph-osd units on the local machine only.

    Optionally uses the 'osd-number' from juju action param to only pause a
    specific osd.  If all the osds are not stopped then the paused status is
    not set.

    @raises CalledProcessError if the ceph commands fails.
    @raises OSError if it can't get the local osd ids.
    """
    for local_id in get_local_osd_ids():
        cmd = ['ceph', '--id', 'osd-upgrade', 'osd', 'out', str(local_id)]
        check_call(cmd)
    set_unit_paused()
    assess_status()
Beispiel #8
0
def pause_unit():
    """Pause services on this unit and update the units status

    @returns None
    """
    node_name = get_hostname()
    messages = []
    enter_standby_mode(node_name)
    if not is_in_standby_mode(node_name):
        messages.append("Node not in standby mode")
    if node_has_resources(node_name):
        messages.append("Resources still running on unit")
    status, message = assess_status_helper()
    if status != 'active':
        messages.append(message)
    if messages:
        raise Exception("Couldn't pause: {}".format("; ".join(messages)))
    else:
        set_unit_paused()
        status_set("maintenance",
                   "Paused. Use 'resume' action to resume normal service.")
Beispiel #9
0
def pause_unit():
    """Pause services on this unit and update the units status

    @returns None
    """
    node_name = get_hostname()
    messages = []
    enter_standby_mode(node_name)
    if not is_in_standby_mode(node_name):
        messages.append("Node not in standby mode")

    # some resources may take some time to be migrated out from the node. So 3
    # retries are made with a 5 seconds wait between each one.
    i = 0
    ready = False
    has_resources = False
    while i < PCMKR_MAX_RETRIES and not ready:
        if node_has_resources(node_name):
            has_resources = True
            i += 1
            time.sleep(PCMKR_SLEEP_SECS)
        else:
            ready = True
            has_resources = False

    if has_resources:
        messages.append("Resources still running on unit")
    status, message = assess_status_helper()
    # New status message will indicate the resource is not running
    if status != 'active' and 'not running' not in message:
        messages.append(message)
    if messages and not is_unit_upgrading_set():
        raise Exception("Couldn't pause: {}".format("; ".join(messages)))
    else:
        set_unit_paused()
        status_set("maintenance",
                   "Paused. Use 'resume' action to resume normal service.")
Beispiel #10
0
def pause_unit():
    """Pause services on this unit and update the units status

    @returns None
    """
    node_name = get_hostname()
    messages = []
    enter_standby_mode(node_name)
    if not is_in_standby_mode(node_name):
        messages.append("Node not in standby mode")

    # some resources may take some time to be migrated out from the node. So 3
    # retries are made with a 5 seconds wait between each one.
    i = 0
    ready = False
    has_resources = False
    while i < PCMKR_MAX_RETRIES and not ready:
        if node_has_resources(node_name):
            has_resources = True
            i += 1
            time.sleep(PCMKR_SLEEP_SECS)
        else:
            ready = True
            has_resources = False

    if has_resources:
        messages.append("Resources still running on unit")
    status, message = assess_status_helper()
    if status != 'active':
        messages.append(message)
    if messages and not is_unit_upgrading_set():
        raise Exception("Couldn't pause: {}".format("; ".join(messages)))
    else:
        set_unit_paused()
        status_set("maintenance",
                   "Paused. Use 'resume' action to resume normal service.")