0
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...
• Provides framework for plugins
• API (neutron.{api,extensions}) - standard interface to clients
• DB (neutron.db) - help...
• http://docs.openstack.org/api/openstack-network/2.0/content/index.html
• Network
• Subnet
• Port
• Router
• Router Inter...
There Be Dictionaries
• Neutron uses dictionaries instead of objects
• Legacy - intended to allow non-db plugins
• But all...
OVS Plugin
• L2 Agent
• Ensures tenant isolation on a compute node with local vlans
• Configures communication across comp...
• Routes traffic between networks, internal and external
• Manages metadata agents (one per subnet) to proxy traffic to no...
• Manages dnsmasq instances to implement IPAM
• A dnsmasq instance per subnet
• Relies on the L2 agent to ensure connectiv...
• Required to support overlapping ips
• RHEL support is limited to creating virtual interfaces in a namespace
• Fedora/Ubu...
Development Speed
• The faster we can iterate, the more we get done
• Configure and install
• Virtualization
• Virt orches...
Virtualization
• Neutron usage is destructive - need to reset to clean state often
• Virtualization allows easy snapshot a...
Dependency Caching
• Speed up devstack/packstack runs by caching
• Fedora/RHEL
• reposync/createrepo (full repo, can be hu...
Unit Testing
• Tox - http://tox.readthedocs.org/en/latest/
• Install with pip
• Deploys package to an isolated virtualenv ...
Mocking
• Mox - https://code.google.com/p/pymox/
• Uses a record/replay model
• Heavyweight
• Avoid if possible!
• Mock - ...
Integration Testing
• enable_service tempest
• Packstack (/var/lib/tempest)
• Provision for demo usage, configure tempest ...
Upcoming SlideShare
Loading in...5
×

Neutrondev ppt

506

Published on

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
506
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
47
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "Neutrondev ppt"

  1. 1. Neutron Dev (In a Nutshell) Reference: https://wiki.openstack.org/wiki/NeutronDevelopment
  2. 2. • 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
  3. 3. • 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!
  4. 4. • 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
  5. 5. 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']
  6. 6. 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
  7. 7. • 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)
  8. 8. • Manages dnsmasq instances to implement IPAM • A dnsmasq instance per subnet • Relies on the L2 agent to ensure connectivity with a given subnet
  9. 9. • 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
  10. 10. 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
  11. 11. 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
  12. 12. 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
  13. 13. 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
  14. 14. 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!
  15. 15. 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
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×