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

andrijapanic pushed a commit to branch andrijapanicsb-patch-3
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 93b9c7f81722e49da55536558afdaf923aceaed2
Author: Andrija Panic <[email protected]>
AuthorDate: Sun Nov 3 09:30:32 2019 +0100

    Increase lease time to infinite
    
    Lease time set to effectively infinite (36000+ days) since we fully control 
VM lifecycle 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, it's active lease and DHCP/DNS config is properly 
removed from related files in VR.
---
 systemvm/debian/opt/cloud/bin/cs/CsDhcp.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py 
b/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
index 56b4419..95dce3e 100755
--- a/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
+++ b/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
@@ -160,9 +160,11 @@ class CsDhcp(CsDataBag):
 
     def add(self, entry):
         self.add_host(entry['ipv4_address'], entry['host_name'])
-        # lease time boils down to once a month
-        # with a splay of 60 hours to prevent storms
-        lease = randint(700, 760)
+        # Lease time is effectively infinite (36000+ days) since we fully 
control VM lifecycle 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, it's lease and DHCP/DNS config is properly 
removed from related files in VR
+        lease = randint(870000, 870010)
 
         if entry['default_entry']:
             self.cloud.add("%s,%s,%s,%sh" % (entry['mac_address'],

Reply via email to