Skip to content
Snippets Groups Projects

Curtin Userdata customization: update sysctl to allow running MANY lxd containers

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Fulvio Galeazzi
    Edited
    curtin_userdata_ubuntu_amd64_generic_xenial_sysctl 1.59 KiB
    # 
    #  Xenial: update some sysctl settings so that Juju can run more than 12 LXC containers on a physical server
    # 
    
    diff -c curtin_userdata_ubuntu_amd64_generic_trusty_csd curtin_userdata_ubuntu_amd64_generic_xenial_csd
    *** curtin_userdata_ubuntu_amd64_generic_trusty_csd     2017-03-06 15:48:46.968799000 +0000
    --- curtin_userdata_ubuntu_amd64_generic_xenial_csd     2017-02-07 09:56:18.710546571 +0000
    ***************
    *** 27,33 ****
    --- 27,39 ----
        timezone_01_config: ["curtin", "in-target", "--", "sh", "-c", "ln -sf /usr/share/zoneinfo/Europe/Vatican /etc/timezone"]
        timezone_02_set: ["curtin", "in-target", "--", "sh", "-c", "dpkg-reconfigure --frontend noninteractive tzdata"]
        limits_01_add: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo '*  soft  nofile  1048576' >> /etc/security/limits.conf ; /bin/echo '*  hard  nofile  1048576' >> /etc/security/limits.conf"]
    +   sysctl_01_add: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo 'fs.inotify.max_queued_events = 1048576' >> /etc/sysctl.conf "]
    +   sysctl_02_add: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo 'fs.inotify.max_user_instances =   2048' >> /etc/sysctl.conf "]
    +   sysctl_03_add: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo 'fs.inotify.max_user_watches =  1048576' >> /etc/sysctl.conf "]
    +   sysctl_04_add: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo 'vm.max_map_count =              262144' >> /etc/sysctl.conf "]
        ifaceeth0_01_preup: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo 'pre-up  [ -z `cat /proc/net/bonding/* | grep Slave | grep eth0` ] && true ' >> /etc/network/interfaces.d/eth0.cfg"]
        
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment