← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1427022] Re: not releasing IP address when deleting VM, port, LB VIP

 

On checking this behavior, i think this is not a bug. When all the ip
addresses are exhausted, new audit is done(during new instance creation)
and the table “ ipavailabilityranges “ is updated correctly.

kindly check the following reference,
https://review.openstack.org/#/c/58017/


In the following observation, we created a subnet with ip address range, 44.44.44.1 to 44.44.44.14

Stage 1: After creating 12 instances in that ip range, the ip
availability is shown as first_ip: 44.44.44.13 to 44.44.44.14

mysql> select * from neutron.ipavailabilityranges where allocation_pool_id;
+--------------------------------------+-----------------+-----------------+
| allocation_pool_id                   | first_ip        | last_ip         |
+--------------------------------------+-----------------+-----------------+
| 03a7c8a3-c2e1-4924-b007-0dbf9c338dbf | 22.22.22.107    | 22.22.22.254    |
| 03a7c8a3-c2e1-4924-b007-0dbf9c338dbf | 22.22.22.2      | 22.22.22.99     |
| 1323bb8b-51ac-41a4-9475-3b4f8ef57200 | 10.10.10.10     | 10.10.10.254    |
| 136975eb-0271-49a9-b51f-7bb8cba5b559 | 10.10.10.3      | 10.10.10.254    |
| 19a8bcca-a9c5-44d4-b949-047e8f989bf0 | 44.44.44.13     | 44.44.44.14     |
| 6e64918a-c708-464d-9cde-d257c0ac66f9 | 22.22.22.113    | 22.22.22.200    |
| 6e64918a-c708-464d-9cde-d257c0ac66f9 | 22.22.22.2      | 22.22.22.99     |
| 6e64918a-c708-464d-9cde-d257c0ac66f9 | 22.22.22.202    | 22.22.22.254    |
+--------------------------------------+-----------------+-----------------+

Stage 2: After creating 14 instance for that subnet, no entry for that
subnet range.

mysql> select * from neutron.ipavailabilityranges where allocation_pool_id;
+--------------------------------------+-----------------+-----------------+
| allocation_pool_id                   | first_ip        | last_ip         |
+--------------------------------------+-----------------+-----------------+
| 03a7c8a3-c2e1-4924-b007-0dbf9c338dbf | 22.22.22.107    | 22.22.22.254    |
| 03a7c8a3-c2e1-4924-b007-0dbf9c338dbf | 22.22.22.2      | 22.22.22.99     |
| 1323bb8b-51ac-41a4-9475-3b4f8ef57200 | 10.10.10.10     | 10.10.10.254    |
| 136975eb-0271-49a9-b51f-7bb8cba5b559 | 10.10.10.3      | 10.10.10.254    |
| 6e64918a-c708-464d-9cde-d257c0ac66f9 | 22.22.22.113    | 22.22.22.200    |
| 6e64918a-c708-464d-9cde-d257c0ac66f9 | 22.22.22.2      | 22.22.22.99     |
| 6e64918a-c708-464d-9cde-d257c0ac66f9 | 22.22.22.202    | 22.22.22.254    |
+--------------------------------------+-----------------+-----------------+

Stage 3: instances with ip address 44.44.44.3, 44.44.44.4, 44.44.44.7,
44.44.44.9, 44.44.44.13 and 44.44.44.14 are deleted. After creating new
instance ip address 44.44.44.3 is assigned to new instance and remaining
ip's are shown in availability range are as  follows,


mysql> select * from neutron.ipavailabilityranges where allocation_pool_id;
+--------------------------------------+-----------------+-----------------+
| allocation_pool_id                   | first_ip        | last_ip         |
+--------------------------------------+-----------------+-----------------+
| 03a7c8a3-c2e1-4924-b007-0dbf9c338dbf | 22.22.22.107    | 22.22.22.254    |
| 03a7c8a3-c2e1-4924-b007-0dbf9c338dbf | 22.22.22.2      | 22.22.22.99     |
| 1323bb8b-51ac-41a4-9475-3b4f8ef57200 | 10.10.10.10     | 10.10.10.254    |
| 136975eb-0271-49a9-b51f-7bb8cba5b559 | 10.10.10.3      | 10.10.10.254    |
| 19a8bcca-a9c5-44d4-b949-047e8f989bf0 | 44.44.44.13     | 44.44.44.14     |
| 19a8bcca-a9c5-44d4-b949-047e8f989bf0 | 44.44.44.4      | 44.44.44.4      |
| 19a8bcca-a9c5-44d4-b949-047e8f989bf0 | 44.44.44.7      | 44.44.44.7      |
| 19a8bcca-a9c5-44d4-b949-047e8f989bf0 | 44.44.44.9      | 44.44.44.9      |
| 6e64918a-c708-464d-9cde-d257c0ac66f9 | 22.22.22.113    | 22.22.22.200    |
| 6e64918a-c708-464d-9cde-d257c0ac66f9 | 22.22.22.2      | 22.22.22.99     |
| 6e64918a-c708-464d-9cde-d257c0ac66f9 | 22.22.22.202    | 22.22.22.254    |
+--------------------------------------+-----------------+-----------------+

