ceph model

Change-Id: I5cf8aaa01ed0a9c0f43b0b42cf7e109b4ad831d6
diff --git a/classes/cluster/ceph-ha/ceph/cfs.yml b/classes/cluster/ceph-ha/ceph/cephfs.yml
similarity index 69%
rename from classes/cluster/ceph-ha/ceph/cfs.yml
rename to classes/cluster/ceph-ha/ceph/cephfs.yml
index 634177a..0d474b0 100644
--- a/classes/cluster/ceph-ha/ceph/cfs.yml
+++ b/classes/cluster/ceph-ha/ceph/cephfs.yml
@@ -1,4 +1,3 @@
 classes:
 - system.linux.system.repo.ubuntu
-- system.linux.network.hosts
 - cluster.ceph-ha.infra
diff --git a/classes/cluster/ceph-ha/ceph/init.yml b/classes/cluster/ceph-ha/ceph/init.yml
index a2600a9..48dfb8c 100644
--- a/classes/cluster/ceph-ha/ceph/init.yml
+++ b/classes/cluster/ceph-ha/ceph/init.yml
@@ -1,41 +1,25 @@
 parameters:
   _param:
-    linux_repo_ceph_component: jewel
-    ceph_version: jewel
-    ceph_mon_keepalived_password: tv0jeM4m4neum1s0p3nSt4cK3m
+    linux_repo_ceph_component: ${_param:ceph_version}
+    ceph_version: luminous
 
-    ceph_mon_hostname: cmn
     ceph_mon_node01_hostname: cmn01
     ceph_mon_node02_hostname: cmn02
     ceph_mon_node03_hostname: cmn03
-    ceph_mon_node01_address: 172.16.10.91
-    ceph_mon_node02_address: 172.16.10.92
-    ceph_mon_node03_address: 172.16.10.93
 
     ceph_osd_node01_hostname: osd01
     ceph_osd_node02_hostname: osd02
-    ceph_osd_node03_hostname: osd03
     ceph_osd_node01_address: 172.16.10.94
     ceph_osd_node02_address: 172.16.10.95
-    ceph_osd_node03_address: 172.16.10.96
-
-    ceph_cfs_node01_hostname: cfs01
-    ceph_cfs_node01_address: 172.16.10.97
-
-    single_address: ''
+    ceph_mon_node01_address: 172.16.10.96
+    ceph_mon_node02_address: 172.16.10.97
+    ceph_mon_node03_address: 172.16.10.98
 
     ceph_cluster_fsid: a619c5fc-c4ed-4f22-9ed2-66cf2feca23d
-    ceph_mon_keyring: AQAnQIhZ6in5KxAAdf467upoRMWFcVg5pbh1yg==
-    ceph_admin_keyring: AQBHPYhZv5mYDBAAvisaSzCTQkC5gywGUp/voA==
 
   linux:
     network:
       host:
-      #   cmn:
-      #     address: ${_param:ceph_mon_address}
-      #     names:
-      #     - ${_param:ceph_mon_hostname}
-      #     - ${_param:ceph_mon_hostname}.${_param:cluster_domain}
         cmn01:
           address: ${_param:ceph_mon_node01_address}
           names:
@@ -61,14 +45,3 @@
           names:
           - ${_param:ceph_osd_node02_hostname}
           - ${_param:ceph_osd_node02_hostname}.${_param:cluster_domain}
-        osd03:
-          address: ${_param:ceph_osd_node03_address}
-          names:
-          - ${_param:ceph_osd_node03_hostname}
-          - ${_param:ceph_osd_node03_hostname}.${_param:cluster_domain}
-        cfs01:
-          address: ${_param:ceph_cfs_node01_address}
-          names:
-          - ${_param:ceph_cfs_node01_hostname}
-          - ${_param:ceph_cfs_node01_hostname}.${_param:cluster_domain}
-
diff --git a/classes/cluster/ceph-ha/ceph/mon.yml b/classes/cluster/ceph-ha/ceph/mon.yml
index 96fa0b4..808b258 100644
--- a/classes/cluster/ceph-ha/ceph/mon.yml
+++ b/classes/cluster/ceph-ha/ceph/mon.yml
@@ -1,4 +1,4 @@
 classes:
 - system.ceph.mon.cluster
