This package added an API extension "isp" to neutron and provides an OVS plugin (OVSNeutronPluginV2ISP) that supports this extension.
The isp extension allow you to associate isp:name info to subnet. When creating a port, it can use isp:hint to decide how many IP address to draw from which isp's subnet. isp:hint contains isp name like "tel,uni,mobile" and optional number of IP addresses for each isp, like "telx2,unix1".
This extension is created to allow us to bind two IP from two ISP to the same port automatically. It's common in China that China Telecom (tel) and China Unicom (uni) share the same physical network (e.g. eth0 network). When using provider network, we wish to have a tel IP and a uni IP on the virtual port as well. The default port-create command can associate more then one IP to a port, but you either need to know the subnet_id or the ip_address beforehand. Since neutron does not store ISP information, it can't be done in an efficient and automated way in default ovs plugin.
To install this package:
# pip install neutron-isp
# neutron-register-isp-extension
To use this plugin (and extension) in neutron, on neutron node, edit /etc/neutron/neutron.conf
[DEFAULT] core_plugin = yygame.plugin.OVSNeutronPluginV2ISP
Then restart neutron-server to make the change effective.
# restart neutron-server
When creating or declaring a subnet, you can specify ISP data via isp:name extension attribute. This attribute is optional, similar to the provider network attributes of a network.
$ neutron subnet-create \ --tenant-id $ADMIN_TENANT_ID \ --name=tel-001 \ --isp:name=tel \ --enable_dhcp=True eth1 10.3.1.0/24 Created a new subnet: +------------------+--------------------------------------------+ | Field | Value | +------------------+--------------------------------------------+ | allocation_pools | {"start": "10.3.1.2", "end": "10.3.1.254"} | | cidr | 10.3.1.0/24 | | dns_nameservers | | | enable_dhcp | True | | gateway_ip | 10.3.1.1 | | host_routes | | | id | db7b74e1-1279-49db-8c1b-8665afe4b285 | | ip_version | 4 | | isp:name | tel | | name | tel-001 | | network_id | bb2b1f69-434c-4d6b-b4d7-84558a90381a | | tenant_id | c9d3556cea054d80941c6f327b16140b | +------------------+--------------------------------------------+ $ neutron subnet-show tel-001 +------------------+--------------------------------------------+ | Field | Value | +------------------+--------------------------------------------+ | allocation_pools | {"start": "10.3.1.2", "end": "10.3.1.254"} | | cidr | 10.3.1.0/24 | | dns_nameservers | | | enable_dhcp | True | | gateway_ip | 10.3.1.1 | | host_routes | | | id | db7b74e1-1279-49db-8c1b-8665afe4b285 | | ip_version | 4 | | isp:name | tel | | name | tel-001 | | network_id | bb2b1f69-434c-4d6b-b4d7-84558a90381a | | tenant_id | c9d3556cea054d80941c6f327b16140b | +------------------+--------------------------------------------+
When creating a port, you can specify which ISP to draw IP from and how many via the --isp:hint option. In the following example, I create a port with one IP from tel and one IP from uni. Do not use --fixed-ip with --isp:hint, otherwise --isp:hint will be ignored.
$ bin/neutron port-create --isp:hint="tel,uni" eth1 Created a new port: +-----------------------+----------------------------------------------------------------------------------+ | Field | Value | +-----------------------+----------------------------------------------------------------------------------+ | admin_state_up | True | | allowed_address_pairs | | | binding:capabilities | {"port_filter": true} | | binding:host_id | | | binding:vif_type | ovs | | device_id | | | device_owner | | | fixed_ips | {"subnet_id": "597014b0-3dd2-424b-9cb2-4e36bf252f86", "ip_address": "10.3.1.10"} | | | {"subnet_id": "06341f81-19ff-4ffe-8745-6b1aebced07f", "ip_address": "10.4.2.13"} | | id | 940e860c-ac88-452f-972a-340428d81fa0 | | mac_address | fa:16:3e:62:f0:91 | | name | | | network_id | bb2b1f69-434c-4d6b-b4d7-84558a90381a | | security_groups | 3529707c-d1d2-4c08-9fe0-ac95a444f79b | | status | DOWN | | tenant_id | c9d3556cea054d80941c6f327b16140b | +-----------------------+----------------------------------------------------------------------------------+