Extract agent type (OVS or LB) from controller node
Change-Id: I2388d715b8dcb08b58bd6617403cca8704b8f8ea
This commit is contained in:
parent
411e3dac2e
commit
66fe44b23d
20
README.rst
20
README.rst
@ -4,9 +4,11 @@ Overview
|
||||
|
||||
VMTP is a data path performance tool for OpenStack clouds.
|
||||
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
If you need a quick and simple way to get VM level or host level single-flow throughput and latency numbers from any OpenStack cloud, and take into account various Neutron topologies, this is the tool to use.
|
||||
VMTP is a python application that will automatically perform ping connectivity, ping round trip time measurement (latency) and TCP/UDP throughput measurement for the following flows on any OpenStack deployment:
|
||||
|
||||
* VM to VM same network (private fixed IP)
|
||||
@ -25,14 +27,17 @@ Optionally, VMTP can extract automatically CPU usage from all native hosts in th
|
||||
|
||||
For VM-related flows, VMTP will automatically create the necessary OpenStack resources (router, networks, subnets, key pairs, security groups, test VMs), perform the throughput measurements then cleanup all related resources before exiting.
|
||||
|
||||
See the usage page for the description of all the command line arguments supported by VMTP.
|
||||
|
||||
Pre-requisite to run VMTP
|
||||
-------------------------
|
||||
|
||||
VMTP runs on any Python 2.X envirnment (validated on Linux and MacOSX).
|
||||
|
||||
For VM related performance measurements
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
* Access to the cloud Horizon Dashboard
|
||||
* Access to the cloud Horizon Dashboard (to retrieve the openrc file)
|
||||
* 1 working external network pre-configured on the cloud (VMTP will pick the first one found)
|
||||
* At least 2 floating IP if an external router is configured or 3 floating IP if there is no external router configured
|
||||
* 1 Linux image available in OpenStack (any distribution)
|
||||
@ -60,7 +65,7 @@ VMTP will display the results to stdout with the following data:
|
||||
|
||||
.. code::
|
||||
|
||||
- Session general information (date, auth_url, OpenStack encaps, VMTP version...)
|
||||
- Session general information (date, auth_url, OpenStack encaps, VMTP version, OpenStack release, Agent type, CPU...)
|
||||
- List of results per flow, for each flow:
|
||||
| flow name
|
||||
| to and from IP addresses
|
||||
@ -82,12 +87,19 @@ VMTP will display the results to stdout with the following data:
|
||||
| | - ICMP
|
||||
| | | average, min, max and stddev round trip time in ms
|
||||
|
||||
Detailed results can also be stored in a file in JSON format using the *--json* command line argument.
|
||||
Detailed results can also be stored in a file in JSON format using the *--json* command line argument and/or stored directly into a MongoDB server.
|
||||
|
||||
Limitations and Caveats
|
||||
-----------------------
|
||||
|
||||
VMTP only measures performance for single-flows at the socket/TCP/UDP level (in a VM or natively).
|
||||
Measured numbers therefore reflect what most applications will see.
|
||||
It is not designed to measure driver level data path performance from inside a VM (such as bypassing the kernel TCP stack and write directly to virtio), there are better tools that can address this type of mesurement.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
VMTP is licensed under Apache License 2.0.
|
||||
Below are the benchmark tools that are used in VMTP, and you must accept the license of each tool before using VMTP.
|
||||
|
||||
* iperf: BSD License (https://iperf.fr/license.html)
|
||||
|
15
network.py
15
network.py
@ -43,6 +43,9 @@ class Network(object):
|
||||
# Store state if the network is ipv4/ipv6 dual stack
|
||||
self.ipv6_enabled = False
|
||||
|
||||
self.agent_type = self._get_agent_type()
|
||||
print 'Agent: ' + self.agent_type
|
||||
|
||||
# If reusing existing management network just find this network
|
||||
if self.config.reuse_network_name:
|
||||
# An existing management network must be reused
|
||||
@ -312,3 +315,15 @@ class Network(object):
|
||||
(self.ext_router['name'])
|
||||
except TypeError:
|
||||
print "No external router set"
|
||||
|
||||
def _get_agent_type(self):
|
||||
'''
|
||||
Retrieve the list of agents
|
||||
return 'Linux bridge agent' or 'Open vSwitch agent' or 'Unknown agent'
|
||||
'''
|
||||
agents = self.neutron_client.list_agents(fields='agent_type')['agents']
|
||||
for agent in agents:
|
||||
agent_type = agent['agent_type']
|
||||
if 'Linux bridge' in agent_type or 'Open vSwitch' in agent_type:
|
||||
return agent_type
|
||||
return 'Unknown agent'
|
||||
|
3
vmtp.py
3
vmtp.py
@ -171,6 +171,7 @@ class VmtpTest(object):
|
||||
self.sec_group = None
|
||||
self.image_instance = None
|
||||
self.flavor_type = None
|
||||
self.agent_type = None
|
||||
|
||||
# Create an instance on a particular availability zone
|
||||
def create_instance(self, inst, az, int_net):
|
||||
@ -196,6 +197,7 @@ class VmtpTest(object):
|
||||
nova_client = Client(**creds_nova)
|
||||
neutron = neutronclient.Client(**creds)
|
||||
|
||||
|
||||
self.comp = compute.Compute(nova_client, config)
|
||||
# Add the script public key to openstack
|
||||
self.comp.add_public_key(config.public_key_name,
|
||||
@ -224,6 +226,7 @@ class VmtpTest(object):
|
||||
print 'Found image %s to launch VM, will continue' % (config.image_name)
|
||||
self.flavor_type = self.comp.find_flavor(config.flavor_type)
|
||||
self.net = network.Network(neutron, config)
|
||||
rescol.add_property('agent_type', self.net.agent_type)
|
||||
|
||||
# Create a new security group for the test
|
||||
self.sec_group = self.comp.security_group_create()
|
||||
|
Loading…
Reference in New Issue
Block a user