Example #1
0
    def do_slave_add(self, force_define=True):
        group = self.env.get_group(name='default')
        node_count = self.params.node_count
        created_nodes = len(group.get_nodes())

        for node_num in xrange(created_nodes, created_nodes + node_count):
            node_name = "slave-{:02d}".format(node_num)
            slave_conf = create_slave_config(
                slave_name=node_name,
                slave_role='fuel_slave',
                slave_vcpu=self.params.vcpu_count,
                slave_memory=self.params.ram_size,
                slave_volume_capacity=settings.NODE_VOLUME_SIZE,
                second_volume_capacity=self.params.second_disk_size,
                third_volume_capacity=self.params.third_disk_size,
                interfaceorder=settings.INTERFACE_ORDER,
                use_all_disks=True,
                networks_multiplenetworks=settings.MULTIPLE_NETWORKS,
                networks_nodegroups=settings.NODEGROUPS,
                networks_bonding=settings.BONDING,
                networks_bondinginterfaces=settings.BONDING_INTERFACES,
            )

            node = group.add_node(slave_conf)
            if force_define is True:
                for volume in node.get_volumes():
                    volume.define()
                node.define()
Example #2
0
    def do_slave_add(self, force_define=True):
        group = self.env.get_group(name='default')
        node_count = self.params.node_count
        created_nodes = len(group.get_nodes())

        for node_num in xrange(created_nodes, created_nodes + node_count):
            node_name = "slave-{:02d}".format(node_num)
            slave_conf = create_slave_config(
                slave_name=node_name,
                slave_role='fuel_slave',
                slave_vcpu=self.params.vcpu_count,
                slave_memory=self.params.ram_size,
                slave_volume_capacity=settings.NODE_VOLUME_SIZE,
                second_volume_capacity=self.params.second_disk_size,
                third_volume_capacity=self.params.third_disk_size,
                interfaceorder=settings.INTERFACE_ORDER,
                numa_nodes=settings.HARDWARE['numa_nodes'],
                use_all_disks=True,
                networks_multiplenetworks=settings.MULTIPLE_NETWORKS,
                networks_nodegroups=settings.NODEGROUPS,
                networks_bonding=settings.BONDING,
                networks_bondinginterfaces=settings.BONDING_INTERFACES,
            )

            node = group.add_node(slave_conf)
            if force_define is True:
                for volume in node.get_volumes():
                    volume.define()
                node.define()
Example #3
0
    def add_slaves(
        self,
        nodes_count,
        slave_vcpu=1,
        slave_memory=1024,
        second_volume_capacity=50,
        third_volume_capacity=50,
        force_define=True,
        group_name='default',
    ):
        group = self._env.get_group(name=group_name)
        created_node_names = [n.name for n in group.get_nodes()]

        def get_available_slave_name():
            for i in xrange(1, 1000):
                name = "slave-{:02d}".format(i)
                if name in created_node_names:
                    continue

                created_node_names.append(name)
                return name

        new_nodes = []
        for node_num in xrange(nodes_count):
            node_name = get_available_slave_name()
            slave_conf = templates.create_slave_config(
                slave_name=node_name,
                slave_role='fuel_slave',
                slave_vcpu=slave_vcpu,
                slave_memory=slave_memory,
                slave_volume_capacity=settings.NODE_VOLUME_SIZE,
                second_volume_capacity=second_volume_capacity,
                third_volume_capacity=third_volume_capacity,
                interfaceorder=settings.INTERFACE_ORDER,
                numa_nodes=settings.HARDWARE['numa_nodes'],
                use_all_disks=True,
                networks_multiplenetworks=settings.MULTIPLE_NETWORKS,
                networks_nodegroups=settings.NODEGROUPS,
                networks_bonding=settings.BONDING,
                networks_bondinginterfaces=settings.BONDING_INTERFACES,
            )
            node = group.add_node(**slave_conf)
            if force_define is True:
                for volume in node.get_volumes():
                    volume.define()
                node.define()

            new_nodes.append(node)

        return new_nodes
Example #4
0
    def add_slaves(self,
                   nodes_count,
                   slave_vcpu=1,
                   slave_memory=1024,
                   second_volume_capacity=50,
                   third_volume_capacity=50,
                   force_define=True,
                   group_name='default',
                   ):
        group = self._env.get_group(name=group_name)
        created_node_names = [n.name for n in group.get_nodes()]

        def get_available_slave_name():
            for i in xrange(1, 1000):
                name = "slave-{:02d}".format(i)
                if name in created_node_names:
                    continue

                created_node_names.append(name)
                return name

        new_nodes = []
        for node_num in xrange(nodes_count):
            node_name = get_available_slave_name()
            slave_conf = templates.create_slave_config(
                slave_name=node_name,
                slave_role='fuel_slave',
                slave_vcpu=slave_vcpu,
                slave_memory=slave_memory,
                slave_volume_capacity=settings.NODE_VOLUME_SIZE,
                second_volume_capacity=second_volume_capacity,
                third_volume_capacity=third_volume_capacity,
                interfaceorder=settings.INTERFACE_ORDER,
                numa_nodes=settings.HARDWARE['numa_nodes'],
                use_all_disks=True,
                networks_multiplenetworks=settings.MULTIPLE_NETWORKS,
                networks_nodegroups=settings.NODEGROUPS,
                networks_bonding=settings.BONDING,
                networks_bondinginterfaces=settings.BONDING_INTERFACES,
            )
            node = group.add_node(**slave_conf)
            if force_define is True:
                for volume in node.get_volumes():
                    volume.define()
                node.define()

            new_nodes.append(node)

        return new_nodes
Example #5
0
    def do_slave_add(self, force_define=True):
        try:
            group = self.env.get_group(name=self.params.group_name)
        except DevopsObjNotFound:
            print('Group {!r} not found'.format(self.params.group_name))
            raise SystemExit()

        node_count = self.params.node_count
        created_node_names = [n.name for n in group.get_nodes()]

        def get_available_slave_name():
            for i in xrange(1, 1000):
                name = "slave-{:02d}".format(i)
                if name in created_node_names:
                    continue

                created_node_names.append(name)
                return name

        for node_num in range(node_count):
            node_name = get_available_slave_name()
            slave_conf = create_slave_config(
                slave_name=node_name,
                slave_role='fuel_slave',
                slave_vcpu=self.params.vcpu_count,
                slave_memory=self.params.ram_size,
                slave_volume_capacity=settings.NODE_VOLUME_SIZE,
                second_volume_capacity=self.params.second_disk_size,
                third_volume_capacity=self.params.third_disk_size,
                interfaceorder=settings.INTERFACE_ORDER,
                numa_nodes=settings.HARDWARE['numa_nodes'],
                use_all_disks=True,
                networks_multiplenetworks=settings.MULTIPLE_NETWORKS,
                networks_nodegroups=settings.NODEGROUPS,
                networks_bonding=settings.BONDING,
                networks_bondinginterfaces=settings.BONDING_INTERFACES,
            )

            node = group.add_node(**slave_conf)
            if force_define is True:
                for volume in node.get_volumes():
                    volume.define()
                node.define()

            print('Node {!r} created'.format(node.name))