]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: allow parallel creates 21489/head
authorTheofilos Mouratidis <t.mour@cern.ch>
Wed, 18 Apr 2018 08:02:37 +0000 (10:02 +0200)
committerTheofilos Mouratidis <t.mour@cern.ch>
Wed, 18 Apr 2018 08:02:37 +0000 (10:02 +0200)
Currently the create code decides the vg_name "ceph-$cluster_fsid" as
the primary vg_name and creates a new name if this already exists.

If this code is run N times in parallel, the script will try to
create N times the vg with the name "ceph-$cluster_fsid" and it
will fail to create the N osds successfully.

Creating vgs with names like "ceph-$uuid4" lets our scripts to run
without any problems.

Signed-off-by: Theofilos Mouratidis <t.mour@cern.ch>
src/ceph-volume/ceph_volume/devices/lvm/prepare.py

index a46abcf53d3e3f4f7b19b29498cd79610f491f80..051ccdfbc3ce5fafba19f51376aaa3c089bbc34c 100644 (file)
@@ -189,11 +189,7 @@ class Prepare(object):
         """
         if disk.is_partition(arg) or disk.is_device(arg):
             # we must create a vg, and then a single lv
-            vg_name = "ceph-%s" % cluster_fsid
-            if api.get_vg(vg_name=vg_name):
-                # means we already have a group for this, make a different one
-                # XXX this could end up being annoying for an operator, maybe?
-                vg_name = "ceph-%s" % str(uuid.uuid4())
+            vg_name = "ceph-%s" % str(uuid.uuid4())
             api.create_vg(vg_name, arg)
             lv_name = "osd-%s-%s" % (device_type, osd_fsid)
             return api.create_lv(