예제 #1
0
파일: agent.py 프로젝트: younkun/ironic
    def delete_configuration(self, task):
        """Deletes RAID configuration on the given node.

        :param task: a TaskManager instance.
        :returns: states.CLEANWAIT if operation was successfully invoked
        """
        LOG.debug("Agent RAID delete_configuration invoked for node %s.",
                  task.node.uuid)
        step = task.node.clean_step
        return agent_base.execute_clean_step(task, step)
예제 #2
0
파일: agent.py 프로젝트: younkun/ironic
    def create_configuration(self,
                             task,
                             create_root_volume=True,
                             create_nonroot_volumes=True):
        """Create a RAID configuration on a bare metal using agent ramdisk.

        This method creates a RAID configuration on the given node.

        :param task: a TaskManager instance.
        :param create_root_volume: If True, a root volume is created
            during RAID configuration. Otherwise, no root volume is
            created. Default is True.
        :param create_nonroot_volumes: If True, non-root volumes are
            created. If False, no non-root volumes are created. Default
            is True.
        :returns: states.CLEANWAIT if operation was successfully invoked.
        :raises: MissingParameterValue, if node.target_raid_config is missing
            or was found to be empty after skipping root volume and/or non-root
            volumes.
        """
        node = task.node
        LOG.debug(
            "Agent RAID create_configuration invoked for node %(node)s "
            "with create_root_volume=%(create_root_volume)s and "
            "create_nonroot_volumes=%(create_nonroot_volumes)s with the "
            "following target_raid_config: %(target_raid_config)s.", {
                'node': node.uuid,
                'create_root_volume': create_root_volume,
                'create_nonroot_volumes': create_nonroot_volumes,
                'target_raid_config': node.target_raid_config
            })

        target_raid_config = raid.filter_target_raid_config(
            node,
            create_root_volume=create_root_volume,
            create_nonroot_volumes=create_nonroot_volumes)
        # Rewrite it back to the node object, but no need to save it as
        # we need to just send this to the agent ramdisk.
        node.driver_internal_info['target_raid_config'] = target_raid_config

        LOG.debug(
            "Calling agent RAID create_configuration for node %(node)s "
            "with the following target RAID configuration: %(target)s", {
                'node': node.uuid,
                'target': target_raid_config
            })
        step = node.clean_step
        return agent_base.execute_clean_step(task, step)
예제 #3
0
    def update_firmware_sum(self, task, **kwargs):
        """Updates the firmware using Smart Update Manager (SUM).

        :param task: a TaskManager object.
        :raises: NodeCleaningFailure, on failure to execute of clean step.
        """
        node = task.node
        # The arguments are validated and sent to the ProliantHardwareManager
        # to perform SUM based firmware update clean step.
        firmware_processor.get_and_validate_firmware_image_info(kwargs, 'sum')

        url = kwargs['url']
        if urlparse.urlparse(url).scheme == 'swift':
            url = firmware_processor.get_swift_url(urlparse.urlparse(url))
            node.clean_step['args']['url'] = url

        # Insert SPP ISO into virtual media CDROM
        ilo_common.attach_vmedia(node, 'CDROM', url)

        step = node.clean_step
        return agent_base.execute_clean_step(task, step)