cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pdube <...@git.apache.org>
Subject [GitHub] cloudstack pull request: Enhance VR performance
Date Wed, 20 Jan 2016 14:24:28 GMT
Github user pdube commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1346#discussion_r50259089
  
    --- Diff: systemvm/patches/debian/config/opt/cloud/bin/configure.py ---
    @@ -901,79 +901,123 @@ def processStaticNatRule(self, rule):
     
     
     def main(argv):
    +    # The file we are currently processing, if it is "cmd_line.json" everything will
be processed.
    +    process_file = argv[1]
    +
    +    # process_file can be None, if so assume cmd_line.json
    +    if process_file is None:
    +        process_file = "cmd_line.json"
    +
    +    # Track if changes need to be committed to NetFilter
    +    iptables_change = False
    +
    +    # The "GLOBAL" Configuration object
         config = CsConfig()
    +
         logging.basicConfig(filename=config.get_logger(),
                             level=config.get_level(),
                             format=config.get_format())
    +
    +    # Load stored ip adresses from disk to CsConfig()
         config.set_address()
     
         logging.debug("Configuring ip addresses")
    -    # IP configuration
         config.address().compare()
         config.address().process()
     
    -    logging.debug("Configuring vmpassword")
    -    password = CsPassword("vmpassword", config)
    -    password.process()
    +    if process_file in ["cmd_line.json", "guest_network.json"]:
    +        logging.debug("Configuring Guest Network")
    +        iptables_change = True
    +
    +    if process_file in ["cmd_line.json", "vm_password.json"]:
    +        logging.debug("Configuring vmpassword")
    +        password = CsPassword("vmpassword", config)
    +        password.process()
     
    -    logging.debug("Configuring vmdata")
    -    metadata = CsVmMetadata('vmdata', config)
    -    metadata.process()
    +    if process_file in ["cmd_line.json", "vm_metadata.json"]:
    +        logging.debug("Configuring vmdata")
    +        metadata = CsVmMetadata('vmdata', config)
    +        metadata.process()
     
    -    logging.debug("Configuring networkacl")
    +    # Always run both CsAcl().process() methods
    +    # They fill the base rules in config.fw[]
         acls = CsAcl('networkacl', config)
         acls.process()
     
    -    logging.debug("Configuring firewall rules")
         acls = CsAcl('firewallrules', config)
         acls.process()
     
    -    logging.debug("Configuring PF rules")
         fwd = CsForwardingRules("forwardingrules", config)
         fwd.process()
     
    -    logging.debug("Configuring s2s vpn")
         vpns = CsSite2SiteVpn("site2sitevpn", config)
         vpns.process()
     
    -    logging.debug("Configuring remote access vpn")
    -    #remote access vpn
         rvpn = CsRemoteAccessVpn("remoteaccessvpn", config)
         rvpn.process()
     
    -    logging.debug("Configuring vpn users list")
    -    #remote access vpn users
    -    vpnuser = CsVpnUser("vpnuserlist", config)
    -    vpnuser.process()
    -
    -    logging.debug("Configuring dhcp entry")
    -    dhcp = CsDhcp("dhcpentry", config)
    -    dhcp.process()
    -
    -    logging.debug("Configuring load balancer")
         lb = CsLoadBalancer("loadbalancer", config)
         lb.process()
     
    -    logging.debug("Configuring monitor service")
    -    mon = CsMonitor("monitorservice", config)
    -    mon.process()
    +    if process_file in ["cmd_line.json", "network_acl.json"]:
    +        logging.debug("Configuring networkacl")
    +        iptables_change = True
    +
    +    if process_file in ["cmd_line.json", "firewall_rules.json"]:
    +        logging.debug("Configuring firewall rules")
    +        iptables_change = True
    +
    +    if process_file in ["cmd_line.json", "forwarding_rules.json", "staticnat_rules.json"]:
    +        logging.debug("Configuring PF rules")
    --- End diff --
    
    Hey @wilderrodrigues,
    
    I understand the checks that are being made. However, I do not think it is appropriate
to log that you are configuring PFR, after they have already been processed and configured.
I think it can be misleading while debugging/searching logs. 
    
    There are certain code paths that are executed regardless of the config file and they
are only logged after the fact -> acls, fwd, vpns, rvpn, lb. So, if an error occurs in
any of the functions, there are no logs to see what was being executed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message