Neutron/Quantum-floating-ips
< Neutron
量子浮动IP
[已被 https://blueprints.launchpad.net/quantum/+spec/quantum-l3-fwd-nat 取代]
总结
Nova 具有固定IP和浮动IP的概念。固定IP在实例创建时分配,并在实例被显式终止之前保持不变。浮动IP是可以动态地与实例关联的IP地址。该地址可以随时取消关联并与另一个实例关联。
可以在以下位置查看 nova 中浮动IP的实现方式: https://www.ibm.com/developerworks/mydeveloperworks/blogs/e93514d3-c4f0-4aa0-8844-497f370090f5/entry/openstack_s_floating_ips7?lang=en
此页面描述了此功能在量子中的实现方式。
用户故事
- 在特定组下创建IP范围,仅供管理员角色使用。
- 将浮动IP分配给特定租户,仅供管理员角色使用。
- 从特定租户取消分配浮动IP
- 将浮动IP关联到给定的实例
- 将浮动IP从特定实例取消关联
前提条件
不适用
需要考虑的组件
为了在量子中实现浮动IP,我们必须考虑
- 量子客户端浮动功能,就像 nova 客户端中的功能一样
- 量子API的浮动功能
- 代理程序,用于实现IP表规则并将浮动IP绑定到公共接口。
此外,我们需要集成
- Nova网络API浮动功能
设计
概述
正如上述图所示,我们将拥有 nova-network-api 来支持 nova 客户端浮动命令。nova-network-api 将调用量子 cli lib 通过 API 与量子服务器交互。关于浮动IP的数据将存储到量子DB中。运行在计算主机上的量子Agent将强制执行浮动IP。
浮动IP顶级资源
- 创建一系列浮动IP
POST /v2.0/floating-ips/
- 列出特定租户或所有租户下的浮动IP
GET /v2.0/floating-ips/
- 删除浮动IP
DELETE /v2.0/floating-ips/{ipid}
- 从给定的IP池将浮动IP分配给特定租户
POST /v2.0/floating-ips/action
{"allocate": {"tenant_id": "xxxx"}}
Note: tenant_id can be got from context if it is missing.
- 从特定租户取消分配一个浮动IP
POST /v2.0/floating-ips/{ipid}/action
{"deallocate": {"tenant_id": "xxx"}}
Note: tenant_id can be got from context if it is missing.
- 将浮动IP关联到特定实例
POST /v2.0/floating-ips/{ipid}/action
{"associate": {"instance_id": "xxx", "interface": "eth0"}}
- 将浮动IP从特定实例取消关联
POST /v2.0/floating-ips/{ipid}/action
{"disassociate": {"instance_id": "xxx"}}
数据库表
- floating_ips
| 属性 | 类型 | 必需 | CRUD | 默认 |
| id | uuid-str | - | R | 自动生成 |
| address | str | Y | CR | - |
| fixed_ip | str | N | RUD | - |
| host | str | N | RUD | - |
| tenant_id | str | N | RUD | - |
| group | str | Y | CR | - |
未解决的问题
- 浮动IP可以是IPv6地址吗?
- 我们需要删除一系列浮动IP吗?
