the ip of port which device type is dhcp is null

Bug #1808504 reported by guotao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Expired
Undecided
Unassigned

Bug Description

the ip of port which device type is network:dhcp is null

There are two DHCP agents in openstack system.
1.create a network which name is xxxtest;
2.create a subnet 'subnet1' in xxxtest .The CIDR of this subnet is 192.168.10.0/24 and the ip range is default.Beaause there are two dhcp agents, so two ports are created which device owner is network:dhcp.Each of port has a IP address.
the horizon like this:
name fix ip device owner status
xxx 192.168.10.2 network:dhcp running
xxx 192.168.10.3 network:dhcp running
3.create a subnet 'subnet2' in xxxtest. The CIDR of this subnet is 192.168.11.0/24.But set the subnet ip range 192.168.11.2-192.168.11.2.There is only one available ip in subnet.
[root@node243 ~]# openstack subnet create --network xxxtest --subnet-range 192.168.11.0/24 --allocation-pool start=192.168.11.2,end=192.168.11.2 subnet1
+-------------------+--------------------------------------+
| Field | Value |
+-------------------+--------------------------------------+
| allocation_pools | 192.168.11.2-192.168.11.2 |
| cidr | 192.168.11.0/24 |
| created_at | 2018-12-14T08:34:40Z |
| description | |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 192.168.11.1 |
| host_routes | |
| id | 2a8ead23-977e-4674-ace5-ebd5427ff5b5 |
| ip_version | 4 |
| ipv6_address_mode | None |
| ipv6_ra_mode | None |
| name | subnet1 |
| network_id | b5d92781-3f09-4898-8279-55b14b7ffe67 |
| project_id | f8cc4f84ba4c44c8be1bbeeacd9162ce |
| revision_number | 0 |
| segment_id | None |
| service_types | |
| subnetpool_id | None |
| tags | |
| updated_at | 2018-12-14T08:34:40Z |
+-------------------+--------------------------------------+
4.list the ports info
[root@node243 ~]# openstack port list --network xxxtest
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+
| ID | Name | MAC Address | Fixed IP Addresses | Status |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+
| 176b3f71-0e54-4df1-8928-b4e5b199ee1c | | fa:16:3e:36:c9:39 | ip_address='192.168.11.2', subnet_id='2a8ead23-977e-4674-ace5-ebd5427ff5b5' | ACTIVE |
| | | | ip_address='192.168.168.3', subnet_id='7b13dd1d-8b33-4e86-a225-0babfe477f71' | |
| e092f58a-667f-42f0-a8e4-3647c5f1b3f1 | | fa:16:3e:70:f0:e1 | ip_address='192.168.168.2', subnet_id='7b13dd1d-8b33-4e86-a225-0babfe477f71' | DOWN |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+
5.delete the first subnet and list the port in xxxtest network
[root@node243 ~]# openstack subnet delete 7b13dd1d-8b33-4e86-a225-0babfe477f71
[root@node243 ~]# openstack port list --network xxxtest
+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------+--------+
| ID | Name | MAC Address | Fixed IP Addresses | Status |
+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------+--------+
| 176b3f71-0e54-4df1-8928-b4e5b199ee1c | | fa:16:3e:36:c9:39 | ip_address='192.168.11.2', subnet_id='2a8ead23-977e-4674-ace5-ebd5427ff5b5' | ACTIVE |
| e092f58a-667f-42f0-a8e4-3647c5f1b3f1 | | fa:16:3e:70:f0:e1 | | ACTIVE |
+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------+--------+

so,there is a port which Fixed IP Addresses is null。

Changed in neutron:
status: New → Incomplete
Revision history for this message
Bernard Cafarelli (bcafarel) wrote :

Hi, I am bit lost with your reproducer scenario, do these steps look OK:
openstack network create xxxtest
openstack subnet create --network xxxtest --subnet-range 192.168.10.0/24 --allocation-pool start=192.168.10.2,end=192.168.10.11 subnet1
openstack subnet create --network xxxtest --subnet-range 192.168.11.0/24 --allocation-pool start=192.168.11.2,end=192.168.11.2 subnet2

This creates a single port for DHCP with IPs in both subnets:
openstack port list --network xxxtest -f json
[
  {
    "Status": "ACTIVE",
    "Fixed IP Addresses": "ip_address='192.168.10.2', subnet_id='5b69c973-fcca-4e1a-ae84-7d154f5c0869'\nip_address='192.168.11.2', subnet_id='2d0bd114-d0b2-46d3-83ed-71592fbf1989'",
    "ID": "69939e7b-573c-47ee-8db9-83b70f2ecd96",
    "MAC Address": "fa:16:3e:3b:9c:53",
    "Name": ""
  }
]

It matches port 176b3f71-0e54-4df1-8928-b4e5b199ee1c in your example (which after delete also has only one IP left as expected)

This other port listed the bug is strange, it is DOWN, with IP outside of the subnet range (192.168.168.3 so not .10.x or .11.x)

What is your Openstack version and neutron configuration?

Revision history for this message
guotao (guotao.bj) wrote :

Your question ----This creates a single port for DHCP with IPs in both subnets.Because there is only one dhcp agent in neutron.There is a premise about my bug,There are two Dhcp agent in neutron.If you create a subnet with only one available ip address,you will see one dhcp port with two ip address,the other one has only one ip addr.Then you delete the subnet with more than one ip address,you will see one dhcp port with none ip address

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for neutron because there has been no activity for 60 days.]

Changed in neutron:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.