Status: New
Owner: ----

New issue 1071 by [email protected]: LXC should setup NIC IPs, if configured in ganeti
https://code.google.com/p/ganeti/issues/detail?id=1071

With the LXC hypervisor, it is possible to setup NIC configuration (IP, gateway) without the need to delegate this task to the OS-interface. It has the advantage, that one could drop the net_admin capability.

I quickly hacked my Ganeti installation (2.14) and ignored IPv6 completely (assuming the gateway is on the 1st NIC):

--- old/hv_lxc.py  2015-03-09 10:37:19.000000000 +0100
+++ new/hv_lxc.py  2015-04-21 15:37:22.000000000 +0200

  def _CreateConfigFile (self, instance, sda_dev_path):
    ...
    ...
       out.append("lxc.network.hwaddr = %s" % nic.mac)
       out.append("lxc.network.flags = up")
+      if nic.ip and nic.netinfo:
+ out.append("lxc.network.ipv4 = %s/%s" % ( nic.ip, nic.netinfo['network'].split('/')[1] ) )
+        if idx == 0:
+ out.append("lxc.network.ipv4.gateway = %s" % nic.netinfo['gateway'])

Perhaps this is useful for someone else.

Thanks, Sascha.


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

Reply via email to