[neutron] Instances can't get IP from the DHCP server in OpenStack

韩光宇 hanguangyu at uniontech.com
Tue Dec 7 13:05:25 UTC 2021


Hi , Thank you very very much, you can ask any questions. > If I understand well you have a single host all-in-one setup, am I right?< Yes, you are right. > You mentioned flat network, for that please check this document to be sure that you have everything set correctly: > https://docs.openstack.org/neutron/latest/admin/deploy-ovs-provider.html I have configured and recreated the network and instances according to this document. But the network behaves the same and still has no DHCP response. All settings is in line with this document, except the single host only have one nic, so I put all network in it, such as Management network adn Provider network. If you need any information, I will provider it soon. paste more details information in here: https://paste.opendev.org/show/811513/ Regards Han Guangyu ----------------- Original ------------------From:  "Lajos Katona"<katonalala at gmail.com>;
Date:  Tue, Dec 7, 2021 06:32 PM
To:  "韩光宇"<hanguangyu at uniontech.com>; 
Cc:  "openstack-discuss"<openstack-discuss at lists.openstack.org>; "王磊"<wangleic at uniontech.com>; 
Subject:  Re: [neutron] Instances can't get IP from the DHCP server in OpenStack

 

Hi,I have more questions than ready answers.
If I understand well you have a single host all-in-one setup, am I right?


You mentioned flat network, for that please check this document to be sure that you have everything set correctly:
https://docs.openstack.org/neutron/latest/admin/deploy-ovs-provider.html



Regards
Lajos Katona (lajoskatona)


韩光宇 <hanguangyu at uniontech.com> ezt írta (időpont: 2021. dec. 6., H, 17:19):

Hi,


I'm trying to create instance in OpenStack Victoria. But, I am facing a issues about dhcp of neutron.


I have OpenStack Victoria running in one baremetl server with uniontech os(a downstream of centos 8). I have a Flat network created in the range of 10.12.21.190-10.12.21.195. I selected to have a DHCP. The instance ran, and neutron-dhcp-agent.service had allocated a IP to it. 
# openstack server list +--------------------------------------+-------+--------+-----------------------+----------------+--------+ | ID                                   | Name  | Status | Networks              | Image          | Flavor | +--------------------------------------+-------+--------+-----------------------+----------------+--------+ | 4ccae37e-fbfe-4acb-a109-e1bc9175c2e0 | inst1 | ACTIVE | provider=10.12.21.192 | centos8-server | h2     | +--------------------------------------+-------+--------+-----------------------+----------------+--------+
But the instance can't get a response from DHCP.  No any error in log. And if I setup the ip manually in the instance I can get access to the gateway, dhcp port and external network.


I can catpure the DHCP request in any network device in the server, include dhcp port(10.12.21.190). But no response.  Dnsmasq process was running and had 
# openstack port list +--------------------------------------+------+-------------------+-----------------------------------------------------------------------------+--------+ | ID                                   | Name | MAC Address       | Fixed IP Addresses                                                          | Status | +--------------------------------------+------+-------------------+-----------------------------------------------------------------------------+--------+ | 5ab32ca8-2d1d-47cf-9a62-7c01d21abaf0 |      | fa:16:3e:1d:48:45 | ip_address='10.12.21.192', subnet_id='3daf5a55-e76a-4093-8533-78d9464b1beb' | ACTIVE | | 63fb2306-7759-4933-8d93-590e3a56f315 |      | fa:16:3e:c5:59:9a | ip_address='10.12.21.190', subnet_id='3daf5a55-e76a-4093-8533-78d9464b1beb' | ACTIVE | +--------------------------------------+------+-------------------+-----------------------------------------------------------------------------+--------+ # ip netns qdhcp-ec2c4d9d-888b-4312-b0af-ab2127b76e0e (id: 0) # sudo ip netns exec qdhcp-ec2c4d9d-888b-4312-b0af-ab2127b76e0e sudo tcpdump -n -S -i tap63fb2306-77|grep DHCP
## notes:  fa:16:3e:1d:48:45 is the mac of nic of inst1 ​
dropped privs to tcpdump tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on tap63fb2306-77, link-type EN10MB (Ethernet), capture size 262144 bytes 16:47:18.194028 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from fa:16:3e:1d:48:45, length 276 16:47:21.146736 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from fa:16:3e:1d:48:45, length 276 16:47:25.226387 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from fa:16:3e:1d:48:45, length 276


more detail informations:
# ps -ef|grep dnsmasq
dnsmasq     7441       1  0 12月03 ?      00:00:00 dnsmasq --no-hosts --no-resolv --pid-file=/var/lib/neutron/dhcp/ec2c4d9d-888b-4312-b0af-ab2127b76e0e/pid --dhcp-hostsfile=/var/lib/neutron/dhcp/ec2c4d9d-888b-4312-b0af-ab2127b76e0e/host --addn-hosts=/var/lib/neutron/dhcp/ec2c4d9d-888b-4312-b0af-ab2127b76e0e/addn_hosts --dhcp-optsfile=/var/lib/neutron/dhcp/ec2c4d9d-888b-4312-b0af-ab2127b76e0e/opts --dhcp-leasefile=/var/lib/neutron/dhcp/ec2c4d9d-888b-4312-b0af-ab2127b76e0e/leases --dhcp-match=set:ipxe,175 --dhcp-userclass=set:ipxe6,iPXE --local-service --bind-dynamic --dhcp-range=set:subnet-3daf5a55-e76a-4093-8533-78d9464b1beb,10.12.21.0,static,255.255.255.0,86400s --dhcp-option-force=option:mtu,1500 --dhcp-lease-max=256 --conf-file= --domain=openstacklocal
dnsmasq   317868       1  0 14:33 ?        00:00:00 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
root      317869  317868  0 14:33 ?        00:00:00 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
root      340315  317310  0 18:43 pts/2    00:00:00 grep --color=auto dnsmasq
[root at a16 ~]# cat /var/lib/neutron/dhcp/ec2c4d9d-888b-4312-b0af-ab2127b76e0e/host
fa:16:3e:c5:59:9a,host-10-12-21-190.openstacklocal,10.12.21.190
fa:16:3e:1d:48:45,host-10-12-21-192.openstacklocal,10.12.21.192


