From 1c760904b0bd1b6b0f49d6ac19d87d79f185c18f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Tue, 16 Oct 2018 15:40:35 +0200 Subject: [PATCH] site: collocated mon and mgr by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will speed up the deployment and also deploy mon and mgr collocated just as recommended. This won't prevent you of adding more and dedicaded machines for mgr if needed. Signed-off-by: Sébastien Han --- infrastructure-playbooks/rolling_update.yml | 32 +++++++++++++++++++ roles/ceph-mon/tasks/ceph_keys.yml | 5 +-- roles/ceph-mon/tasks/docker/main.yml | 5 +-- site-container.yml.sample | 4 +++ site.yml.sample | 3 ++ .../centos/7/add-osds-container/hosts | 3 -- .../centos/7/add-osds-container/hosts-2 | 3 -- tests/functional/centos/7/add-osds/hosts | 3 -- tests/functional/centos/7/add-osds/hosts-2 | 3 -- .../centos/7/bs-lvm-osds-container/hosts | 3 -- tests/functional/centos/7/bs-lvm-osds/hosts | 3 -- tests/functional/centos/7/cluster/hosts | 3 -- .../centos/7/cluster/vagrant_variables.yml | 2 +- .../centos/7/docker-collocation/hosts | 4 --- tests/functional/centos/7/docker/hosts | 3 -- .../centos/7/docker/vagrant_variables.yml | 2 +- .../centos/7/lvm-batch-container/hosts | 3 -- tests/functional/centos/7/lvm-batch/hosts | 3 -- .../centos/7/lvm-osds-container/hosts | 3 -- tests/functional/centos/7/lvm-osds/hosts | 3 -- .../7/rgw-multisite-container/secondary/hosts | 3 -- tests/functional/centos/7/rgw-multisite/hosts | 3 -- tests/functional/centos/7/shrink_osd/hosts | 3 -- .../centos/7/shrink_osd_container/hosts | 3 -- .../fedora/29/container-podman/hosts | 3 -- 25 files changed, 47 insertions(+), 61 deletions(-) diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index 526d2cadc..eb0753bed 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -113,6 +113,15 @@ when: - not containerized_deployment + - name: stop ceph mgr + systemd: + name: ceph-mgr@{{ ansible_hostname }} + state: stopped + enabled: yes + ignore_errors: True # if no mgr collocated with mons + when: + - not containerized_deployment + - import_role: name: ceph-defaults private: false @@ -133,6 +142,10 @@ - import_role: name: ceph-mon private: false + - import_role: + name: ceph-mgr + private: false + when: groups.get(mgr_group_name, []) | length == 0 - name: start ceph mon systemd: @@ -142,6 +155,15 @@ when: - not containerized_deployment + - name: start ceph mgr + systemd: + name: ceph-mgr@{{ ansible_hostname }} + state: started + enabled: yes + ignore_errors: True # if no mgr collocated with mons + when: + - not containerized_deployment + - name: restart containerized ceph mon systemd: name: ceph-mon@{{ monitor_name }} @@ -151,6 +173,16 @@ when: - containerized_deployment + - name: restart containerized ceph mgr + systemd: + name: ceph-mgr@{{ monitor_name }} + state: restarted + enabled: yes + daemon_reload: yes + ignore_errors: True # if no mgr collocated with mons + when: + - containerized_deployment + - name: set mon_host_count set_fact: mon_host_count={{ groups[mon_group_name] | length }} diff --git a/roles/ceph-mon/tasks/ceph_keys.yml b/roles/ceph-mon/tasks/ceph_keys.yml index 24c5548c0..aa6445252 100644 --- a/roles/ceph-mon/tasks/ceph_keys.yml +++ b/roles/ceph-mon/tasks/ceph_keys.yml @@ -60,9 +60,10 @@ secret: "{{ (mgr_secret != 'mgr_secret') | ternary(mgr_secret, omit) }}" when: - cephx - - groups.get(mgr_group_name, []) | length > 0 - inventory_hostname == groups[mon_group_name]|last - with_items: "{{ groups.get(mgr_group_name, []) }}" + with_items: + - "{{ groups.get(mgr_group_name, []) }}" # this honors the condition where mgrs run on separate machines + - "{{ groups.get(mon_group_name, []) }}" # this honors the new rule where mgrs are always collocated with mons # once this gets backported github.com/ceph/ceph/pull/20983 # we will be able to remove these 2 tasks below diff --git a/roles/ceph-mon/tasks/docker/main.yml b/roles/ceph-mon/tasks/docker/main.yml index 28092966f..fc973645a 100644 --- a/roles/ceph-mon/tasks/docker/main.yml +++ b/roles/ceph-mon/tasks/docker/main.yml @@ -34,8 +34,9 @@ when: - cephx - containerized_deployment - - groups.get(mgr_group_name, []) | length > 0 - with_items: "{{ groups.get(mgr_group_name, []) }}" + with_items: + - "{{ groups.get(mgr_group_name, []) }}" # this honors the condition where mgrs run on separate machines + - "{{ groups.get(mon_group_name, []) }}" # this honors the new rule where mgrs are always collocated with mons - name: fetch ceph mgr key(s) fetch: diff --git a/site-container.yml.sample b/site-container.yml.sample index e50db511c..898530e84 100644 --- a/site-container.yml.sample +++ b/site-container.yml.sample @@ -125,6 +125,10 @@ - import_role: name: ceph-mon private: false + - import_role: + name: ceph-mgr + private: false + serial: 1 # MUST be '1' WHEN DEPLOYING MONITORS ON DOCKER CONTAINERS - hosts: mons diff --git a/site.yml.sample b/site.yml.sample index 09f9daf44..0ea698ded 100644 --- a/site.yml.sample +++ b/site.yml.sample @@ -113,6 +113,9 @@ - import_role: name: ceph-mon private: false + - import_role: + name: ceph-mgr + private: false # post-tasks for preceding imports - - name: set ceph monitor install 'Complete' diff --git a/tests/functional/centos/7/add-osds-container/hosts b/tests/functional/centos/7/add-osds-container/hosts index d6c89012a..f6a265ab3 100644 --- a/tests/functional/centos/7/add-osds-container/hosts +++ b/tests/functional/centos/7/add-osds-container/hosts @@ -1,8 +1,5 @@ [mons] mon0 -[mgrs] -mon0 - [osds] osd0 diff --git a/tests/functional/centos/7/add-osds-container/hosts-2 b/tests/functional/centos/7/add-osds-container/hosts-2 index 288617eda..073437d68 100644 --- a/tests/functional/centos/7/add-osds-container/hosts-2 +++ b/tests/functional/centos/7/add-osds-container/hosts-2 @@ -1,9 +1,6 @@ [mons] mon0 -[mgrs] -mon0 - [osds] osd0 osd1 diff --git a/tests/functional/centos/7/add-osds/hosts b/tests/functional/centos/7/add-osds/hosts index d6c89012a..f6a265ab3 100644 --- a/tests/functional/centos/7/add-osds/hosts +++ b/tests/functional/centos/7/add-osds/hosts @@ -1,8 +1,5 @@ [mons] mon0 -[mgrs] -mon0 - [osds] osd0 diff --git a/tests/functional/centos/7/add-osds/hosts-2 b/tests/functional/centos/7/add-osds/hosts-2 index 288617eda..073437d68 100644 --- a/tests/functional/centos/7/add-osds/hosts-2 +++ b/tests/functional/centos/7/add-osds/hosts-2 @@ -1,9 +1,6 @@ [mons] mon0 -[mgrs] -mon0 - [osds] osd0 osd1 diff --git a/tests/functional/centos/7/bs-lvm-osds-container/hosts b/tests/functional/centos/7/bs-lvm-osds-container/hosts index d6c89012a..f6a265ab3 100644 --- a/tests/functional/centos/7/bs-lvm-osds-container/hosts +++ b/tests/functional/centos/7/bs-lvm-osds-container/hosts @@ -1,8 +1,5 @@ [mons] mon0 -[mgrs] -mon0 - [osds] osd0 diff --git a/tests/functional/centos/7/bs-lvm-osds/hosts b/tests/functional/centos/7/bs-lvm-osds/hosts index d6c89012a..f6a265ab3 100644 --- a/tests/functional/centos/7/bs-lvm-osds/hosts +++ b/tests/functional/centos/7/bs-lvm-osds/hosts @@ -1,8 +1,5 @@ [mons] mon0 -[mgrs] -mon0 - [osds] osd0 diff --git a/tests/functional/centos/7/cluster/hosts b/tests/functional/centos/7/cluster/hosts index f5c517794..e22cf7420 100644 --- a/tests/functional/centos/7/cluster/hosts +++ b/tests/functional/centos/7/cluster/hosts @@ -3,9 +3,6 @@ ceph-mon0 monitor_address=192.168.1.10 ceph-mon1 monitor_interface=eth1 ceph-mon2 monitor_address=192.168.1.12 -[mgrs] -ceph-mgr0 - [osds] ceph-osd0 osd_crush_location="{ 'root': 'HDD', 'rack': 'mon-rackkkk', 'pod': 'monpod', 'host': 'ceph-osd0' }" ceph-osd1 osd_crush_location="{ 'root': 'default', 'host': 'ceph-osd1' }" diff --git a/tests/functional/centos/7/cluster/vagrant_variables.yml b/tests/functional/centos/7/cluster/vagrant_variables.yml index c7f468d1d..d73d4cfb8 100644 --- a/tests/functional/centos/7/cluster/vagrant_variables.yml +++ b/tests/functional/centos/7/cluster/vagrant_variables.yml @@ -12,7 +12,7 @@ nfs_vms: 0 rbd_mirror_vms: 1 client_vms: 2 iscsi_gw_vms: 1 -mgr_vms: 1 +mgr_vms: 0 # INSTALL SOURCE OF CEPH # valid values are 'stable' and 'dev' diff --git a/tests/functional/centos/7/docker-collocation/hosts b/tests/functional/centos/7/docker-collocation/hosts index 2ecd00253..7a958f129 100644 --- a/tests/functional/centos/7/docker-collocation/hosts +++ b/tests/functional/centos/7/docker-collocation/hosts @@ -14,10 +14,6 @@ rgw0 rgw0 mds0 -[mgrs] -mon0 -osd0 - [rbdmirrors] rgw0 mds0 diff --git a/tests/functional/centos/7/docker/hosts b/tests/functional/centos/7/docker/hosts index 3421926b5..2623af53a 100644 --- a/tests/functional/centos/7/docker/hosts +++ b/tests/functional/centos/7/docker/hosts @@ -3,9 +3,6 @@ mon0 mon1 mon2 -[mgrs] -mgr0 - [osds] osd0 osd_crush_location="{ 'root': 'HDD', 'rack': 'mon-rackkkk', 'pod': 'monpod', 'host': 'osd0' }" osd1 osd_crush_location="{ 'root': 'default', 'host': 'osd1' }" diff --git a/tests/functional/centos/7/docker/vagrant_variables.yml b/tests/functional/centos/7/docker/vagrant_variables.yml index 846789245..07dab2904 100644 --- a/tests/functional/centos/7/docker/vagrant_variables.yml +++ b/tests/functional/centos/7/docker/vagrant_variables.yml @@ -12,7 +12,7 @@ nfs_vms: 1 rbd_mirror_vms: 1 client_vms: 2 iscsi_gw_vms: 1 -mgr_vms: 1 +mgr_vms: 0 # SUBNETS TO USE FOR THE VMS public_subnet: 192.168.17 diff --git a/tests/functional/centos/7/lvm-batch-container/hosts b/tests/functional/centos/7/lvm-batch-container/hosts index d6c89012a..f6a265ab3 100644 --- a/tests/functional/centos/7/lvm-batch-container/hosts +++ b/tests/functional/centos/7/lvm-batch-container/hosts @@ -1,8 +1,5 @@ [mons] mon0 -[mgrs] -mon0 - [osds] osd0 diff --git a/tests/functional/centos/7/lvm-batch/hosts b/tests/functional/centos/7/lvm-batch/hosts index d6c89012a..f6a265ab3 100644 --- a/tests/functional/centos/7/lvm-batch/hosts +++ b/tests/functional/centos/7/lvm-batch/hosts @@ -1,8 +1,5 @@ [mons] mon0 -[mgrs] -mon0 - [osds] osd0 diff --git a/tests/functional/centos/7/lvm-osds-container/hosts b/tests/functional/centos/7/lvm-osds-container/hosts index d6c89012a..f6a265ab3 100644 --- a/tests/functional/centos/7/lvm-osds-container/hosts +++ b/tests/functional/centos/7/lvm-osds-container/hosts @@ -1,8 +1,5 @@ [mons] mon0 -[mgrs] -mon0 - [osds] osd0 diff --git a/tests/functional/centos/7/lvm-osds/hosts b/tests/functional/centos/7/lvm-osds/hosts index d6c89012a..f6a265ab3 100644 --- a/tests/functional/centos/7/lvm-osds/hosts +++ b/tests/functional/centos/7/lvm-osds/hosts @@ -1,8 +1,5 @@ [mons] mon0 -[mgrs] -mon0 - [osds] osd0 diff --git a/tests/functional/centos/7/rgw-multisite-container/secondary/hosts b/tests/functional/centos/7/rgw-multisite-container/secondary/hosts index c5e55ff4c..e2e0c30e4 100644 --- a/tests/functional/centos/7/rgw-multisite-container/secondary/hosts +++ b/tests/functional/centos/7/rgw-multisite-container/secondary/hosts @@ -1,9 +1,6 @@ [mons] mon0 -[mgrs] -mon0 - [osds] osd0 diff --git a/tests/functional/centos/7/rgw-multisite/hosts b/tests/functional/centos/7/rgw-multisite/hosts index eb9011efc..245062489 100644 --- a/tests/functional/centos/7/rgw-multisite/hosts +++ b/tests/functional/centos/7/rgw-multisite/hosts @@ -1,9 +1,6 @@ [mons] mon0 -[mgrs] -mon0 - [osds] osd0 diff --git a/tests/functional/centos/7/shrink_osd/hosts b/tests/functional/centos/7/shrink_osd/hosts index d3b2c1f81..13fd8d478 100644 --- a/tests/functional/centos/7/shrink_osd/hosts +++ b/tests/functional/centos/7/shrink_osd/hosts @@ -1,9 +1,6 @@ [mons] ceph-mon0 monitor_address=192.168.71.10 -[mgrs] -ceph-mon0 - [osds] ceph-osd0 ceph-osd1 diff --git a/tests/functional/centos/7/shrink_osd_container/hosts b/tests/functional/centos/7/shrink_osd_container/hosts index 6c1829b31..458c66a84 100644 --- a/tests/functional/centos/7/shrink_osd_container/hosts +++ b/tests/functional/centos/7/shrink_osd_container/hosts @@ -1,9 +1,6 @@ [mons] mon0 -[mgrs] -mon0 - [osds] osd0 osd1 diff --git a/tests/functional/fedora/29/container-podman/hosts b/tests/functional/fedora/29/container-podman/hosts index ed6bf602c..d45a218c3 100644 --- a/tests/functional/fedora/29/container-podman/hosts +++ b/tests/functional/fedora/29/container-podman/hosts @@ -3,9 +3,6 @@ mon0 mon1 mon2 -[mgrs] -mgr0 - [osds] osd0 osd_crush_location="{ 'root': 'HDD', 'rack': 'mon-rackkkk', 'pod': 'monpod', 'host': 'osd0' }" osd1 osd_crush_location="{ 'root': 'default', 'host': 'osd1' }"