Add option to specify dataplane network name

Change-Id: I2c48e2eb1bbba06d9e8e8d7c00c444108ee493db
This commit is contained in:
Yichen Wang 2015-11-20 11:46:44 -08:00
parent 465c158fa5
commit 2cf7167718
4 changed files with 25 additions and 8 deletions

View File

@ -17,7 +17,8 @@ VMTP Usage
[--inter-node-only] [--protocols <T|U|I>]
[--bandwidth <bandwidth>] [--tcpbuf <tcp_pkt_size1,...>]
[--udpbuf <udp_pkt_size1,...>]
[--reuse_network_name <network_name>] [--no-env]
[--reuse_network_name <network_name>]
[--os-dataplane-network <network_name>] [--no-env]
[--vnic-type <direct|macvtap|normal>] [-d] [-v]
[--stop-on-error] [--vm-image-url <url_to_image>]
[--test-description <test_description>]
@ -63,6 +64,9 @@ VMTP Usage
Bytes, e.g. --udpbuf 128,2048. (default=128,1024,8192)
--reuse_network_name <network_name>
the network to be reused for performing tests
--os-dataplane-network <network_name>
Internal network name for OpenStack to hold data plane
traffic
--no-env do not read env variables
--vnic-type <direct|macvtap|normal>
binding vnic type for test VMs

View File

@ -105,7 +105,7 @@ internal_cidr_v6: ['2001:45::/64','2001:46::/64']
# By default the SSH library will try several methods to authenticate:
# - password if provided on the command line
# - user's own key pair (under the home directory $HOME) if already setup
# - the below key pair if not empty
# - the below key pair if not empty
# If you want to use a specific key pair, specify the key pair files here.
# This can be a pathname that is absolute or relative to the current directory
public_key_file:
@ -128,10 +128,10 @@ ping_count: 2
ping_pass_threshold: 80
# Max retry count for ssh to a VM (5 seconds between retries)
ssh_retry_count: 50
ssh_retry_count: 50
# General retry count
generic_retry_count: 50
generic_retry_count: 50
# Times to run when measuring TCP Throughput
tcp_tp_loop_count: 3
@ -161,6 +161,9 @@ udp_loss_rate_range: [2, 5]
# 0 means unlimited, which can be overridden at the command line using --bandwidth
vm_bandwidth: 0
# Internal network name for OpenStack to hold data plane traffic
os_dataplane_network: 'physnet1'
#######################################
# VMTP MongoDB Connection information
#######################################

View File

@ -378,21 +378,22 @@ class Network(object):
'''
agents = self.neutron_client.list_agents()['agents']
dp_net = self.config.os_dataplane_network
internal_iface_dict = {}
for agent in agents:
agent_type = agent['agent_type']
hostname = agent['host']
if 'Linux bridge' in agent_type:
agent_detail = self.neutron_client.show_agent(agent['id'])['agent']
if 'physnet1' in agent_detail['configurations']['interface_mappings']:
ifname = agent_detail['configurations']['interface_mappings']['physnet1']
if dp_net in agent_detail['configurations']['interface_mappings']:
ifname = agent_detail['configurations']['interface_mappings'][dp_net]
internal_iface_dict[hostname] = ifname
elif 'Open vSwitch' in agent_type:
network_type = self.vm_int_net[0]['provider:network_type']
agent_detail = self.neutron_client.show_agent(agent['id'])['agent']
if network_type == "vlan":
if 'physnet1' in agent_detail['configurations']['bridge_mappings']:
brname = agent_detail['configurations']['bridge_mappings']['physnet1']
if dp_net in agent_detail['configurations']['bridge_mappings']:
brname = agent_detail['configurations']['bridge_mappings'][dp_net]
internal_iface_dict[hostname] = brname
elif network_type == "vxlan" or network_type == 'gre':
ipaddr = agent_detail['configurations']['tunneling_ip']

View File

@ -764,6 +764,12 @@ def parse_opts_from_cli():
help='the network to be reused for performing tests',
metavar='<network_name>')
parser.add_argument('--os-dataplane-network', dest='os_dataplane_network',
action='store',
default=None,
help='Internal network name for OpenStack to hold data plane traffic',
metavar='<network_name>')
parser.add_argument('--no-env', dest='no_env',
default=False,
action='store_true',
@ -914,6 +920,9 @@ def merge_opts_to_configs(opts):
if opts.reuse_network_name:
config.reuse_network_name = opts.reuse_network_name
if opts.os_dataplane_network:
config.os_dataplane_network = opts.os_dataplane_network
#####################################################
# Set Ganglia server ip and port if the monitoring (-m)
# option is enabled.