Skip to content

VR: DHCP doesn't work on new instance "not using configured address ... because it is leased to ..." #10436

Open
@salfers

Description

@salfers

problem

After creating a new instance in a shared network it would not successfully get an IP. DHCP requests were not answered.

Investigating the Virtual Router reveals the following:

# tail /var/log/dnsmasq.log 
Feb 20 10:59:34 dnsmasq-dhcp[1014]: not using configured address 62.113.210.163 because it is leased to 1e:00:cf:00:08:8d
Feb 20 10:59:34 dnsmasq-dhcp[1014]: DHCPDISCOVER(eth0) 1e:00:ac:00:08:8d no address available
Feb 20 10:59:49 dnsmasq-dhcp[1014]: not using configured address 62.113.210.163 because it is leased to 1e:00:cf:00:08:8d
Feb 20 10:59:49 dnsmasq-dhcp[1014]: DHCPDISCOVER(eth0) 1e:00:ac:00:08:8d no address available
Feb 20 10:59:55 dnsmasq-dhcp[1014]: not using configured address 62.113.210.163 because it is leased to 1e:00:cf:00:08:8d
Feb 20 10:59:55 dnsmasq-dhcp[1014]: DHCPDISCOVER(eth0) 1e:00:ac:00:08:8d no address available
Feb 20 11:00:02 dnsmasq-dhcp[1014]: not using configured address 62.113.210.163 because it is leased to 1e:00:cf:00:08:8d
Feb 20 11:00:02 dnsmasq-dhcp[1014]: DHCPDISCOVER(eth0) 1e:00:ac:00:08:8d no address available
Feb 20 11:00:09 dnsmasq-dhcp[1014]: not using configured address 62.113.210.163 because it is leased to 1e:00:cf:00:08:8d
Feb 20 11:00:09 dnsmasq-dhcp[1014]: DHCPDISCOVER(eth0) 1e:00:ac:00:08:8d no address available

1e:00:ac:00:08:8d belongs to the newly created VM (called "installdev") and according to the cloudstack UI it should have IP 62.113.210.163.
A VM with 1e:00:cf:00:08:8d indeed exists but is turned off and has a totally different IP.

The information in dnsmasq's data files looks correct:

# egrep '1e:00:cf:00:08:8d|1e:00:ac:00:08:8d' /etc/dhcphosts.txt 
1e:00:cf:00:08:8d,62.113.210.6,backup-test,infinite
1e:00:ac:00:08:8d,62.113.210.163,installdev,infinite
# egrep '1e:00:cf:00:08:8d|1e:00:ac:00:08:8d' /var/lib/misc/dnsmasq.leases 
0 1e:00:cf:00:08:8d 62.113.210.6 backup-test *
0 1e:00:ac:00:08:8d 62.113.210.163 installdev *

Checking the lease file for the same IP reveals older VMs that had this IP but all were already deleted:

# fgrep 62.113.210.163 /var/lib/misc/dnsmasq.leases 
0 1e:00:60:00:08:8d 62.113.210.163 test1 *
0 1e:00:1c:00:08:8d 62.113.210.163 VM-80afbd8e-3002-4ef6-9daf-ec5018b4a76c *
0 1e:00:da:00:08:8d 62.113.210.163 debian-test123 *
0 1e:00:f3:00:08:8d 62.113.210.163 debian-test11 *
0 1e:00:f9:00:08:8d 62.113.210.163 test2 *
0 1e:00:3d:00:08:8d 62.113.210.163 test3 *
0 1e:00:2f:00:08:8d 62.113.210.163 installdev *
0 1e:00:57:00:08:8d 62.113.210.163 installdev *
0 1e:00:b9:00:08:8d 62.113.210.163 installdev *
0 1e:00:35:00:08:8d 62.113.210.163 VM-b1bfa4e2-cbca-4af2-b073-c3080649e78c *
0 1e:00:ac:00:08:8d 62.113.210.163 installdev *

Given the situation I don't understand why dnsmasq think the IP is leased to different host.

versions

CloudStack 4.19.1.1
KVM virtualization

The steps to reproduce the bug

This happened randomly, so unfortunately I don't have reproducible steps.

What to do about it?

Maybe this check in dnsmasq can be turned off? Because Cloudstack is the sole authority on instance IP assignment.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions