Esempio n. 1
0
 def check_stopping_resources():
     logger.info("Checking for 'running_resources "
                 "attribute have '0' value")
     pcs_status = parse_pcs_status_xml(remote)
     pcs_attribs = get_pcs_nodes(pcs_status)
     return pcs_attribs[
         self.primary_controller_fqdn]['resources_running'] == '0'
Esempio n. 2
0
 def check_stopping_resources():
     logger.info(
         "Checking for 'running_resources "
         "attribute have '0' value")
     pcs_status = parse_pcs_status_xml(remote)
     pcs_attribs = get_pcs_nodes(pcs_status)
     return pcs_attribs[self.primary_controller_fqdn][
         'resources_running'] == '0'
Esempio n. 3
0
 def check_started_resources():
     logger.info("Checking for 'running_resources' attribute "
                 "have {} value on node {}".format(
                     self.slave_node_running_resources,
                     self.primary_controller_fqdn))
     pcs_status = parse_pcs_status_xml(remote)
     pcs_attribs = get_pcs_nodes(pcs_status)
     return pcs_attribs[self.primary_controller_fqdn][
         'resources_running'] == self.slave_node_running_resources
Esempio n. 4
0
 def check_started_resources():
     logger.info(
         "Checking for 'running_resources' attribute "
         "have {} value on node {}".format(
             self.slave_node_running_resources,
             self.primary_controller_fqdn))
     pcs_status = parse_pcs_status_xml(remote)
     pcs_attribs = get_pcs_nodes(pcs_status)
     return pcs_attribs[self.primary_controller_fqdn][
         'resources_running'] == self.slave_node_running_resources
Esempio n. 5
0
            def check_stopping_resources():
                logger.info("Checking for 'running_resources "
                            "attribute have '0' value")

                nail_node = self.fuel_web.get_nailgun_node_by_devops_node(
                    self.primary_controller)
                pcs_status = parse_pcs_status_xml(nail_node['ip'])

                pcs_attribs = get_pcs_nodes(pcs_status)
                return pcs_attribs[
                    self.primary_controller_fqdn]['resources_running'] == '0'
            def check_stopping_resources():
                logger.info(
                    "Checking for 'running_resources "
                    "attribute have '0' value")

                nail_node = self.fuel_web.get_nailgun_node_by_devops_node(
                    self.primary_controller)
                pcs_status = parse_pcs_status_xml(nail_node['ip'])

                pcs_attribs = get_pcs_nodes(pcs_status)
                return pcs_attribs[self.primary_controller_fqdn][
                    'resources_running'] == '0'
Esempio n. 7
0
            def check_stopping_resources():
                logger.info("Checking for 'running_resources "
                            "attribute have '0' value")

                primary_ctrl = \
                    self.primary_controller.get_ip_address_by_network_name(
                        'admin')
                pcs_status = parse_pcs_status_xml(primary_ctrl)

                pcs_attribs = get_pcs_nodes(pcs_status)
                return pcs_attribs[
                    self.primary_controller_fqdn]['resources_running'] == '0'
Esempio n. 8
0
            def check_stopping_resources():
                logger.info(
                    "Checking for 'running_resources "
                    "attribute have '0' value")

                primary_ctrl = \
                    self.primary_controller.get_ip_address_by_network_name(
                        'admin')
                pcs_status = parse_pcs_status_xml(primary_ctrl)

                pcs_attribs = get_pcs_nodes(pcs_status)
                return pcs_attribs[self.primary_controller_fqdn][
                    'resources_running'] == '0'
Esempio n. 9
0
            def check_started_resources():
                logger.info("Checking for 'running_resources' attribute "
                            "have {} value on node {}".format(
                                self.slave_node_running_resources,
                                self.primary_controller_fqdn))

                primary_ctrl = \
                    self.primary_controller.get_ip_address_by_network_name(
                        'admin')
                pcs_status = parse_pcs_status_xml(primary_ctrl)

                pcs_attribs = get_pcs_nodes(pcs_status)
                return pcs_attribs[self.primary_controller_fqdn][
                    'resources_running'] == self.slave_node_running_resources
