def __init__(self, scenario_cfg, context_cfg):
        self.scenario_cfg = scenario_cfg
        self.context_cfg = context_cfg
        self.ext_net_id = os.getenv("EXTERNAL_NETWORK", "external")

        self.neutron_client = op_utils.get_neutron_client()
        self.setup_done = False
Exemple #2
0
    def __init__(self, scenario_cfg, context_cfg):
        self.scenario_cfg = scenario_cfg
        self.context_cfg = context_cfg

        host = self.context_cfg['host']
        self.user = host.get('user', 'ubuntu')
        self.port = host.get("ssh_port", ssh.DEFAULT_PORT)
        self.ip = host.get('ip')
        self.key_filename = host.get('key_filename', '/root/.ssh/id_rsa')
        self.password = host.get('password')

        options = scenario_cfg['options']
        host_list = options.get('host').split(',')

        self.cpu_set = options.get("cpu_set", '1,2,3,4,5,6')
        self.host_memory = options.get("host_memory", 512)

        self.nova_client = openstack_utils.get_nova_client()
        self.neutron_client = openstack_utils.get_neutron_client()
        self.glance_client = openstack_utils.get_glance_client()

        node_file = os.path.join(consts.YARDSTICK_ROOT_PATH,
                                 scenario_cfg.get('node_file'))
        with open(node_file) as f:
            nodes = yaml.safe_load(TaskTemplate.render(f.read()))
        self.nodes = {a['name']: a for a in nodes['nodes']}

        self.controller_nodes = self._get_host_node(host_list, 'Controller')
        self.compute_nodes = self._get_host_node(host_list, 'Compute')
Exemple #3
0
 def __init__(self, scenario_cfg, context_cfg):
     self.scenario_cfg = scenario_cfg
     self.context_cfg = context_cfg
     self.options = self.scenario_cfg['options']
     self.qos_policy = self.options.get("qos_policy", '200Mbps')
     self.bandwidth_limit = int(filter(str.isdigit, self.qos_policy))
     self.neutron_client = op_utils.get_neutron_client()
     self.setup_done = False
Exemple #4
0
 def __init__(self, scenario_cfg, context_cfg):
     self.scenario_cfg = scenario_cfg
     self.context_cfg = context_cfg
     self.options = self.scenario_cfg['options']
     self.qos_policy1 = self.options.get("qos_policy1", '100Mbps')
     self.qos_policy2 = self.options.get("qos_policy2", '1000Mbps')
     self.neutron_client = op_utils.get_neutron_client()
     self.setup_done = False
    def __init__(self, scenario_cfg, context_cfg):
        self.scenario_cfg = scenario_cfg
        self.context_cfg = context_cfg
        self.options = self.scenario_cfg['options']

        self.sg_name = self.options.get("sg_name", "yardstick_sec_group")
        self.description = self.options.get("description", None)
        self.neutron_client = op_utils.get_neutron_client()

        self.setup_done = False
Exemple #6
0
    def __init__(self, scenario_cfg, context_cfg):
        self.scenario_cfg = scenario_cfg
        self.context_cfg = context_cfg
        self.options = self.scenario_cfg['options']

        self.secgroup_id = self.options.get("secgroup_id", None)

        self.neutron_client = op_utils.get_neutron_client()

        self.setup_done = False
Exemple #7
0
    def __init__(self, scenario_cfg, context_cfg):
        self.scenario_cfg = scenario_cfg
        self.context_cfg = context_cfg
        self.options = self.scenario_cfg.get("options", {})

        self.network_name = self.options.get("network_name")

        self.neutron_client = op_utils.get_neutron_client()

        self.setup_done = False
Exemple #8
0
    def __init__(self, scenario_cfg, context_cfg):
        self.scenario_cfg = scenario_cfg
        self.context_cfg = context_cfg
        self.options = self.scenario_cfg['options']

        self.openstack = self.options.get("openstack_paras", None)

        self.neutron_client = op_utils.get_neutron_client()

        self.setup_done = False
