[lxc-devel] [nova-lxd/master] Rally bugfixes

zulcss on Github lxc-bot at linuxcontainers.org
Thu Mar 31 14:07:37 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160331/fd9ea4c5/attachment.bin>
-------------- next part --------------
From 4421b67b52f214dde20e6870819dc500d29d6643 Mon Sep 17 00:00:00 2001
From: Chuck Short <chuck.short at canonical.com>
Date: Thu, 31 Mar 2016 09:55:06 -0400
Subject: [PATCH 1/2] Fix migration with configdrive

Make configdrive optional when migrating a configdrive
from one host to another. This is due to the fact
that disk paths are not migrated across.

Signed-off-by: Chuck Short <chuck.short at canonical.com>
---
 nova_lxd/nova/virt/lxd/config.py | 3 ++-
 nova_lxd/tests/test_config.py    | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/nova_lxd/nova/virt/lxd/config.py b/nova_lxd/nova/virt/lxd/config.py
index c3b66d0..ca214ac 100644
--- a/nova_lxd/nova/virt/lxd/config.py
+++ b/nova_lxd/nova/virt/lxd/config.py
@@ -302,7 +302,8 @@ def configure_disk_path(self, src_path, dest_path, vfs_type, instance):
             config = {}
             config[vfs_type] = {'path': dest_path,
                                 'source': src_path,
-                                'type': 'disk'}
+                                'type': 'disk',
+                                'optional': True}
             return config
         except Exception as ex:
             with excutils.save_and_reraise_exception():
diff --git a/nova_lxd/tests/test_config.py b/nova_lxd/tests/test_config.py
index e6cae3b..08f524c 100644
--- a/nova_lxd/tests/test_config.py
+++ b/nova_lxd/tests/test_config.py
@@ -78,7 +78,8 @@ def test_create_disk_path(self):
                                                  'fake_disk', instance)
         self.assertEqual({'fake_disk': {'path': '/fake/dest_path',
                                         'source': '/fake/src_path',
-                                        'type': 'disk'}}, config)
+                                        'type': 'disk',
+                                        'optional': True}}, config)
 
     def test_config_instance_options(self):
         instance = stubs._fake_instance()

From 56b12ba081f00cc20eb43f957a09d67c2c679213 Mon Sep 17 00:00:00 2001
From: Chuck Short <chuck.short at canonical.com>
Date: Thu, 31 Mar 2016 09:59:19 -0400
Subject: [PATCH 2/2] Fix logic error

When resizing a container on the same host, we just update the profile.
So dont try to recreate the container when it already exists.

Signed-off-by: Chuck Short <chuck.short at canonical.com>
---
 nova_lxd/nova/virt/lxd/migrate.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/nova_lxd/nova/virt/lxd/migrate.py b/nova_lxd/nova/virt/lxd/migrate.py
index ffd6070..0502815 100644
--- a/nova_lxd/nova/virt/lxd/migrate.py
+++ b/nova_lxd/nova/virt/lxd/migrate.py
@@ -109,9 +109,7 @@ def finish_migration(self, context, migration, instance, disk_info,
         LOG.debug("finish_migration called", instance=instance)
 
         if self.session.container_defined(instance.name, instance):
-            msg = _('Failed to find container %(instance)s') % \
-                {'instance': instance.name}
-            raise exception.NovaException(msg)
+            return 
 
         try:
             # Ensure that the instance directory exists


More information about the lxc-devel mailing list