From: Theofilos Mouratidis Date: Wed, 18 Apr 2018 08:02:37 +0000 (+0200) Subject: ceph-volume: allow parallel creates X-Git-Tag: v13.1.0~199^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=201817f27ecfe195216284d9e4c344038cb654b6;p=ceph-ci.git ceph-volume: allow parallel creates 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 --- diff --git a/src/ceph-volume/ceph_volume/devices/lvm/prepare.py b/src/ceph-volume/ceph_volume/devices/lvm/prepare.py index a46abcf53d3..051ccdfbc3c 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/prepare.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/prepare.py @@ -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(