def reboot(self, task):
        driver_info = common.parse_driver_info(task.node)
        oneview_client.power_off(driver_info)
        power_state = "PoweringOff"

        while power_state == "PoweringOff":
            LOG.debug("Node %(node_uuid)s is powering off",
                      {'node_uuid': task.node.uuid})
            power_state = oneview_client.get_node_power_state(driver_info)

        LOG.info(_LI("Node %(node_uuid)s power state is %(power_state)s"),
                 {'node_uuid': task.node.uuid, 'power_state': power_state})

        oneview_client.power_on(driver_info)
Exemple #2
0
    def reboot(self, task):
        driver_info = common.parse_driver_info(task.node)
        oneview_client.power_off(driver_info)
        power_state = "PoweringOff"

        while power_state == "PoweringOff":
            LOG.debug("Node %(node_uuid)s is powering off",
                      {'node_uuid': task.node.uuid})
            power_state = oneview_client.get_node_power_state(driver_info)

        LOG.info(_LI("Node %(node_uuid)s power state is %(power_state)s"), {
            'node_uuid': task.node.uuid,
            'power_state': power_state
        })

        oneview_client.power_on(driver_info)
    def set_power_state(self, task, power_state):
        driver_info = common.parse_driver_info(task.node)

        if power_state == states.POWER_ON:
            state = oneview_client.power_on(driver_info)
        elif power_state == states.POWER_OFF:
            state = oneview_client.power_off(driver_info)
        else:
            raise exception.InvalidParameterValue(
                _("set_power_state called with invalid power state %s.")
                % power_state)

        if state != power_state:
            raise exception.PowerStateFailure(pstate=power_state)

        task.node.power_state = power_state
Exemple #4
0
    def set_power_state(self, task, power_state):
        driver_info = common.parse_driver_info(task.node)

        if power_state == states.POWER_ON:
            state = oneview_client.power_on(driver_info)
        elif power_state == states.POWER_OFF:
            state = oneview_client.power_off(driver_info)
        else:
            raise exception.InvalidParameterValue(
                _("set_power_state called with invalid power state %s.") %
                power_state)

        if state != power_state:
            raise exception.PowerStateFailure(pstate=power_state)

        task.node.power_state = power_state