-- cluster.ceph-ha.ceph.common
-- system.linux.network.hosts
+- system.ceph.mgr.cluster
+- cluster.ceph-ha.ceph.common
\ No newline at end of file
diff --git a/classes/cluster/ceph-ha/ceph/mon_init.yml b/classes/cluster/ceph-ha/ceph/mon_init.yml
deleted file mode 100644
index e69de29..0000000
--- a/classes/cluster/ceph-ha/ceph/mon_init.yml
+++ /dev/null
diff --git a/classes/cluster/ceph-ha/ceph/osd.yml b/classes/cluster/ceph-ha/ceph/osd.yml
index 2d7cb2a..44a05a4 100644
--- a/classes/cluster/ceph-ha/ceph/osd.yml
+++ b/classes/cluster/ceph-ha/ceph/osd.yml
@@ -1,62 +1,22 @@
 classes:
 - service.ceph.osd.cluster
-- system.linux.network.hosts
 - cluster.ceph-ha.ceph.common
 parameters:
   ceph:
     osd:
       enabled: true
-      copy_admin_key: true
-      journal_type: raw
-      dmcrypt: disable
-      osd_scenario: raw_journal_devices
-      fs_type: xfs
-      disk:
-        '00':
-          rule: hdd
-          dev: /dev/vdb2
-          journal: /dev/vdb1
-          class: bestssd
-          weight: 1.5
-        '01':
-          rule: hdd
-          dev: /dev/vdc2
-          journal: /dev/vdc1
-          class: bestssd
-          weight: 1.5
-        '02':
-          rule: hdd
-          dev: /dev/vdd2
-          journal: /dev/vdd1
-          class: bestssd
-          weight: 1.5
-  linux:
-   storage:
-     disk:
-       disk01:
-         name: /dev/vdb
-         type: gpt
-         partitions:
-         - size: 4000
-           type: xfs
-         - size: 6000
-           type: xfs
-           mkfs: true
-       disk02:
-         name: /dev/vdc
-         type: gpt
-         partitions:
-         - size: 4000
-           type: xfs
-         - size: 6000
-           type: xfs
-           mkfs: true
-       disk03:
-         name: /dev/vdd
-         type: gpt
-         partitions:
-         - size: 4000
-           type: xfs
-         - size: 6000
-           type: xfs
-           mkfs: true
+      crush_parent: ${_param:ceph_crush_parent}
+#      crush_update: false
+#      copy_admin_key: true
+      bluestore_block_db_size: 10073741824
+      backend:
+        bluestore:
+          disks:
+            - dev: /dev/xvdb
+              block_db: /dev/xvdd
+#              class: hdd
+#              weight: 1.5
+            - dev: /dev/xvdc
+              block_db: /dev/xvdd
+#              class: hdd
+#              weight: 1.5
diff --git a/classes/cluster/ceph-ha/ceph/rgw.yml b/classes/cluster/ceph-ha/ceph/rgw.yml
index fba17bf..ac69fd8 100644
--- a/classes/cluster/ceph-ha/ceph/rgw.yml
+++ b/classes/cluster/ceph-ha/ceph/rgw.yml
@@ -1,22 +1,38 @@
-classes:
-- system.linux.system.repo.ceph
-- system.linux.system.repo.ubuntu
-- cluster.ceph-ha.ceph.common
-- cluster.ceph-ha.infra
-parameters:
-  _param:
-    keepalived_ceph_monitor_vip_address: ${_param:ceph_monitor_address}
-    keepalived_ceph_monitor_vip_password: ${_param:ceph_monitor_keepalived_password}
-    keepalived_ceph_monitor_vip_interface: ens3
-    cluster_vip_address: ${_param:ceph_monitor_address}
-    cluster_local_address: ${_param:single_address}
-    cluster_node01_hostname: cmn01
-    cluster_node01_address: ${_param:ceph_monitor_node01_address}
-    cluster_node02_hostname: cmn02
-    cluster_node02_address: ${_param:ceph_monitor_node02_address}
-    cluster_node03_hostname: cmn03
-    cluster_node03_address: ${_param:ceph_monitor_node03_address}
-    ceph_frondend_network: 10.1.0.0/24
-    ceph_backend_network: 10.16.0.0/24
-    nova_storage_keyring: novakeyring
-    cinder_storage_keyring: cinderkeyrinig
\ No newline at end of file
+# classes:
+# - system.ceph.rgw.cluster
+# - system.ceph.rgw.keystone
+# - cluster.ceph-ha.ceph
+# - cluster.ceph-ha.ceph.common
+# - cluster.ceph-ha.infra
+# parameters:
+#   _param:
+#     keepalived_vip_interface: ens3
+#     keepalived_vip_virtual_router_id: 41
+#     haproxy_radosgw_bind_port: 8080
+#     haproxy_radosgw_source_port: 8080
+#     ceph_radosgw_bind_port: 8080
+#     keepalived_vip_password: 9HpXQgHKxL1
+#     cluster_vip_address: 172.16.47.158
+#     cluster_node01_hostname: ${_param:ceph_rgw_node01_hostname}
+#     cluster_node01_address: ${_param:ceph_rgw_node01_address}
+#     cluster_node02_hostname: ${_param:ceph_rgw_node02_hostname}
+#     cluster_node02_address: ${_param:ceph_rgw_node02_address}
+#     cluster_node03_hostname: ${_param:ceph_rgw_node03_hostname}
+#     cluster_node03_address: ${_param:ceph_rgw_node03_address}
+#     ceph_radosgw_keystone_host: ${_param:openstack_control_address}
+#     ceph_radosgw_keystone_password: ${_param:keystone_admin_password}
+#   ceph:
+#     common:
+#       keyring:
+#         rgw.rgw01:
+#           caps:
+#             mon: "allow *"
+#             osd: "allow *"
+#         rgw.rgw02:
+#           caps:
+#             mon: "allow *"
+#             osd: "allow *"
+#         rgw.rgw03:
+#           caps:
+#             mon: "allow *"
+#             osd: "allow *"
diff --git a/classes/cluster/ceph-ha/ceph/setup.yml b/classes/cluster/ceph-ha/ceph/setup.yml
index e69de29..b6ba4ad 100644
--- a/classes/cluster/ceph-ha/ceph/setup.yml
+++ b/classes/cluster/ceph-ha/ceph/setup.yml
@@ -0,0 +1,131 @@
+classes:
+- system.ceph.mon.cluster_init
+parameters:
+  ceph:
+    setup:
+      pool:
+        images:
+          pg_num: 64
+          pgp_num: 64
+          type: replicated
+          application: rbd
+          crush_rule: sata
+        volumes:
+          pg_num: 64
+          pgp_num: 64
+          type: replicated
+          application: rbd
+          crush_rule: sata
+        vms:
+          pg_num: 64
+          pgp_num: 64
+          type: replicated
+          application: rbd
+          crush_rule: sata
+        .rgw.root:
+          pg_num: 64
+          pgp_num: 64
+          type: replicated
+          application: rgw
+          crush_rule: sata
+        default.rgw.control:
+          pg_num: 64
+          pgp_num: 64
+          type: replicated
+          application: rgw
+          crush_rule: sata
+        default.rgw.meta:
+          pg_num: 64
+          pgp_num: 64
+          type: replicated
+          application: rgw
+          crush_rule: sata
+        default.rgw.log:
+          pg_num: 64
+          pgp_num: 64
+          type: replicated
+          application: rgw
+          crush_rule: sata
+        default.rgw.buckets.index:
+          pg_num: 64
+          pgp_num: 64
+          type: replicated
+          application: rgw
+          crush_rule: sata
+        default.rgw.buckets.data:
+          pg_num: 64
+          pgp_num: 64
+          type: replicated
+          application: rgw 
+          crush_rule: sata
+      # crush:
+      #   enforce: true
+      #   tunables:
+      #     choose_total_tries: 50
+      #     choose_local_tries: 0 
+      #     choose_local_fallback_tries: 0
+      #     chooseleaf_descend_once: 1
+      #     chooseleaf_vary_r: 1
+      #     chooseleaf_stable: 1
+      #     straw_calc_version: 1
+      #     allowed_bucket_algs: 54
+      #   type:
+      #     - root
+      #     - region
+      #     - rack
+      #     - host
+      #     - osd # musi byt pro kraken
+      #   root:
+      #     - name: sata
+      #     - name: ssd
+      #   region:
+      #     - name: eu-1
+      #       parent: sata
+      #     - name: eu-2
+      #       parent: ssd
+      #     - name: us-1
+      #       parent: sata
+      #     - name: us-2
+      #       parent: ssd
+      #   rack:
+      #     - name: rack01
+      #       parent: eu-1
+      #     - name: rack02
+      #       parent: eu-1
+      #     - name: rack03
+      #       parent: eu-1
+      #     - name: rack04
+      #       parent: us-2
+      #     - name: rack05
+      #       parent: us-2
+      #     - name: rack06
+      #       parent: us-2
+      #   pool:
+      #     - name: vms
+      #       rule: sata
+      #       app: rbd
+      #     - name: images
+      #       rule: sata
+      #       app: rbd
+      #     - name: volumes
+      #       rule: sata
+      #       app: rbd
+      #   rule:
+      #     ssd:
+      #       ruleset: 0
+      #       type: replicated
+      #       min_size: 1
+      #       max_size: 10
+      #       steps:
+      #         - take ssd
+      #         - chooseleaf firstn 0 type host
+      #         - emit
+      #     sata:
+      #       ruleset: 1
+      #       type: replicated
+      #       min_size: 1
+      #       max_size: 10
+      #       steps:
+      #         - take sata
+      #         - chooseleaf firstn 0 type host
+      #         - emit