Exemple #9
0
    def __init__(self, scenario_cfg, context_cfg):
        self.scenario_cfg = scenario_cfg
        self.context_cfg = context_cfg
        self.options = self.scenario_cfg['options']
        self.image = self.options.get("image", 'cirros-0.3.5')
        self.external_network = os.getenv("EXTERNAL_NETWORK")
        self.nova_client = op_utils.get_nova_client()
        self.neutron_client = op_utils.get_neutron_client()
        self.glance_client = op_utils.get_glance_client()
        self.instance = None

        self.setup_done = False
Exemple #10
0
    def __init__(self, scenario_cfg, context_cfg):
        self.scenario_cfg = scenario_cfg
        self.context_cfg = context_cfg
        self.options = self.scenario_cfg['options']

        self.ext_net_name = os.getenv("EXTERNAL_NETWORK", "external")
        self.ext_net = self.options.get("net_name", self.ext_net_name)
        self.router_id = self.options.get("router_id", None)

        self.neutron_client = op_utils.get_neutron_client()

        self.setup_done = False
    def __init__(self, scenario_cfg, context_cfg):
        self.scenario_cfg = scenario_cfg
        self.context_cfg = context_cfg
        self.options = self.scenario_cfg['options']

        self.sg_name = self.options.get("sg_name", "default")
        self.direction = self.options.get("direction", "ingress")
        self.protocol = self.options.get("protocol", "tcp")
        self.port_min = self.options.get("port_range_min", "22")
        self.port_max = self.options.get("port_range_max", "22")

        self.neutron_client = op_utils.get_neutron_client()

        self.setup_done = False
    def __init__(self, scenario_cfg, context_cfg):
        self.scenario_cfg = scenario_cfg
        self.context_cfg = context_cfg
        self.options = self.scenario_cfg['options']

        self.image_name = self.options.get("image_name", None)
        self.flavor_name = self.options.get("flavor_name", None)
        self.openstack = self.options.get("openstack_paras", None)

        self.glance_client = op_utils.get_glance_client()
        self.neutron_client = op_utils.get_neutron_client()
        self.nova_client = op_utils.get_nova_client()

        self.setup_done = False
Exemple #13
0
    def get_neutron_info(self):
        if not self.neutron_client:
            self.neutron_client = get_neutron_client()

        networks = self.neutron_client.list_networks()
        for network in self.networks.values():
            for neutron_net in networks['networks']:
                if neutron_net['name'] == network.stack_name:
                    network.segmentation_id = neutron_net.get(
                        'provider:segmentation_id')
                    # we already have physical_network
                    # network.physical_network = neutron_net.get('provider:physical_network')
                    network.network_type = neutron_net.get(
                        'provider:network_type')
                    network.neutron_info = neutron_net
Exemple #14
0
def _append_external_network(rc_file):
    neutron_client = openstack_utils.get_neutron_client()
    networks = neutron_client.list_networks()['networks']
    try:
        ext_network = next(n['name'] for n in networks if n['router:external'])
    except StopIteration:
        logger.warning("Can't find external network")
    else:
        cmd = 'export EXTERNAL_NETWORK=%s' % ext_network
        try:
            with open(rc_file, 'a') as f:
                f.write(cmd + '\n')
        except OSError as e:
            if e.errno != errno.EEXIST:
                raise
Exemple #15
0
 def _append_external_network(self, rc_file):
     neutron_client = openstack_utils.get_neutron_client()
     networks = neutron_client.list_networks()['networks']
     try:
         ext_network = next(n['name']
                            for n in networks if n['router:external'])
     except StopIteration:
         LOG.warning("Can't find external network")
     else:
         cmd = 'export EXTERNAL_NETWORK=%s' % ext_network
         try:
             with open(rc_file, 'a') as f:
                 f.write(cmd + '\n')
         except OSError as e:
             if e.errno != errno.EEXIST:
                 raise
