Neutrondev ppt
Upcoming SlideShare
Loading in...5
×
 

Neutrondev ppt

on

  • 561 views

 

Statistics

Views

Total Views
561
Views on SlideShare
561
Embed Views
0

Actions

Likes
3
Downloads
43
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Neutrondev ppt Neutrondev ppt Presentation Transcript

  • Neutron Dev (In a Nutshell) Reference: https://wiki.openstack.org/wiki/NeutronDevelopment
  • • Neutron Service • Exposes REST interface to manage network resources • Requires a plugin to implement a specific network management strategy • Agents (OVS and LB plugins) • Manage state on the compute and gateway nodes • External service (plugin-specific) • Agent-based (manage configuration on compute/gateway nodes) • Manage hardware or other resources
  • • Provides framework for plugins • API (neutron.{api,extensions}) - standard interface to clients • DB (neutron.db) - helpers to make plugin implementation easier • Typical request lifecycle • Accept client request • Update local system state (in mysql) • Async dispatch of state change to agent (rpc) or external service (http) • Return status to client • A request returning 200 is no guarantee of success!
  • • http://docs.openstack.org/api/openstack-network/2.0/content/index.html • Network • Subnet • Port • Router • Router Interface (Subnet) • Router Gateway (Network) • Security Groups • Applied at the port level
  • There Be Dictionaries • Neutron uses dictionaries instead of objects • Legacy - intended to allow non-db plugins • But all plugins need to store local state • So...lots of manual introspection to determine ‘model’ state • Like lisp, but with square brackets • pf_ref['packet_filter']['status']
  • OVS Plugin • L2 Agent • Ensures tenant isolation on a compute node with local vlans • Configures communication across compute nodes (via vlan, gre, etc) • Integrates support for security groups (which apply at the port level) • Linux bridge between ovs and vif supports iptables • Other agents are required but not OVS-specific • L3 + Metadata • DHCP
  • • Routes traffic between networks, internal and external • Manages metadata agents (one per subnet) to proxy traffic to nova’s metadata service • Supports SNAT (outbound) and DNAT (floating ips) • Implemented via iptables rules • Usually deployed on a gateway node alongside the L2 agent (required to ensure connectivity a given subnet)
  • • Manages dnsmasq instances to implement IPAM • A dnsmasq instance per subnet • Relies on the L2 agent to ensure connectivity with a given subnet
  • • Required to support overlapping ips • RHEL support is limited to creating virtual interfaces in a namespace • Fedora/Ubuntu et all support moving virtual interfaces between namespaces • ovs_use_veth ensures that RHEL-compatible port handling is used
  • Development Speed • The faster we can iterate, the more we get done • Configure and install • Virtualization • Virt orchestration • Dependency Caching • Validate • Debug failures with pdb • Neutron smoke test in tempest
  • Virtualization • Neutron usage is destructive - need to reset to clean state often • Virtualization allows easy snapshot and restore - use! • Nested virt (and ssd’s) largely obviate the virt speed penalty • https://github.com/kashyapc/nvmx-haswell/blob/master/SETUP-nVMX.rst • Automate image creation • veewee - https://github.com/jedi4ever/veewee • Orchestrate virtualization • vagrant - https://github.com/adrahon/vagrant-kvm
  • Dependency Caching • Speed up devstack/packstack runs by caching • Fedora/RHEL • reposync/createrepo (full repo, can be huge) • intelligentmirror (incremental, can be a pain to configure) • Ubuntu: apt-cacher-ng (incremental, works for rpms too) • python: wheel (https://wheel.readthedocs.org) - binary packages • ~/.pip/pip.conf can configure wheel usage globally • python: pypi mirror • Either full mirror or a forthcoming upstream script that mirrors only openstack dependencies
  • Unit Testing • Tox - http://tox.readthedocs.org/en/latest/ • Install with pip • Deploys package to an isolated virtualenv and runs tests • tox [-e py26,pep8] [neutron.tests.unit.test_module] • see tox.ini for names of supported envs • Debugging • Reuse the tox-created venv: source .tox/py27/bin/activate • Or install fresh: pip install --editable • Tox doesn’t support pdb (uses subunit.run internally) • python -m testtools.run neutron.tests.unit.test_module • Integration • Configure tempest with devstack • API_RATE_LIMIT=False • ENABLED_SERVICES+=,tempest
  • Mocking • Mox - https://code.google.com/p/pymox/ • Uses a record/replay model • Heavyweight • Avoid if possible! • Mock - http://www.voidspace.org.uk/python/mock/ • Uses an evaluate/assert model • Lightweight • Prefer!
  • Integration Testing • enable_service tempest • Packstack (/var/lib/tempest) • Provision for demo usage, configure tempest and external ovs bridge • Need to install - pip install --editable /var/lib/tempest • Neutron smoke - nosetests tempest/scenario/test_network_basic_ops.py • Sanity check that the service and agents are working • Deploys package to an isolated virtualenv and runs tests • tox [-e py26,pep8] [neutron.tests.unit.test_module] • see tox.ini for names of supported envs • Debugging • Reuse the tox-created venv: source .tox/py27/bin/activate • Or install fresh: pip install --editable • Tox doesn’t support pdb (uses subunit.run internally) • python -m testtools.run neutron.tests.unit.test_module