So, this is not a problem and if needed this behavior can be documented.

** Changed in: neutron
       Status: Incomplete => Opinion

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1427022

Title:
  not releasing IP address when deleting VM, port, LB VIP

Status in OpenStack Neutron (virtual network service):
  Opinion

Bug description:
  
  I am testing with Juno 2014.2.1 release.

  When I delete neutron port, VM, or LB VIP, neutron.ipavailabilityranges table was not updated as expected.
  (I mean subnet IPs are not released to be used again.)

  
   
  ##case 1. deleting neutron port

  
  1-1 create network/subnet

  # neutron net-create twroh_22net
  Created a new network:
  +---------------------------+--------------------------------------+
  | Field                     | Value                                |
  +---------------------------+--------------------------------------+
  | admin_state_up            | True                                 |
  | id                        | 1e4e010a-3984-4058-88c8-59ceff79cf3d |
  | name                      | twroh_22net                          |
  | provider:network_type     | vxlan                                |
  | provider:physical_network |                                      |
  | provider:segmentation_id  | 22                                   |
  | router:external           | False                                |
  | shared                    | False                                |
  | status                    | ACTIVE                               |
  | subnets                   |                                      |
  | tenant_id                 | 13aae994774947298d231cfd361c1ca2     |
  +---------------------------+--------------------------------------+

  
  # neutron subnet-create --name twroh_22subnet twroh_22net 22.22.22.0/24
  Created a new subnet:
  +-------------------+------------------------------------------------+
  | Field             | Value                                          |
  +-------------------+------------------------------------------------+
  | allocation_pools  | {"start": "22.22.22.2", "end": "22.22.22.254"} |
  | cidr              | 22.22.22.0/24                                  |
  | dns_nameservers   |                                                |
  | enable_dhcp       | True                                           |
  | gateway_ip        | 22.22.22.1                                     |
  | host_routes       |                                                |
  | id                | 34f7be13-c34c-45fb-b2bc-fa1b64da1d25           |
  | ip_version        | 4                                              |
  | ipv6_address_mode |                                                |
  | ipv6_ra_mode      |                                                |
  | name              | twroh_22subnet                                 |
  | network_id        | 1e4e010a-3984-4058-88c8-59ceff79cf3d           |
  | tenant_id         | 13aae994774947298d231cfd361c1ca2               |
  +-------------------+------------------------------------------------+

  1-2 select neutron.ipavailabilityranges table

  MariaDB [(none)]> select * from neutron.ipavailabilityranges where allocation_pool_id like '1e5d%';
  +--------------------------------------+------------+--------------+
  | allocation_pool_id                   | first_ip   | last_ip      |
  +--------------------------------------+------------+--------------+
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.2 | 22.22.22.254 |
  +--------------------------------------+------------+--------------+

  1-3 create a port with IP 22.22.22.100

  # NETID=1e4e010a-3984-4058-88c8-59ceff79cf3d
  # SUBNETID=34f7be13-c34c-45fb-b2bc-fa1b64da1d25 
  # neutron port-create --fixed-ip subnet_id=$SUBNETID,ip_address=22.22.22.100 $NETID
  Created a new port:
  +-----------------------+-------------------------------------------------------------------------------------+
  | Field                 | Value                                                                               |
  +-----------------------+-------------------------------------------------------------------------------------+
  | admin_state_up        | True                                                                                |
  | allowed_address_pairs |                                                                                     |
  | binding:host_id       |                                                                                     |
  | binding:profile       | {}                                                                                  |
  | binding:vif_details   | {}                                                                                  |
  | binding:vif_type      | unbound                                                                             |
  | binding:vnic_type     | normal                                                                              |
  | device_id             |                                                                                     |
  | device_owner          |                                                                                     |
  | fixed_ips             | {"subnet_id": "34f7be13-c34c-45fb-b2bc-fa1b64da1d25", "ip_address": "22.22.22.100"} |
  | id                    | 5ec5b197-d730-4e1b-8c99-057d43c0aa64                                                |
  | mac_address           | fa:16:3e:f4:b8:a7                                                                   |
  | name                  |                                                                                     |
  | network_id            | 1e4e010a-3984-4058-88c8-59ceff79cf3d                                                |
  | security_groups       | c20b355a-3af1-475c-a226-a0b6c7799d2c                                                |
  | status                | DOWN                                                                                |
  | tenant_id             | 13aae994774947298d231cfd361c1ca2                                                    |
  +-----------------------+-------------------------------------------------------------------------------------+

  1-4 select neutron.ipavailabilityranges table (IP 22.22.22.100 used,
  101 and 102 were used by DHCP)

  MariaDB [(none)]> select * from neutron.ipavailabilityranges where allocation_pool_id like '1e5d%';
  +--------------------------------------+--------------+--------------+
  | allocation_pool_id                   | first_ip     | last_ip      |
  +--------------------------------------+--------------+--------------+
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.103 | 22.22.22.254 |
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.2   | 22.22.22.99  |
  +--------------------------------------+--------------+--------------+
  2 rows in set (0.00 sec)

  1-5 delete neutron port

  # neutron port-delete 5ec5b197-d730-4e1b-8c99-057d43c0aa64 
  Deleted port: 5ec5b197-d730-4e1b-8c99-057d43c0aa64

  
  1-6 select neutron.ipavailabilityranges table (IP 22.22.22.100 was not released)

  MariaDB [(none)]> select * from neutron.ipavailabilityranges where allocation_pool_id like '1e5d%';
  +--------------------------------------+--------------+--------------+
  | allocation_pool_id                   | first_ip     | last_ip      |
  +--------------------------------------+--------------+--------------+
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.103 | 22.22.22.254 |
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.2   | 22.22.22.99  |
  +--------------------------------------+--------------+--------------+

  
  ##case 2. deleting VM

  2-1 create a test VM 
  # nova boot --flavor lin_c1m1 --image Ubuntu_12.04 --nic net-id=$NETID twroh_22net_vm01

  2-2  select neutron.ipavailabilityranges table (IP 22.22.22.103 was
  used)

  MariaDB [(none)]> select * from neutron.ipavailabilityranges where allocation_pool_id like '1e5d%';
  +--------------------------------------+--------------+--------------+
  | allocation_pool_id                   | first_ip     | last_ip      |
  +--------------------------------------+--------------+--------------+
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.104 | 22.22.22.254 |
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.2   | 22.22.22.99  |
  +--------------------------------------+--------------+--------------+

  2-3 create second VM
  # nova boot --flavor lin_c1m1 --image Ubuntu_12.04 --nic net-id=$NETID twroh_22net_vm02

  2-4 select neutron.ipavailabilityranges table (IP 22.22.22.104 was used)
  MariaDB [(none)]> select * from neutron.ipavailabilityranges where allocation_pool_id like '1e5d%';
  +--------------------------------------+--------------+--------------+
  | allocation_pool_id                   | first_ip     | last_ip      |
  +--------------------------------------+--------------+--------------+
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.105 | 22.22.22.254 |
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.2   | 22.22.22.99  |
  +--------------------------------------+--------------+--------------+

  2-5 delete first VM

  # nova delete twroh_22net_vm01 
  Request to delete server twroh_22net_vm01 has been accepted.
  # nova list |grep  twroh_22net_vm01  
  # 

  2-6  select neutron.ipavailabilityranges table (IP 22.22.22.103 was not released )
  MariaDB [(none)]> select * from neutron.ipavailabilityranges where allocation_pool_id like '1e5d%';
  +--------------------------------------+--------------+--------------+
  | allocation_pool_id                   | first_ip     | last_ip      |
  +--------------------------------------+--------------+--------------+
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.105 | 22.22.22.254 |
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.2   | 22.22.22.99  |
  +--------------------------------------+--------------+--------------+

  2-7 delete second VM
  # nova delete twroh_22net_vm02
  Request to delete server twroh_22net_vm02 has been accepted.
  # nova list |grep  twroh_22net_vm02
  #

  2-8  select neutron.ipavailabilityranges table (IP 22.22.22.104 was not released )
  MariaDB [(none)]> select * from neutron.ipavailabilityranges where allocation_pool_id like '1e5d%';
  +--------------------------------------+--------------+--------------+
  | allocation_pool_id                   | first_ip     | last_ip      |
  +--------------------------------------+--------------+--------------+
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.105 | 22.22.22.254 |
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.2   | 22.22.22.99  |
  +--------------------------------------+--------------+--------------+


  ##case 3. deleting LB VIP

  3-1 create LB POOL

  # neutron lb-pool-create --lb-method SOURCE_IP --name twroh_lb_pool1 --protocol HTTP --subnet-id $SUBNETID
  Created a new pool:
  +------------------------+--------------------------------------+
  | Field                  | Value                                |
  +------------------------+--------------------------------------+
  | admin_state_up         | True                                 |
  | description            |                                      |
  | health_monitors        |                                      |
  | health_monitors_status |                                      |
  | id                     | ef6194a3-6f71-4f2f-94d7-af5af4f27a1d |
  | lb_method              | SOURCE_IP                            |
  | members                |                                      |
  | name                   | twroh_lb_pool1                       |
  | protocol               | HTTP                                 |
  | provider               | haproxy                              |
  | status                 | PENDING_CREATE                       |
  | status_description     |                                      |
  | subnet_id              | 34f7be13-c34c-45fb-b2bc-fa1b64da1d25 |
  | tenant_id              | 13aae994774947298d231cfd361c1ca2     |
  | vip_id                 |                                      |
  +------------------------+--------------------------------------+

  3-2 create LB VIP with IP 22.22.22.250

  # neutron lb-vip-create --address 22.22.22.250 --name twroh_lb_pool1_vip --protocol-port 80 --protocol HTTP --subnet-id $SUBNETID twroh_lb_pool1 
  Created a new vip:
  +---------------------+--------------------------------------+
  | Field               | Value                                |
  +---------------------+--------------------------------------+
  | address             | 22.22.22.250                         |
  | admin_state_up      | True                                 |
  | connection_limit    | -1                                   |
  | description         |                                      |
  | id                  | b94b3e2f-c642-45d8-83c9-63694ecd8a5c |
  | name                | twroh_lb_pool1_vip                   |
  | pool_id             | ef6194a3-6f71-4f2f-94d7-af5af4f27a1d |
  | port_id             | fef67c07-3527-40f9-ad1c-126e6c5602ba |
  | protocol            | HTTP                                 |
  | protocol_port       | 80                                   |
  | session_persistence |                                      |
  | status              | PENDING_CREATE                       |
  | status_description  |                                      |
  | subnet_id           | 34f7be13-c34c-45fb-b2bc-fa1b64da1d25 |
  | tenant_id           | 13aae994774947298d231cfd361c1ca2     |
  +---------------------+--------------------------------------+

  3-3 select neutron.ipavailabilityranges table (IP 22.22.22.250 was
  used )

  MariaDB [(none)]> select * from neutron.ipavailabilityranges where allocation_pool_id like '1e5d%';
  +--------------------------------------+--------------+--------------+
  | allocation_pool_id                   | first_ip     | last_ip      |
  +--------------------------------------+--------------+--------------+
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.105 | 22.22.22.249 |
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.2   | 22.22.22.99  |
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.251 | 22.22.22.254 |
  +--------------------------------------+--------------+--------------+

  3-4 delete LB VIP
  # neutron lb-vip-delete  b94b3e2f-c642-45d8-83c9-63694ecd8a5c 
  Deleted vip: b94b3e2f-c642-45d8-83c9-63694ecd8a5c
  t# neutron lb-vip-list |grep 22.22.22
  # 

  3-5 select neutron.ipavailabilityranges table (IP 22.22.22.250 was not released )
  MariaDB [(none)]> select * from neutron.ipavailabilityranges where allocation_pool_id like '1e5d%';
  +--------------------------------------+--------------+--------------+
  | allocation_pool_id                   | first_ip     | last_ip      |
  +--------------------------------------+--------------+--------------+
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.105 | 22.22.22.249 |
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.2   | 22.22.22.99  |
  | 1e5d0bec-11aa-422e-955c-6b96000e334d | 22.22.22.251 | 22.22.22.254 |
  +--------------------------------------+--------------+--------------+

  
  == END ==

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1427022/+subscriptions


References