[Rdo-list] What is missing commit "vifs: replace 'ifconfig' usage with 'ip'" from nova docker master branch ?

Boris Derzhavets bderzhavets at hotmail.com
Mon Mar 9 04:45:45 UTC 2015


Consider  commit 9d06520645f28d96ef905a709f8ff0c27842b58b
in nova-docker master branch https://git.openstack.org/cgit/stackforge/nova-docker/

It does :-

- utils.execute('ip', 'netns', 'exec', container_id, 'ifconfig',
- if_remote_name, ip, run_as_root=True)
+ utils.execute('ip', 'netns', 'exec', container_id, 'ip', 'addr',
+ 'add', ip, 'dev', if_remote_name, run_as_root=True)

The last statement should be followed by

utils.execute('ip', 'netns', 'exec', container_id, 'ip', 'link',
  'set', if_remote_name,'up',run_as_root=True)


otherwise containers interface is still down versus call with "ifconfig"

Patch bellow

diff --git a/novadocker/virt/docker/vifs.py b/novadocker/virt/docker/vifs.py
index a2e7b23..1d159f7 100644
--- a/novadocker/virt/docker/vifs.py
+++ b/novadocker/virt/docker/vifs.py
@@ -248,6 +248,8 @@ class DockerGenericVIFDriver(object):
                           run_as_root=True)
             utils.execute('ip', 'netns', 'exec', container_id, 'ip', 'addr',
                           'add', ip, 'dev', if_remote_name, run_as_root=True)
+            utils.execute('ip', 'netns', 'exec', container_id, 'ip', 'link',
+                          'set', if_remote_name,'up',run_as_root=True)
             if gateway is not None:
                 utils.execute('ip', 'netns', 'exec', container_id,
                               'ip', 'route', 'replace', 'default', 'via',

has been tested OK  .  Applying it allows to build Nova Docker Driver having network alive for both floating and private IPs. 

Boris.
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rdoproject.org/pipermail/dev/attachments/20150309/d30411b5/attachment.html>


More information about the dev mailing list