Neutron源码结构

一 Neutron源码目录结构
--bin -包括下面两个工具,基于oslo.rootwrap提供利用root权限执行命令的接口
  |--neutron-rootwrap
  |--neutron-rootwrap-xen-dom0
--doc -用于文档生成
--etc -各种配置文件,基本上都会在安装时被复制到/etc/目录下
  |--api-paste.ini -Paste Deploy配置文件
  |--dhcp_agent.ini -DHCP agent配置信息
  |--fwaas_driver.ini
  |--init.d -Neutron唯一一个服务neutron-server的入口
     |--neutron-server
  |--l3_agent.ini
  |--lbaas_agent.ini
  |--metadata_agent.ini
  |--metering_agent.ini
  |--neutron
     |--plugins -各种Core Plugin的配置信息
     |--rootwrap.d -包含了oslo.rootwrap相关的一系列filter文件。
  |--neutron.conf -neutron-server启动后会读取这个配置文件
  |--policy.json -oslo.policy配置文件,API调用时会依据这里的配置进行检查
  |--rootwrap.conf -neutron-rootwrap配置文件,定义了filter文件保存位置等信息
  |--services.conf
  |--vpn_agent.ini
--neutron -Neutron核心实现代码
  |--agent -DHCP、Firewall等各种Agent的实现代码
  |--api -Neutron API实现
  |--cmd -几个辅助工具
  |--common -用于配置、异常、常量、日志、通信等操作的通用库
  |--db -数据库数据模型以及API
  |--debug -辅助的调试工具
  |--extensions -各种Extension API实现
  |--hacking -编码规范检查
  |--locale -多语言支持
  |--manager.py -解析配置文件并加载Core Plugin
  |--neutron_plugin_base_v2.py -Neutron Plugin的抽象基类
  |--notifiers -通知Nova网络有关的变化
  |--openstack
  |--plugins -各种Core Plugin实现
  |--scheduler
     |--dhcp_agent_scheduler.py -基于一定的策略为虚拟网络分配DHCP Agent
     |--l3_agent_scheduler.py -调度选择L3 Agent来运行
  |--server -neutron-server服务进程的实现入口
  |--service.py -定义各种服务的基类,比如WsgiService是WSGI服务的基类
  |--services -各种Service Plugin的实现
  |--tests -单元测试
--setup.cfg
--setup.py
--tools -包括一些安装、格式检查等相关工具
二 setup.cfg文件
[entry_points]
console_scripts =
    neutron-cisco-cfg-agent = neutron.plugins.cisco.cfg_agent.cfg_agent:main
    neutron-check-nsx-config = neutron.plugins.vmware.check_nsx_config:main
    neutron-db-manage = neutron.db.migration.cli:main
    neutron-debug = neutron.debug.shell:main
    neutron-dhcp-agent = neutron.agent.dhcp_agent:main
    neutron-hyperv-agent = neutron.plugins.hyperv.agent.hyperv_neutron_agent:main
    neutron-ibm-agent = neutron.plugins.ibm.agent.sdnve_neutron_agent:main
    neutron-l3-agent = neutron.agent.l3_agent:main
    neutron-lbaas-agent = neutron.services.loadbalancer.agent.agent:main
    neutron-linuxbridge-agent = neutron.plugins.linuxbridge.agent.linuxbridge_neutron_agent:main
    neutron-metadata-agent = neutron.agent.metadata.agent:main
    neutron-mlnx-agent = neutron.plugins.mlnx.agent.eswitch_neutron_agent:main
    neutron-nec-agent = neutron.plugins.nec.agent.nec_neutron_agent:main
    neutron-netns-cleanup = neutron.agent.netns_cleanup_util:main
    neutron-ns-metadata-proxy = neutron.agent.metadata.namespace_proxy:main
    neutron-nsx-manage = neutron.plugins.vmware.shell:main
    neutron-nvsd-agent = neutron.plugins.oneconvergence.agent.nvsd_neutron_agent:main
    neutron-openvswitch-agent = neutron.plugins.openvswitch.agent.ovs_neutron_agent:main
    neutron-ovs-cleanup = neutron.agent.ovs_cleanup_util:main
    neutron-restproxy-agent = neutron.plugins.bigswitch.agent.restproxy_agent:main
    neutron-ryu-agent = neutron.plugins.ryu.agent.ryu_neutron_agent:main
    neutron-server = neutron.server:main
    neutron-rootwrap = oslo.rootwrap.cmd:main
    neutron-usage-audit = neutron.cmd.usage_audit:main
    neutron-vpn-agent = neutron.services.vpn.agent:main
    neutron-metering-agent = neutron.services.metering.agents.metering_agent:main
    neutron-ofagent-agent = neutron.plugins.ofagent.agent.main:main
    neutron-sriov-nic-agent = neutron.plugins.sriovnicagent.sriov_nic_agent:main
    neutron-sanity-check = neutron.cmd.sanity_check:main
    neutron-cisco-apic-service-agent = neutron.plugins.ml2.drivers.cisco.apic.apic_topology:service_main
    neutron-cisco-apic-host-agent = neutron.plugins.ml2.drivers.cisco.apic.apic_topology:agent_main
