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. jquery treeview

    jquery treeview 插件参数说明 treeview开源地址:https://github.com/jzaefferer/jquery-treeview 1.animated:String ...

  2. 如何自定义Grunt任务

    任务(Tasks)是grunt的核心概念,你所做的很多工作比如资源合并(concat).压缩(uglify)都是在配置任务.每次grunt运行的时候,你指定的一个或多个任务也在运行,如果你没有指定任务 ...

  3. CentOS 6.5安装MongoDB

    1.创建mongodb.repo文件在/etc/yum.repos.d/目录下创建文件mongodb.repo,它包含MongoDB仓库的配置信息,内容如下: [mongodb] name=Mongo ...

  4. Linux 学习之DNS服务器

    概念: DNS:Domain Name System 域名系统 FQDN:Fully Qualified Domain Name 完整主机名 正向解析:由主机名查IP地址 SOA:开始验证(Start ...

  5. {dockerUI}在服务器上直接安装shipyard/shipyard

    $ git clone https://github.com/shipyard/shipyard.git $ cd shipyard/   $ sudo pip install -r requirem ...

  6. OpenStack三个节点icehouse-gre模式部署

    一.环境准备 1.架构 创建3台虚拟机,分别作为controll节点.network节点和compute1节点. Controller节点:1processor,2G memory,5G storag ...

  7. 初始化 Ubuntu Trusty 14.04

    1. 软件源 sudo vim /etc/apt/source.list # 将软件源改为 sohu 的 deb http://mirrors.sohu.com/ubuntu/ trusty main ...

  8. UESTC 899 方老师和农场 --双连通分量的构造

    首先将原图中的连通分量缩点,一定可以将原图缩成一棵树的形式,然后统计这棵树的叶子节点个数,答案就是(leaf+1)/2.这里不再证明,可以画个图看一下. (简单说明一下,首先把两个最近公共祖先最远的两 ...

  9. HDU 1850 Being a Good Boy in Spring Festival

    此题先考虑第一种,5 7 9的情况,先手如果想赢,则必定要把异或值变为0,因为随便取,所以此处的异或指的是对堆中的石子数进行异或,而非异或其SG函数. 首先7^9=14,因为要异或为0,则5要变成14 ...

  10. 利用jquery来进行表单的多向提交

    最近由于特别忙,每晚都是1到2点倒床便睡的那种,所以没有给自己要求写日记,等这阶段过完,还会重新开始. 今天来写一个前端的表单提交的方法. 有时往往以为在同一个表单中,不同的按钮,来表达的含义不同,需 ...