Add ability to set data partition prefix

Some devices like loopXY can look like loopXYpZ
when they are partitioned. Currently ceph formula
fails to activate such disks because it searches
loopXYZ.

Change-Id: I25ba9f5348e4387146596847eaa2533ed8ebd926
diff --git a/README.rst b/README.rst
index dcd9462..e4488fa 100644
--- a/README.rst
+++ b/README.rst
@@ -357,6 +357,21 @@
               enabled: false
 
 
+In case some custom block devices should be used (like loop devices for testing purpose),
+it is needed to indicate proper partition prefix.
+
+.. code-block:: yaml
+
+    ceph:
+      osd:
+        backend:
+          bluestore:
+            disks:
+            - dev: /dev/loop20
+              block_db: /dev/loop21
+              data_partition_prefix: 'p'
+
+
 Ceph client roles - ...Deprecated - use ceph:common instead
 --------------------------------------------------------
 
diff --git a/ceph/osd/setup.sls b/ceph/osd/setup.sls
index b927881..852bfe5 100644
--- a/ceph/osd/setup.sls
+++ b/ceph/osd/setup.sls
@@ -24,7 +24,7 @@
 {% set dev = disk.dev %}
 
 # for uniqueness
-{% set dev_device = dev + disk.get('data_partition', 1)|string %}
+{% set dev_device = dev + disk.get('data_partition_prefix', '') + disk.get('data_partition', 1)|string %}
 
 #{{ dev }}{{ disk.get('data_partition', 1) }}