Find out DHCP ports which are in DOWN state

There is two DHCP servers running in each network created under openstack. Each network will have two DHCP servers. The virtual machines in this network is getting IP Address from these DHCP servers. Some times, the status of these DHCP ports shows down while wer querying them. There is a bug reported in neutron, in which some times the ports shows DOWN, but it will be doing its duty. This Fix was released for later releases.  The release from Kilo and later wont affect by this bug.

So, how to find the ports whose device_owner is network:dhcp and its status is DOWN.

neutron port-list -c id -c tenant_id –status DOWN -c device_owner -c device_id –device_owner network:dhcp

The output will be like as follows (If there is a port having DOWN state)

+————————————–+———————————-+————–+——————————————————————————-+
| id | tenant_id | device_owner | device_id |
+————————————–+———————————-+————–+——————————————————————————-+
| e2aaeb4a-d2ba-4524-af0a-8448ca57f127 | f748e2aaffd64bc3965fedb43d0f7b7c | network:dhcp | dhcpfcf26f85-b8ec-5d7b-b015-96cd616db848-0178b0f9-30f0-4d6d-83c8-0147097b52a7 |
+————————————–+———————————-+————–+——————————————————————————-+

root@node-28:~# neutron port-show e2aaeb4a-d2ba-4524-af0a-8448ca57f127
+———————–+———————————————————————————————————–+
| Field | Value |
+———————–+———————————————————————————————————–+
| admin_state_up | False |
| allowed_address_pairs | |
| binding:host_id | node-27.mos8.example.com |
| binding:profile | {} |
| binding:vif_details | {“port_filter”: true, “ovs_hybrid_plug”: true} |
| binding:vif_type | ovs |
| binding:vnic_type | normal |
| device_id | dhcpfcf26f85-b8ec-5d7b-b015-96cd616db848-0178b0f9-30f0-4d6d-83c8-0147097b52a7 |
| device_owner | network:dhcp |
| dns_assignment | {“hostname”: “host-192-168-1-3”, “ip_address”: “192.168.1.3”, “fqdn”: “host-192-168-1-3.openstacklocal.”} |
| dns_name | |
| extra_dhcp_opts | |
| fixed_ips | {“subnet_id”: “72bc2ba1-0b4c-49e4-b0f9-4007cf08dfda”, “ip_address”: “192.168.1.3”} |
| id | e2aaeb4a-d2ba-4524-af0a-8448ca57f127 |
| mac_address | fa:16:3e:37:69:7b |
| name | |
| network_id | 0178b0f9-30f0-4d6d-83c8-0147097b52a7 |
| port_security_enabled | False |
| security_groups | |
| status | DOWN |
| tenant_id | f748e2aaffd64bc3965fedb43d0f7b7c |
+———————–+———————————————————————————————————–+
root@node-28:~#

stacker has written 18 articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Humans Only. * Time limit is exhausted. Please reload the CAPTCHA.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>