def _test(self, expected_errors, expected_warnings,
           assign_profiles=True, dry_run=False):
     errors, warnings = utils.assign_and_verify_profiles(self.bm_client,
                                                         self.flavors,
                                                         assign_profiles,
                                                         dry_run)
     self.assertEqual(errors, expected_errors)
     self.assertEqual(warnings, expected_warnings)
 def _test(self, expected_errors, expected_warnings,
           assign_profiles=True, dry_run=False):
     errors, warnings = utils.assign_and_verify_profiles(self.bm_client,
                                                         self.flavors,
                                                         assign_profiles,
                                                         dry_run)
     self.assertEqual(errors, expected_errors)
     self.assertEqual(warnings, expected_warnings)
    def take_action(self, parsed_args):
        self.log.debug("take_action(%s)" % parsed_args)
        bm_client = self.app.client_manager.baremetal

        flavors = self._collect_flavors(parsed_args)

        errors, warnings = utils.assign_and_verify_profiles(
            bm_client,
            flavors,
            assign_profiles=True,
            dry_run=parsed_args.dry_run)
        if errors:
            raise exceptions.ProfileMatchingError(
                _('Failed to validate and assign profiles.'))
    def take_action(self, parsed_args):
        self.log.debug("take_action(%s)" % parsed_args)
        bm_client = self.app.client_manager.baremetal

        flavors = self._collect_flavors(parsed_args)

        errors, warnings = utils.assign_and_verify_profiles(
            bm_client, flavors,
            assign_profiles=True,
            dry_run=parsed_args.dry_run
        )
        if errors:
            raise exceptions.ProfileMatchingError(
                _('Failed to validate and assign profiles.'))
    def _predeploy_verify_capabilities(self, stack, parameters, parsed_args):
        self.predeploy_errors = 0
        self.predeploy_warnings = 0
        self.log.debug("Starting _pre_verify_capabilities")

        bm_client = self.app.client_manager.baremetal

        self._check_boot_images()

        flavors = self._collect_flavors(parsed_args)

        self._check_ironic_boot_configuration(bm_client)

        errors, warnings = utils.assign_and_verify_profiles(
            bm_client, flavors,
            assign_profiles=False,
            dry_run=parsed_args.dry_run
        )
        self.predeploy_errors += errors
        self.predeploy_warnings += warnings

        compute_client = self.app.client_manager.compute

        self.log.debug("Checking hypervisor stats")
        if utils.check_hypervisor_stats(compute_client) is None:
            self.log.error("Expected hypervisor stats not met")
            self.predeploy_errors += 1

        self.log.debug("Checking nodes count")
        enough_nodes, count, ironic_nodes_count = utils.check_nodes_count(
            bm_client,
            stack,
            parameters,
            {
                'ControllerCount': 1,
                'ComputeCount': 1,
                'ObjectStorageCount': 0,
                'BlockStorageCount': 0,
                'CephStorageCount': 0,
            }
        )
        if not enough_nodes:
            self.log.error(
                "Not enough nodes - available: {0}, requested: {1}".format(
                    ironic_nodes_count, count))
            self.predeploy_errors += 1

        return self.predeploy_errors, self.predeploy_warnings
    def _predeploy_verify_capabilities(self, stack, parameters, parsed_args):
        self.predeploy_errors = 0
        self.predeploy_warnings = 0
        self.log.debug("Starting _pre_verify_capabilities")

        bm_client = self.app.client_manager.baremetal

        self._check_boot_images()

        flavors = self._collect_flavors(parsed_args)

        self._check_ironic_boot_configuration(bm_client)

        errors, warnings = utils.assign_and_verify_profiles(
            bm_client, flavors,
            assign_profiles=False,
            dry_run=parsed_args.dry_run
        )
        self.predeploy_errors += errors
        self.predeploy_warnings += warnings

        compute_client = self.app.client_manager.compute

        self.log.debug("Checking hypervisor stats")
        if utils.check_hypervisor_stats(compute_client) is None:
            self.log.error("Expected hypervisor stats not met")
            self.predeploy_errors += 1

        self.log.debug("Checking nodes count")
        enough_nodes, count, ironic_nodes_count = utils.check_nodes_count(
            bm_client,
            stack,
            parameters,
            {
                'ControllerCount': 1,
                'ComputeCount': 1,
                'ObjectStorageCount': 0,
                'BlockStorageCount': 0,
                'CephStorageCount': 0,
            }
        )
        if not enough_nodes:
            self.log.error(
                "Not enough nodes - available: {0}, requested: {1}".format(
                    ironic_nodes_count, count))
            self.predeploy_errors += 1

        return self.predeploy_errors, self.predeploy_warnings
    def _predeploy_verify_capabilities(self, parsed_args):
        self.predeploy_errors = 0
        self.predeploy_warnings = 0
        self.log.debug("Starting _pre_verify_capabilities")

        bm_client = self.app.client_manager.baremetal

        self._check_boot_images()

        flavors = self._collect_flavors(parsed_args)

        self._check_ironic_boot_configuration(bm_client)

        errors, warnings = utils.assign_and_verify_profiles(
            bm_client,
            flavors,
            assign_profiles=False,
            dry_run=parsed_args.dry_run)
        self.predeploy_errors += errors
        self.predeploy_warnings += warnings

        return self.predeploy_errors, self.predeploy_warnings
Exemplo n.º 8
0
    def _predeploy_verify_capabilities(self, parsed_args):
        self.predeploy_errors = 0
        self.predeploy_warnings = 0
        self.log.debug("Starting _pre_verify_capabilities")

        bm_client = self.app.client_manager.tripleoclient.baremetal()

        self._check_boot_images()

        flavors = self._collect_flavors(parsed_args)

        self._check_ironic_boot_configuration(bm_client)

        errors, warnings = utils.assign_and_verify_profiles(
            bm_client, flavors,
            assign_profiles=False,
            dry_run=parsed_args.dry_run
        )
        self.predeploy_errors += errors
        self.predeploy_warnings += warnings

        return self.predeploy_errors, self.predeploy_warnings