Просмотр исходного кода

osmount: account for disabled LVM udev rules

The same minion pool may be used for os-morphing and disk replication.
However, we're disabling lvm-metad and the lvm udev rules before
disk replications to prevent the lvm volumes from being mounted.

This breaks os mounting during os morphing, the /dev/<vg> links
no longer being created.

We'll fix this by calling "vgmknodes" explicitly.
Lucian Petrut 9 часов назад
Родитель
Сommit
a59190b8d2

+ 1 - 0
coriolis/osmorphing/osmount/base.py

@@ -675,6 +675,7 @@ class BaseLinuxOSMountTools(luks_mixin.LinuxLUKSMixin, BaseSSHOSMountTools):
 
             self._exec_cmd("sudo vgchange -ay -S vg_uuid=%s" % vg_uuid)
             self._exec_cmd("sudo vgchange --refresh")
+            self._exec_cmd(f"sudo vgmknodes {vg_props['name']}")
             dev_vg_path = f"/dev/{vg_props['name']}"
             if not utils.test_ssh_path(self._ssh, dev_vg_path):
                 LOG.warning("Volume Group '%s' not found. Skipping.", dev_vg_path)

+ 2 - 0
coriolis/tests/osmorphing/osmount/test_base.py

@@ -1196,6 +1196,7 @@ class BaseLinuxOSMountToolsTestCase(test_base.CoriolisBaseTestCase):
             "",
             "",
             "",
+            "",
             "/dev/vg1/lv1",
             "/dev/sda1",
             "/dev/sdb1",
@@ -1217,6 +1218,7 @@ class BaseLinuxOSMountToolsTestCase(test_base.CoriolisBaseTestCase):
                 mock.call('sudo vgck'),
                 mock.call('sudo vgchange -ay -S vg_uuid=vgid1'),
                 mock.call('sudo vgchange --refresh'),
+                mock.call('sudo vgmknodes vg1'),
                 mock.call('sudo ls -1 /dev/vg1/*'),
                 mock.call('readlink -en /dev/sda1'),
                 mock.call('readlink -en /dev/sdb1'),