mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
This PR fixes #5058 when start a vm, the old entries in databag for the vm (with same mac addresses) should be removed then set again, to avoid duplicated records in dhcpentry databag and also /etc/dhcphosts.txt Testing with Isolated networks: (1) stop vm, change vm ip address, start vm vm info is updated in /etc/dhcphosts.txt and /etc/cloudstack/dhcpentry.json (2) stop vm, expunge vm. vm is removed from /etc/dhcphosts.txt and /var/lib/misc/dnsmasq.leases Testing with VPC: (1) create vm in 2 vpc tiers vm has 2 entries in /etc/dhcphosts.txt, and /etc/cloudstack/dhcpentry.json (2) stop vm, change ip addresses, change nics order, start vm entries are updated in /etc/dhcphosts.txt and /etc/cloudstack/dhcpentry.json (3) remove a nic from vm (hot unplug) vm nic is removed from /etc/dhcphosts.txt and /var/lib/misc/dnsmasq.leases entry in /etc/cloudstack/dhcpentry.json is updated.