Neutron 里面的 extension 和 plugin 是非常相似的两个概念,我花了好久才貌似搞懂了两者的区别,还不一定完全正确。

在OpenStack 的官网wiki中,可以找到它们两个的定义:

Plugin:

Neutron exposes a logical API to define network connectivity between devices from other OpenStack services (e.g., vNICs from Nova VMs). The logical connectivity described using the API must be translated into actually configuration on virtual and/or physical switches. This is where a Neutron plugin comes in. The Neutron plugin is able to talk to one or more types of switches and dynamically reconfigures the switches based on API calls.

Extension:

API Extensions allow a plugin to extend the Neutron API in order to expose more information. This information could be required to implement advanced functionality that is specific to a particular plugin, or to expose a capability before it has been incorporated into an official Neutron API.

具体链接在这里:https://wiki.openstack.org/wiki/NeutronDevelopment

由上述定义,再结合 Neutron 源代码中的一些文件可以看出,其实一个官方的核心插件(Core Plugin)只包括三种资源:Network, Subnet 以及 Port。插件必须能够与一些交换机沟通,实现逻辑上的二层和三层网络。而当我们需要在Neutron中加入更多的网络资源,例如 Router, Load Balancer, Gateway, VPN, Security Group 等的时候,extension 就出场了。这些额外的资源都可以在 extension 中进行定义,例如我在之前的文章中提到的RESOURCE_ATTRIBUTE_MAP等。

在官网中,我们还可以看到,extension还分三种:

Resource extensions introduce a new "entity" to the API. In Neutron, current entities are "networks" and "ports".
Action extensions tend to be "verbs" that act on a resource. For example, in Nova, there is a "server" resource, and a "rebuild" action on that server resource: http://docs.openstack.org/cactus/openstack-compute/developer/openstack-compute-api-1.1/content/Rebuild_Server-d1e3538.html#d2278e1430 . Core Neutron API doesn't really use "actions" as part of the core API, but extensions certainly could.
Request extensions allow one to add new values to existing requests objects. For example, if you were doing a POST to create a server, but wanted to add a new 'widgetType' attribute for the server object.

可以看到,第一种 Resource extensions 就是我们说的在需要加入更多新资源的时候可以用到。

第二种 Action extensions 就是在我们需要加入新动作的时候可以用到。比如说我有一个 Gateway 资源,希望可以把它和许多 Network 关联起来,这个操作可能就不存在于传统的CRUD中,那我就需要定义一个新的 Action Extension。

第三种我也不是特别理解,可能是说Request Extension是可以用来处理已经存在的资源的一些新增属性。例如 Network 资源多出来一个 priority 属性,传统的CRUD只针对 Network 原有的属性,不会去涉及到 priority 的值,那我就需要针对 priority 属性定义一个新的 Request Extension。

所以根据上面的描述,在我们要开发 Neutron 的时候,第一个要决定的事情就是我到底要写一个 Extension 还是 Plugin?如果我需要新增一些资源,那毫无疑问必须上 Extension; 如果我要实现一个新的与交换机沟通的方法,那就需要实现一组新的 Plugin。

