You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/02/26 15:07:39 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #3913: Fix dhcp infinite lease time

DaanHoogland commented on a change in pull request #3913: Fix dhcp infinite lease time
URL: https://github.com/apache/cloudstack/pull/3913#discussion_r384552233
 
 

 ##########
 File path: systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
 ##########
 @@ -174,18 +174,15 @@ def write_hosts(self):
 
     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))
 
 Review comment:
   you need to unindent by one space as you made the base statement one char shorter as well. :P

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services