Esempio n. 10
0
    def get_pcs_initial_state(self):
        """Get controllers initial status in pacemaker"""
        self.primary_controller = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.nodes().slaves[0])

        self.primary_controller_fqdn = str(
            self.fuel_web.fqdn(self.primary_controller))

        primary_ctrl = \
            self.primary_controller.get_ip_address_by_network_name('admin')
        pcs_status = parse_pcs_status_xml(primary_ctrl)

        with self.fuel_web.get_ssh_for_node(
                self.primary_controller.name) as remote:

            root_free = run_on_remote_get_results(
                remote, 'cibadmin --query --scope status')['stdout_str']

        self.primary_controller_space_on_root = get_pacemaker_nodes_attributes(
            root_free)[self.primary_controller_fqdn]['root_free']

        self.disk_monitor_limit = 512

        self.rabbit_disk_free_limit = 5

        self.pacemaker_restart_timeout = 600

        self.pcs_check_timeout = 300

        self.primary_controller_space_to_filled = str(
            int(
                self.primary_controller_space_on_root
            ) - self.disk_monitor_limit - 1)

        self.pcs_status = get_pcs_nodes(pcs_status)

        self.slave_nodes_fqdn = list(
            set(self.pcs_status.keys()).difference(
                set(self.primary_controller_fqdn.split())))
        running_resources_slave_1 = int(
            self.pcs_status[self.slave_nodes_fqdn[0]]['resources_running'])

        running_resources_slave_2 = int(
            self.pcs_status[self.slave_nodes_fqdn[1]]['resources_running'])

        self.slave_node_running_resources = str(min(running_resources_slave_1,
                                                    running_resources_slave_2
                                                    )
                                                )
Esempio n. 11
0
            def check_started_resources():
                logger.info(
                    "Checking for 'running_resources' attribute "
                    "have {} value on node {}".format(
                        self.slave_node_running_resources,
                        self.primary_controller_fqdn))

                primary_ctrl = \
                    self.primary_controller.get_ip_address_by_network_name(
                        'admin')
                pcs_status = parse_pcs_status_xml(primary_ctrl)

                pcs_attribs = get_pcs_nodes(pcs_status)
                return pcs_attribs[self.primary_controller_fqdn][
                    'resources_running'] == self.slave_node_running_resources
Esempio n. 12
0
    def get_pcs_initial_state(self):
        """Get controllers initial status in pacemaker"""
        self.primary_controller = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.nodes().slaves[0])

        self.primary_controller_fqdn = str(
            self.fuel_web.fqdn(self.primary_controller))

        primary_ctrl = \
            self.primary_controller.get_ip_address_by_network_name('admin')
        pcs_status = parse_pcs_status_xml(primary_ctrl)

        with self.fuel_web.get_ssh_for_node(
                self.primary_controller.name) as remote:

            root_free = run_on_remote_get_results(
                remote, 'cibadmin --query --scope status')['stdout_str']

        self.primary_controller_space_on_root = get_pacemaker_nodes_attributes(
            root_free)[self.primary_controller_fqdn]['root_free']

        self.disk_monitor_limit = 512

        self.rabbit_disk_free_limit = 5

        self.pacemaker_restart_timeout = 600

        self.pcs_check_timeout = 300

        self.primary_controller_space_to_filled = str(
            int(self.primary_controller_space_on_root) -
            self.disk_monitor_limit - 1)

        self.pcs_status = get_pcs_nodes(pcs_status)

        self.slave_nodes_fqdn = list(
            set(self.pcs_status.keys()).difference(
                set(self.primary_controller_fqdn.split())))
        running_resources_slave_1 = int(
            self.pcs_status[self.slave_nodes_fqdn[0]]['resources_running'])

        running_resources_slave_2 = int(
            self.pcs_status[self.slave_nodes_fqdn[1]]['resources_running'])

        self.slave_node_running_resources = str(
            min(running_resources_slave_1, running_resources_slave_2))