neutron.core_plugins =
    bigswitch = neutron.plugins.bigswitch.plugin:NeutronRestProxyV2
    brocade = neutron.plugins.brocade.NeutronPlugin:BrocadePluginV2
    cisco = neutron.plugins.cisco.network_plugin:PluginV2
    embrane = neutron.plugins.embrane.plugins.embrane_ml2_plugin:EmbraneMl2Plugin
    hyperv = neutron.plugins.hyperv.hyperv_neutron_plugin:HyperVNeutronPlugin
    ibm = neutron.plugins.ibm.sdnve_neutron_plugin:SdnvePluginV2
    midonet = neutron.plugins.midonet.plugin:MidonetPluginV2
    ml2 = neutron.plugins.ml2.plugin:Ml2Plugin
    mlnx = neutron.plugins.mlnx.mlnx_plugin:MellanoxEswitchPlugin
    nec = neutron.plugins.nec.nec_plugin:NECPluginV2
    nuage = neutron.plugins.nuage.plugin:NuagePlugin
    metaplugin = neutron.plugins.metaplugin.meta_neutron_plugin:MetaPluginV2
    oneconvergence = neutron.plugins.oneconvergence.plugin:OneConvergencePluginV2
    plumgrid = neutron.plugins.plumgrid.plumgrid_plugin.plumgrid_plugin:NeutronPluginPLUMgridV2
    ryu = neutron.plugins.ryu.ryu_neutron_plugin:RyuNeutronPluginV2
    vmware = neutron.plugins.vmware.plugin:NsxPlugin
neutron.service_plugins =
    dummy = neutron.tests.unit.dummy_plugin:DummyServicePlugin
    router = neutron.services.l3_router.l3_router_plugin:L3RouterPlugin
    bigswitch_l3 = neutron.plugins.bigswitch.l3_router_plugin:L3RestProxy
    firewall = neutron.services.firewall.fwaas_plugin:FirewallPlugin
    lbaas = neutron.services.loadbalancer.plugin:LoadBalancerPlugin
    vpnaas = neutron.services.vpn.plugin:VPNDriverPlugin
    metering = neutron.services.metering.metering_plugin:MeteringPlugin
命名空间neutron.core_plugins和neutron.service_plugins分别指明了各种Core Plugin与Servce Plugin实现的入口。
命名空间console_scripts指定了neutron-server服务以及各种Agent实现入口,此外还包括了一些辅助命令或工具,这些工具脚本在部署时被安装。
neutron-db-manage:负责从旧Neutron版本数据库迁移与升级到新的版本,比如将原先的Open vSwitch或Linux Bridge的数据库迁移到ML2支持的数据库格式。具体可参考neutron/db/magration/README文件。
neutron-debug:Neutron辅助Debug脚本,提供了一个Shell环境来进行Debug,具体可以参考neutron/debug/README文件。
neutron-netns-cleanup:清理无用的Network Namespace,用于当Neutron Agent异常退出时进行环境的清理工作。Network Namespce的引入是为了支持网络协议栈的多个运行实例从而实现网络隔离,类似于进程的线性地址空间。
neutron-ovs-cleanup:清理无用的Open vSwitch网桥(或者说vSwitch)和端口。
neutron-sanity-check:执行一些简单的检查,比如是否支持VxLAN等。
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值