# ovs-vsctl show adbd4b0c-cb78-4b8f-b8a6-197c5948312c     Manager "ptcp:6640:127.0.0.1"         is_connected: true     Bridge br0         Controller "tcp:127.0.0.1:6633"             is_connected: true         fail_mode: secure         datapath_type: system         Port enp5s0             Interface enp5s0         Port phy-br0             Interface phy-br0                 type: patch                 options: {peer=int-br0}         Port br0             Interface br0                 type: internal     Bridge br-tun         Controller "tcp:127.0.0.1:6633"             is_connected: true         fail_mode: secure         datapath_type: system         Port br-tun             Interface br-tun                 type: internal         Port patch-int             Interface patch-int                 type: patch                 options: {peer=patch-tun}     Bridge br-int         Controller "tcp:127.0.0.1:6633"             is_connected: true         fail_mode: secure         datapath_type: system         Port int-br0             Interface int-br0                 type: patch                 options: {peer=phy-br0}         Port br-int             Interface br-int                 type: internal         Port tap63fb2306-77             tag: 1             Interface tap63fb2306-77                 type: internal         Port patch-tun             Interface patch-tun                 type: patch                 options: {peer=patch-int}         Port qvo5ab32ca8-2d             tag: 1             Interface qvo5ab32ca8-2d     ovs_version: "2.13.0". # ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     inet 127.0.0.1/8 scope host lo        valid_lft forever preferred_lft forever     inet6 ::1/128 scope host         valid_lft forever preferred_lft forever 2: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master ovs-system state UP group default qlen 1000     link/ether 1c:69:7a:92:be:30 brd ff:ff:ff:ff:ff:ff 3: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000     link/ether ea:f5:ce:24:93:12 brd ff:ff:ff:ff:ff:ff 4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000     link/ether 1c:69:7a:92:be:30 brd ff:ff:ff:ff:ff:ff     inet 10.12.21.142/24 scope global br0        valid_lft forever preferred_lft forever     inet6 fe80::1e69:7aff:fe92:be30/64 scope link         valid_lft forever preferred_lft forever 5: br-int: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000     link/ether ba:5d:16:cf:89:40 brd ff:ff:ff:ff:ff:ff     inet6 fe80::b85d:16ff:fecf:8940/64 scope link         valid_lft forever preferred_lft forever 9: br-tun: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000     link/ether 86:bb:24:69:7e:43 brd ff:ff:ff:ff:ff:ff 11: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000     link/ether 52:54:00:4d:96:e4 brd ff:ff:ff:ff:ff:ff     inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0        valid_lft forever preferred_lft forever 12: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000     link/ether 52:54:00:4d:96:e4 brd ff:ff:ff:ff:ff:ff 13: qbr5ab32ca8-2d: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000     link/ether 76:0e:be:40:a6:ee brd ff:ff:ff:ff:ff:ff 14: qvo5ab32ca8-2d at qvb5ab32ca8-2d: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master ovs-system state UP group default qlen 1000     link/ether 12:90:d5:07:2a:a2 brd ff:ff:ff:ff:ff:ff     inet6 fe80::1090:d5ff:fe07:2aa2/64 scope link         valid_lft forever preferred_lft forever 15: qvb5ab32ca8-2d at qvo5ab32ca8-2d: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master qbr5ab32ca8-2d state UP group default qlen 1000     link/ether 76:0e:be:40:a6:ee brd ff:ff:ff:ff:ff:ff     inet6 fe80::740e:beff:fe40:a6ee/64 scope link         valid_lft forever preferred_lft forever 16: tap5ab32ca8-2d: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master qbr5ab32ca8-2d state UNKNOWN group default qlen 1000     link/ether fe:16:3e:1d:48:45 brd ff:ff:ff:ff:ff:ff     inet6 fe80::fc16:3eff:fe1d:4845/64 scope link         valid_lft forever preferred_lft forever # cat /etc/neutron/plugins/ml2/openvswitch_agent.ini [ovs] local_ip = 10.12.21.142 datapath_type = system bridge_mappings = provider:br0 [vxlan] enable_vxlan = true local_ip = 10.12.21.142 l2_population = true prevent_arp_spoofing = True [securitygroup] enable_security_group = True firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver # cat /etc/neutron/dhcp_agent.ini  [DEFAULT] interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq enable_isolated_metadata = true
   
I would very very appreciate any kind of guidance or help.


Thanks,
Han Guangyu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20211207/db963051/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4C14173 at 2703EC48.155CAF61
Type: application/octet-stream
Size: 31847 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20211207/db963051/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 489E9CE5 at 068B6A33.155CAF61
Type: application/octet-stream
Size: 8758 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20211207/db963051/attachment-0003.obj>


More information about the openstack-discuss mailing list