Merge "Fix for incorrect if in ceph/mon.sls for nautilus"
diff --git a/ceph/osd/setup/lvm.sls b/ceph/osd/setup/lvm.sls
index 7634179..eb6e72e 100644
--- a/ceph/osd/setup/lvm.sls
+++ b/ceph/osd/setup/lvm.sls
@@ -20,6 +20,14 @@
     - name: "ln -s {{"/etc/ceph/" + common.get('cluster_name', 'ceph') + ".client.bootstrap-osd.keyring"}} /var/lib/ceph/bootstrap-osd/ceph.keyring"
     - unless: "ls /var/lib/ceph/bootstrap-osd/ceph.keyring"
 
+{%- set legacy_disks = [] -%}
+
+{%- for disk_id, ceph_disk in salt['pillar.get']('ceph:osd:legacy_disks', {}).iteritems() %}
+
+{%- do legacy_disks.append(ceph_disk.get('dev')) %}
+
+{%- endfor -%}
+
 {%- for backend_name, backend in osd.backend.iteritems() %}
 
 {%- for disk in backend.disks %}
@@ -28,11 +36,13 @@
 
 {% set dev = disk.dev %}
 
-{% set db_partition = disk.get('db_partition', 1) %}
-{% set wal_partition = disk.get('wal_partition', 1) %}
+{% set db_partition = disk.get('db_partition') %}
+{% set wal_partition = disk.get('wal_partition') %}
 
 {%- endif %}
 
+{%- if dev not in legacy_disks -%}
+
 {%- set cmd = [] %}
 {%- do cmd.append('--cluster-fsid ' + common.fsid) %}
 {%- if disk.get('dmcrypt', False) %}
@@ -59,9 +69,7 @@
   - onlyif: /bin/false
   {%- endif %}
 
-{% set db_partition = db_partition + 1 %}
-{% set wal_partition = wal_partition + 1 %}
-
+{%- endif %}
 
 {%- endfor %}
 
diff --git a/ceph/osd/setup/partitioning.sls b/ceph/osd/setup/partitioning.sls
deleted file mode 100644
index 16ced44..0000000
--- a/ceph/osd/setup/partitioning.sls
+++ /dev/null
@@ -1,80 +0,0 @@
-{%- from "ceph/map.jinja" import osd, common with context %}
-
-{%- set devs = [] %}
-{%- set dbs = [] %}
-{%- set wals = [] %}
-{%- for backend_name, backend in osd.backend.iteritems() %}
-{%- for disk in backend.disks %}
-{%- set dev = disk.dev %}
-
-{%- if disk.block_db is defined %}
-{%- set db = disk.block_db %}
-{%- do dbs.append(db) %}
-{%- endif %}
-{%- if disk.block_wal is defined %}
-{%- set wal = disk.block_wal %}
-{%- do wals.append(wal) %}
-{%- endif %}
-{%- do devs.append(dev) %}
-{%- endfor %}
-{%- endfor %}
-{%- set end_size = {} %}
-{%- set counter = {} %}
-
-{%- if dbs != [] %}
-{%- for db in dbs | unique %}
-{%- do end_size.update({db: 1048576}) %}
-{%- do counter.update({db: 1}) %}
-create_disk_label_{{ db }}:
-  module.run:
-  - name: partition.mklabel
-  - device: {{ db }}
-  - label_type: gpt
-  - unless: "fdisk -l {{ db }} | grep -i 'Disklabel type: gpt'"
-{%- endfor %}
-{%- for db in dbs %}
-create_partition_{{ db }}_{{ counter[db] }}:
-  module.run:
-  - name: partition.mkpart
-  - device: {{ db }}
-  - part_type: primary
-  - start: {{ end_size[db] }}B
-  - end: {{ end_size[db] + osd.bluestore_block_db_size }}B
-  - size: {{ osd.bluestore_block_db_size }}B
-  - unless: "blkid {{ db }}{{ counter[db] }} {{ db }}p{{ counter[db] }}"
-  - require:
-    - module: create_disk_label_{{ db }}
-
-{%- do counter.update({db: counter[db] + 1}) %}
-{%- do end_size.update({db: end_size[db] + osd.bluestore_block_db_size + 1048576}) %}
-{%- endfor %}
-{%- endif %}
-
-{%- if wals != [] %}
-{%- for wal in wals | unique %}
-{%- do end_size.update({wal: 1048576}) %}
-{%- do counter.update({wal: 1}) %}
-create_disk_label_{{ wal }}:
-  module.run:
-  - name: partition.mklabel
-  - device: {{ wal }}
-  - label_type: gpt
-  - unless: "fdisk -l {{ wal }} | grep -i 'Disklabel type: gpt'"
-{%- endfor %}
-{%- for wal in wals %}
-create_partition_{{ wal }}_{{ counter[wal] }}:
-  module.run:
-  - name: partition.mkpart
-  - device: {{ wal }}
-  - part_type: primary
-  - start: {{ end_size[wal] }}B
-  - end: {{ end_size[wal] + osd.bluestore_block_db_size }}B
-  - size: {{ osd.bluestore_block_wal_size }}B
-  - unless: "blkid {{ wal }}{{ counter[wal] }} {{ wal }}p{{ counter[wal] }}"
-  - require:
-    - module: create_disk_label_{{ wal }}
-
-{%- do counter.update({wal: counter[wal] + 1}) %}
-{%- do end_size.update({wal: end_size[wal] + osd.bluestore_block_wal_size + 1048576}) %}
-{%- endfor %}
-{% endif %}