Exemple #16
0
    def __init__(self, scenario_cfg, context_cfg):
        self.scenario_cfg = scenario_cfg
        self.context_cfg = context_cfg
        self.options = self.scenario_cfg['options']

        self.server_name = self.options.get("server_name", "TestServer")
        self.flavor = self.options.get("flavor", None)
        self.volume_id = self.options.get("volume_id", None)
        # self.external_network = os.getenv("EXTERNAL_NETWORK")

        self.external_network = self.options.get("network", "ext-net")

        self.nova_client = op_utils.get_nova_client()
        self.neutron_client = op_utils.get_neutron_client()

        self.setup_done = False
Exemple #17
0
 def __init__(self, scenario_cfg, context_cfg):
     self.scenario_cfg = scenario_cfg
     self.context_cfg = context_cfg
     self.nodes = context_cfg['nodes']
     self.options = scenario_cfg['options']
     self.host_str = self.options.get("host", 'host1')
     self.host_list = self.host_str.split(',')
     self.host_list.sort()
     self.image = self.options.get("image", 'cirros-0.3.3')
     self.external_network = os.getenv("EXTERNAL_NETWORK")
     self.cpu_set = self.options.get("cpu_set", None)
     self.host_memory = self.options.get("host_memory", 512)
     self.nova_client = op_utils.get_nova_client()
     self.neutron_client = op_utils.get_neutron_client()
     self.glance_client = op_utils.get_glance_client()
     self.instance = None
     self.client = None
Exemple #18
0
    def _append_external_network(self, rc_file):
        try:
            neutron_client = openstack_utils.get_neutron_client()
            networks = neutron_client.list_networks()['networks']
        except openstack_utils.ClientException as e:
            LOG.error(type(e).__name__ + ': ' + str(e))
            return

        try:
            ext_network = next(n['name'] for n in networks
                               if n['router:external'])
        except StopIteration:
            LOG.warning("Can't find external network")
        else:
            cmd = 'export EXTERNAL_NETWORK=%s' % ext_network
            try:
                with open(rc_file, 'a') as f:
                    f.write(cmd + '\n')
            except OSError as e:
                if e.errno != errno.EEXIST:
                    raise
Exemple #19
0
    def __init__(self, scenario_cfg, context_cfg):
        self.scenario_cfg = scenario_cfg
        self.context_cfg = context_cfg
        self.options = self.scenario_cfg['options']
        self.host_str = self.options.get("host", "node4")
        self.host_list = self.host_str.split(',')
        self.image = self.options.get("image", 'cirros-0.3.3')
        self.external_network = os.getenv("EXTERNAL_NETWORK")
        self.nova_client = op_utils.get_nova_client()
        self.neutron_client = op_utils.get_neutron_client()
        self.glance_client = op_utils.get_glance_client()
        self.instance = None
        self.instance_2 = None
        self.client = None

        node_file = os.path.join(consts.YARDSTICK_ROOT_PATH,
                                 self.options.get("file"))
        with open(node_file) as f:
            nodes = yaml.safe_load(TaskTemplate.render(f.read()))
        self.nodes = {a['name']: a for a in nodes['nodes']}

        self.setup_done = False
Exemple #20
0
 def __init__(self, scenario_cfg, context_cfg):
     self.scenario_cfg = scenario_cfg
     self.context_cfg = context_cfg
     self.nodes = context_cfg['nodes']
     self.options = scenario_cfg['options']
     self.host_str = self.options.get("host", 'host1')
     self.host_list = self.host_str.split(',')
     self.host_list.sort()
     self.flavor1 = self.options.get("flavor1",
                                     "yardstick-hugepages-flavor1")
     self.flavor2 = self.options.get("flavor2",
                                     "yardstick-hugepages-flavor2")
     self.image = self.options.get("image", 'cirros-0.3.3')
     self.external_network = self.options.get("external_network",
                                              "external")
     self.cpu_set = self.options.get("cpu_set", '1,2,3,4,5,6')
     self.host_memory = self.options.get("host_memory", 512)
     self.nova_client = op_utils.get_nova_client()
     self.neutron_client = op_utils.get_neutron_client()
     self.glance_client = op_utils.get_glance_client()
     self.instance = None
     self.client = None
     self.compute_node1 = None
     self.compute_node2 = None