Esempio n. 1
0
    def prepare(self, task):
        """Prepare the deployment environment for this task's node.

        If the node's 'capabilities' property includes a boot_mode, that
        boot mode will be applied for the node. Otherwise, the existing
        boot mode of the node is used in the node's 'capabilities' property.

        PXEDeploys' prepare method is then called, to prepare the deploy
        environment for the node

        :param task: a TaskManager instance containing the node to act on.
        :raises: IloOperationError, if some operation on iLO failed.
        :raises: InvalidParameterValue, if some information is invalid.
        """
        if task.node.provision_state == states.DEPLOYING:
            _prepare_node_for_deploy(task)

            # Check if 'boot_option' is compatible with 'boot_mode' and image.
            # Whole disk image deploy is not supported in UEFI boot mode if
            # 'boot_option' is not 'local'.
            # If boot_mode is not set in the node properties/capabilities then
            # PXEDeploy.validate() would pass.
            # Boot mode gets updated in prepare stage. It is possible that the
            # deploy boot mode is 'uefi' after call to update_boot_mode().
            # Hence a re-check is required here.
            pxe.validate_boot_option_for_uefi(task.node)

        super(IloPXEDeploy, self).prepare(task)
Esempio n. 2
0
    def prepare(self, task):
        """Prepare the deployment environment for this task's node.

        If the node's 'capabilities' property includes a boot_mode, that
        boot mode will be applied for the node. Otherwise, the existing
        boot mode of the node is used in the node's 'capabilities' property.

        PXEDeploys' prepare method is then called, to prepare the deploy
        environment for the node

        :param task: a TaskManager instance containing the node to act on.
        :raises: IloOperationError, if some operation on iLO failed.
        :raises: InvalidParameterValue, if some information is invalid.
        """
        if task.node.provision_state == states.DEPLOYING:
            _prepare_node_for_deploy(task)

            # Check if 'boot_option' is compatible with 'boot_mode' and image.
            # Whole disk image deploy is not supported in UEFI boot mode if
            # 'boot_option' is not 'local'.
            # If boot_mode is not set in the node properties/capabilities then
            # PXEDeploy.validate() would pass.
            # Boot mode gets updated in prepare stage. It is possible that the
            # deploy boot mode is 'uefi' after call to update_boot_mode().
            # Hence a re-check is required here.
            pxe.validate_boot_option_for_uefi(task.node)

        super(IloPXEDeploy, self).prepare(task)
Esempio n. 3
0
 def test_validate_boot_option_for_uefi_noexc_two(self, mock_log):
     properties = {'capabilities': 'boot_mode:bios'}
     instance_info = {"boot_option": "local"}
     self.node.properties = properties
     self.node.instance_info['capabilities'] = instance_info
     self.node.driver_internal_info['is_whole_disk_image'] = True
     pxe.validate_boot_option_for_uefi(self.node)
     self.assertFalse(mock_log.called)
Esempio n. 4
0
 def test_validate_boot_option_for_uefi_noexc_three(self, mock_log):
     properties = {"capabilities": "boot_mode:uefi"}
     instance_info = {"boot_option": "local"}
     self.node.properties = properties
     self.node.instance_info["capabilities"] = instance_info
     self.node.driver_internal_info["is_whole_disk_image"] = False
     pxe.validate_boot_option_for_uefi(self.node)
     self.assertFalse(mock_log.called)
Esempio n. 5
0
 def test_validate_boot_option_for_uefi_noexc_three(self, mock_log):
     properties = {'capabilities': 'boot_mode:uefi'}
     instance_info = {"boot_option": "local"}
     self.node.properties = properties
     self.node.instance_info['capabilities'] = instance_info
     self.node.driver_internal_info['is_whole_disk_image'] = False
     pxe.validate_boot_option_for_uefi(self.node)
     self.assertFalse(mock_log.called)