]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
osd: support creating ec profiles
authorGuillaume Abrioux <gabrioux@redhat.com>
Fri, 11 Dec 2020 14:19:56 +0000 (15:19 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 3 Feb 2021 07:32:39 +0000 (08:32 +0100)
this adds ec profiles creation support in ceph-ansible

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
group_vars/all.yml.sample
group_vars/rhcs.yml.sample
roles/ceph-defaults/defaults/main.yml
roles/ceph-osd/tasks/main.yml
tests/functional/lvm-osds/container/group_vars/all
tests/functional/lvm-osds/group_vars/all

index ff385cf6a32e8bcccb19f2d82057cb33f64a6a43..18e56274689a3b227c363a6a7d041e3aaef9567b 100644 (file)
@@ -365,6 +365,12 @@ dummy:
 # type.
 #filestore_xattr_use_omap: null
 
+# define any ec profiles here if needed
+# example:
+# ec_profiles:
+#   - {'name': 'my_ec_profile1', 'k': 2, 'm': 4, 'stripe_unit': 8192}
+#   - {'name': 'my_ec_profile2', 'k': 4, 'm': 8, 'crush_root': 'HDD', 'crush_device_class': 'ssd'}
+
 ## MDS options
 #
 #mds_max_mds: 1
index 07b77e87f4e9edf8439a1523290b7b2d90dfdb6e..61208f844bb274373f264aa45c8379751e659501 100644 (file)
@@ -365,6 +365,12 @@ ceph_iscsi_config_dev: false
 # type.
 #filestore_xattr_use_omap: null
 
+# define any ec profiles here if needed
+# example:
+# ec_profiles:
+#   - {'name': 'my_ec_profile1', 'k': 2, 'm': 4, 'stripe_unit': 8192}
+#   - {'name': 'my_ec_profile2', 'k': 4, 'm': 8, 'crush_root': 'HDD', 'crush_device_class': 'ssd'}
+
 ## MDS options
 #
 #mds_max_mds: 1
index 6e79141e913b1147e0bac5d491b7b7fdd5ecfeb8..1d2b3f913b8ff2039136a5f91fa2313b5dac865b 100644 (file)
@@ -357,6 +357,12 @@ osd_auto_discovery_exclude: "dm-*|loop*|md*|rbd*"
 # type.
 filestore_xattr_use_omap: null
 
+# define any ec profiles here if needed
+# example:
+# ec_profiles:
+#   - {'name': 'my_ec_profile1', 'k': 2, 'm': 4, 'stripe_unit': 8192}
+#   - {'name': 'my_ec_profile2', 'k': 4, 'm': 8, 'crush_root': 'HDD', 'crush_device_class': 'ssd'}
+
 ## MDS options
 #
 mds_max_mds: 1
index 575318b02dd83065cd72ffca827755894c170b14..67bd449d47a940d551c5bea9836ab2000ee002a8 100644 (file)
   when: hostvars[groups[mon_group_name][0]]['crush_rule_config'] | default(crush_rule_config) | bool
   tags: wait_all_osds_up
 
+- name: create erasure coded profile
+  ceph_ec_profile:
+    cluster: "{{ cluster }}"
+    name: "{{ item.name }}"
+    state: present
+    stripe_unit: "{{ item.stripe_unit | default(omit) }}"
+    k: "{{ item.k }}"
+    m: "{{ item.m }}"
+    crush_root: "{{ item.crush_root | default(omit) }}"
+    crush_device_class: "{{ item.crush_device_class | default(omit) }}"
+  with_items: "{{ ec_profiles }}"
+  environment:
+    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
+    CEPH_CONTAINER_BINARY: "{{ container_binary }}"
+  when:
+    - ec_profiles is defined
+    - ec_profiles | length > 0
+    - inventory_hostname == ansible_play_hosts_all | last
+
 # Create the pools listed in openstack_pools
 - name: include openstack_config.yml
   include_tasks: openstack_config.yml
index 7d7400f2fca1e9966efe93e36a15ce37b2b054c2..16c41d88afbd166c542dd3bc3cd57a93da5c6e9e 100644 (file)
@@ -39,4 +39,7 @@ openstack_pools:
   - "{{ openstack_cinder_pool }}"
 ceph_docker_registry: quay.ceph.io
 ceph_docker_image: ceph-ci/daemon
-ceph_docker_image_tag: latest-master
\ No newline at end of file
+ceph_docker_image_tag: latest-master
+ec_profiles:
+  - {'name': 'my_ec_profile1', 'k': 2, 'm': 4, 'stripe_unit': 8192}
+  - {'name': 'my_ec_profile2', 'k': 4, 'm': 8, 'crush_root': 'HDD', 'crush_device_class': 'ssd'}
\ No newline at end of file
index 0f0883bcf4e7ad42fdc439098b97ef9cadc2449a..e206cef54daea12a7921b63b83a7e1430eced9f4 100644 (file)
@@ -31,4 +31,7 @@ openstack_cinder_pool:
   application: rbd
 openstack_pools:
   - "{{ openstack_glance_pool }}"
-  - "{{ openstack_cinder_pool }}"
\ No newline at end of file
+  - "{{ openstack_cinder_pool }}"
+ec_profiles:
+  - {'name': 'my_ec_profile1', 'k': 2, 'm': 4, 'stripe_unit': 8192}
+  - {'name': 'my_ec_profile2', 'k': 4, 'm': 8, 'crush_root': 'HDD', 'crush_device_class': 'ssd'}
\ No newline at end of file