如何区分 OpenStack Neutron Extension 和 Plugin的更多相关文章

  1. openstack——neutron网络服务

    一.neutron 介绍:   Neutron 概述 传统的网络管理方式很大程度上依赖于管理员手工配置和维护各种网络硬件设备:而云环境下的网络已经变得非常复杂,特别是在多租户场景里,用户随时都可能需要 ...

  2. 怎样写 OpenStack Neutron 的 Plugin (一)

    鉴于不知道Neutron的人也不会看这篇文章,而知道的人也不用我再啰嗦Neutron是什么东西,我决定跳过Neutron简介,直接爆料. 首先要介绍一下我的开发环境.我没有使用DevStack,而是直 ...

  3. 怎样写 OpenStack Neutron 的 Plugin (二)

    其实上一篇博文中的内容已经涵盖了大部分写Neutron插件的技术问题,这里主要还遗留了一些有关插件的具体实现的问题. 首先,Neutron对最基本的三个资源:Network, Port 和 Subne ...

  4. OpenStack Neutron 之 Load Balance

    OpenStack Neutron 之 Load Balance 负载均衡(Load Balance)是 OpenStack Neutron 支持的功能之一.负载均衡能够将网络请求分发到多个实际处理请 ...

  5. openstack Neutron分析(3)—— neutron-dhcp-agent源码分析

    1.neutron dhcp3个主要部件分别为什么?2.dhcp模块包含哪些内容?3.Dnsmasq配置文件是如何创建和更新的?4.DHCP agent的信息存放在neutron数据库的哪个表中? 扩 ...

  6. Openstack neutron:云数据中心底层网络架构

    目录 - 目录 - 云数据中心流量类型 - NSX整体网络结构 - 管理网络(API网络) - 租户网络 - 外联网络 - 存储网络 - openstack整体网络结构 - 管理网络:(上图中蓝线) ...

  7. Openstack Neutron OVS ARP Responder

    ARP – Why do we need it? In any environment, be it the physical data-center, your home, or a virtual ...

  8. Openstack Neutron L2 Population

    Why do we need it, whatever it is? VM unicast, multicast and broadcast traffic flow is detailed in m ...

  9. openstack neutron 简单理解

    分析1)位于最上层的Neutron Server充当一个门派中的“掌门人”角色(RESTful Server),负责接受来自外部门派(项目)的API请求,比如Nova API创建网络的请求.2)位于中 ...

随机推荐

  1. PS网页设计教程XXVI——如何在PS中创建一个专业的网页布局

    作为编码者,美工基础是偏弱的.我们可以参考一些成熟的网页PS教程,提高自身的设计能力.套用一句话,“熟读唐诗三百首,不会作诗也会吟”. 本系列的教程来源于网上的PS教程,都是国外的,全英文的.本人尝试 ...

  2. PHP面试题集之基础题

    1.用PHP打印出前一天的时间格式是 2006-5-10 22:21:21 date_default_timezone_set('PRC'); //默认时区 echo "今天:", ...

  3. cocos2d-x之action初试

    bool HelloWorld::init() { if ( !Layer::init() ) { return false; } Size visibleSize = Director::getIn ...

  4. Eclipse修改Tomcat发布路径以及的配置多个Tomcat方法

    最近放弃了使用Myeclipse,转而使用eclipse作为开发工具,确实Myeclipse集成了太多东西,使得开发人员的配置越来越少,这 不是个好事,使用eclipse后,有些地方就得自己去配置,比 ...

  5. 将text 文件转为List

    Integer 类型 ArrayList<Integer> Mlist = new ArrayList<Integer>(); Scanner scM = new Scanne ...

  6. Linux 环境下如何使 Chrome 浏览器字体更漂亮

    Windows 就免谈了,本身字体渲染技术 Cleartype 以及 DirectWrite 就稀烂得一塌糊涂.Mac 下面本来字体渲染就很好,所以关键就是在 Linux 下如何使 Chrome 的字 ...

  7. Hadoop Yarn core concepts

    The fundamental idea of YARN is to split the two major responsibilities of the JobTracker—that is, r ...

  8. TC79

    /* INSERT INTO TC79(PatientID,AdmissionDate,DischargeDate,Cost) SELECT * FROM ( SELECT 709,TO_DATE(' ...

  9. hdu 1028 Ignatius and the Princess III 简单dp

    题目链接:hdu 1028 Ignatius and the Princess III 题意:对于给定的n,问有多少种组成方式 思路:dp[i][j],i表示要求的数,j表示组成i的最大值,最后答案是 ...

  10. codeforces gym-101078

    题目链接: http://codeforces.com/gym/101078 A: #include <iostream> #include <cstdio> #include ...