You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by an...@apache.org on 2020/02/24 11:29:20 UTC

[cloudstack] branch fix-infinite-lease-time-413 created (now 781d2ab)

This is an automated email from the ASF dual-hosted git repository.

andrijapanic pushed a change to branch fix-infinite-lease-time-413
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


      at 781d2ab  Fix dhcp infinite lease time

This branch includes the following new commits:

     new 781d2ab  Fix dhcp infinite lease time

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[cloudstack] 01/01: Fix dhcp infinite lease time

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andrijapanic pushed a commit to branch fix-infinite-lease-time-413
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 781d2ab08a25b62d53f80b8ef37d0f81ad0481a5
Author: Andrija Panic <45...@users.noreply.github.com>
AuthorDate: Mon Feb 24 12:29:00 2020 +0100

    Fix dhcp infinite lease time
    
    The previous setup of many hours would not work, due to some internal dnsmasq issues - lease was set correctly, but dnsmasq was setting the dhcp-renew-time (and rebind time) to less than 2 years from the date the lease was issued.
    
    Using "infinite" as the value (instead of the number) works as expected - and (atm) the renew date is set to year 2088, etc.
---
 systemvm/debian/opt/cloud/bin/cs/CsDhcp.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py b/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
index d0b40e5..f1984ba 100755
--- a/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
+++ b/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
@@ -174,18 +174,15 @@ class CsDhcp(CsDataBag):
 
     def add(self, entry):
         self.add_host(entry['ipv4_address'], entry['host_name'])
-        # Lease time set to effectively infinite (36000+ days) since we properly control all DHCP/DNS config via CloudStack.
+        # Lease time set to "infinite" since we properly control all DHCP/DNS config via CloudStack.
         # Infinite time helps avoid some edge cases which could cause DHCPNAK being sent to VMs since
         # (RHEL) system lose routes when they receive DHCPNAK.
         # When VM is expunged, its active lease and DHCP/DNS config is properly removed from related files in VR,
         # so the infinite duration of lease does not cause any issues or garbage.
-        # There will be soon a PR which also regenerates the /var/lib/misc/dnsmasq.leases (active lease DB file)
-        # in the new VR (when restarting network with cleanup), which will help around RHEL edge cases (described above)
-        # for the VMs who are already running in productions systems with 30d lease time.
-        lease = randint(870000, 870010)
+        lease = 'infinite'
 
         if entry['default_entry']:
-            self.cloud.add("%s,%s,%s,%sh" % (entry['mac_address'],
+            self.cloud.add("%s,%s,%s,%s" % (entry['mac_address'],
                                              entry['ipv4_address'],
                                              entry['host_name'],
                                              lease))