]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
py-common/deployment: drop workarounds for old batch
authorJan Fajerski <jfajerski@suse.com>
Fri, 26 Jun 2020 13:29:59 +0000 (15:29 +0200)
committerJan Fajerski <jfajerski@suse.com>
Wed, 7 Oct 2020 09:22:40 +0000 (11:22 +0200)
This commit drops two workarounds in drive groups for the old batch
behaviour. OSDs on LVs no longer need to be created individually by
create (related to functional testing) and ceph-volume batch now filters
unavailable drives itself.

Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit 0f6f2b46a347c41a15f7ab2d532efb299f226698)

src/pybind/mgr/cephadm/tests/test_cephadm.py
src/python-common/ceph/deployment/translate.py

index 348a3d4ecf190088e7f16b3e0c2cc54c2465cc38..4cb846e3b7e44e1ac3a7575277aba058b41eb645 100644 (file)
@@ -376,8 +376,8 @@ class TestCephadm(object):
 
             _run_cephadm.assert_any_call(
                 'test', 'osd', 'ceph-volume',
-                ['--config-json', '-', '--', 'lvm', 'prepare',
-                    '--bluestore', '--data', '/dev/sdb', '--no-systemd'],
+                ['--config-json', '-', '--', 'lvm', 'batch',
+                    '--no-auto', '/dev/sdb', '--yes', '--no-systemd'],
                 env_vars=['CEPH_VOLUME_OSDSPEC_AFFINITY=foo'], error_ok=True, stdin='{"config": "", "keyring": ""}')
             _run_cephadm.assert_called_with(
                 'test', 'osd', 'ceph-volume', ['--', 'lvm', 'list', '--format', 'json'])
@@ -418,12 +418,12 @@ class TestCephadm(object):
         "devices, preview, exp_command",
         [
             # no preview and only one disk, prepare is used due the hack that is in place.
-            (['/dev/sda'], False, "lvm prepare --bluestore --data /dev/sda --no-systemd"),
+            (['/dev/sda'], False, "lvm batch --no-auto /dev/sda --yes --no-systemd"),
             # no preview and multiple disks, uses batch
             (['/dev/sda', '/dev/sdb'], False,
              "CEPH_VOLUME_OSDSPEC_AFFINITY=test.spec lvm batch --no-auto /dev/sda /dev/sdb --yes --no-systemd"),
             # preview and only one disk needs to use batch again to generate the preview
-            (['/dev/sda'], True, "lvm batch --no-auto /dev/sda --report --format json"),
+            (['/dev/sda'], True, "lvm batch --no-auto /dev/sda --yes --no-systemd --report --format json"),
             # preview and multiple disks work the same
             (['/dev/sda', '/dev/sdb'], True,
              "CEPH_VOLUME_OSDSPEC_AFFINITY=test.spec lvm batch --no-auto /dev/sda /dev/sdb --yes --no-systemd --report --format json"),
index c2f030d2cb26fa00885d5126dd207d273b835f3d..e5d59816626477877c132bbfce7ffb4a605bf4b2 100644 (file)
@@ -50,24 +50,6 @@ class to_ceph_volume(object):
 
             cmd += " --filestore"
 
-        # HORRIBLE HACK
-        if self.spec.objectstore == 'bluestore' and \
-           not self.spec.encrypted and \
-           not self.spec.osds_per_device and \
-           len(data_devices) == 1 and \
-           not db_devices and \
-           not wal_devices:
-            cmd = "lvm prepare --bluestore --data %s --no-systemd" % (' '.join(data_devices))
-            if self.osd_id_claims:
-                cmd += " --osd-id {}".format(str(self.osd_id_claims[0]))
-            if self.preview:
-                # Like every horrible hack, this has sideffects on other features.
-                # In this case, 'lvm prepare' has neither a '--report' nor a '--format json' option
-                # which essentially doesn't allow for a proper previews here.
-                # Fall back to lvm batch in order to get a preview.
-                return f"lvm batch --no-auto {' '.join(data_devices)} --report --format json"
-            return cmd
-
         if self.spec.objectstore == 'bluestore':
 
             cmd = "lvm batch --no-auto {}".format(" ".join(data_devices))