Skip to content

Commit cfbb1d9

Browse files
fmountEmilienM
andcommitted
Align Ceph deployment to OSP 17
This patch adds a new Ceph role which is responsible to execute a set of tasks and deploy the cluster in the standalone scenario. This works aligns dev-install to the new approach introduced in Wallaby/Zed, where the Ceph bootstrap is not part of the overcloud deploy anymore. In particular, as per [1], Ceph expects to see: 1. an already provisioned metal 2. an already provisioned storage_network 3. reserved VIPs (if needed) There are still actions happening during the overcloud deployment (pool creation, ganesha deployment) to finalize the cloud, but the initial bootstrap process has been moved to a set of overcloud ceph related commands, executed through the related tripleo.operator. Note that a similar approach has been recently introduced in oooq [2]. [1] https://docs.openstack.org/project-deploy-guide/tripleo-docs/latest/features/deployed_ceph.html#deployed-ceph-workflow [2] https://github.com/openstack/tripleo-quickstart-extras/blob/master/roles/standalone/tasks/ceph-install.yml Signed-off-by: Francesco Pantano <[email protected]> Co-Authored-By: Emilien Macchi <[email protected]>
1 parent ddb0807 commit cfbb1d9

File tree

6 files changed

+213
-30
lines changed

6 files changed

+213
-30
lines changed

playbooks/install_stack.yaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,11 @@
198198
src: "{{ net_config_template }}"
199199
dest: "{{ ansible_env.HOME }}/dev-install_net_config.yaml"
200200

201+
- name: Run os-net-config # noqa no-changed-when
202+
ansible.builtin.command: "os-net-config --exit-on-validation-errors -d -c {{ ansible_env.HOME }}/dev-install_net_config.yaml"
203+
become: true
204+
become_user: root
205+
201206
- name: Read dev-install_net_config.yaml
202207
ansible.builtin.slurp:
203208
src: "{{ ansible_env.HOME }}/dev-install_net_config.yaml"
@@ -375,14 +380,6 @@
375380
owner: stack
376381
mode: '644'
377382

378-
- name: Add ceph to enabled services
379-
ansible.builtin.set_fact:
380-
service_envs: "{{ service_envs | union(ceph_env) }}"
381-
vars:
382-
ceph_env:
383-
- "/usr/share/openstack-tripleo-heat-templates/environments/{{ ceph_env_base }}/{{ ceph_env_name }}.yaml"
384-
when: ceph_enabled
385-
386383
- name: Install tuned cpu partionioning profile
387384
ansible.builtin.yum:
388385
name:
@@ -474,6 +471,12 @@
474471
when:
475472
- (tripleo_repos_branch is defined and tripleo_repos_branch not in ['train', 'ussuri', 'victoria']) or (tripleo_repos_branch is not defined)
476473

474+
- name: Deploy Ceph
475+
ansible.builtin.include_role:
476+
name: ceph
477+
when:
478+
- ceph_enabled
479+
477480
- name: Run TripleO deploy
478481
ansible.builtin.import_role:
479482
name: tripleo.operator.tripleo_deploy
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
- name: Tasks for ceph-adm
2+
when: ceph_adm_enabled
3+
block:
4+
- name: Set facts for ceph-adm
5+
ansible.builtin.set_fact:
6+
stack: standalone
7+
mon_ip: "{{ local_ip }}"
8+
ceph_network: "{{ control_plane_cidr }}"
9+
network_data: "{{ ansible_env.HOME }}/network_data.yaml"
10+
deployed_network: "{{ ansible_env.HOME }}/deployed_network.yaml"
11+
osd_spec: "{{ ansible_env.HOME }}/osd_spec.yaml"
12+
initial_ceph_conf: "{{ ansible_env.HOME }}/initial_ceph.conf"
13+
ceph_spec: "{{ ansible_env.HOME }}/ceph_spec.yaml"
14+
containers_prep: "{{ ansible_env.HOME }}/containers-prepare-parameters.yaml"
15+
deployed_ceph: "{{ ansible_env.HOME }}/deployed_ceph.yaml"
16+
17+
- name: Configure Storage Network
18+
ansible.builtin.include_tasks: storage-network.yml
19+
vars:
20+
interface: br-ctlplane
21+
dummy_ip_cidr: "{{ mon_ip ~ '/' ~ control_plane_prefix | string }}"
22+
dummy_vip: "{{ control_plane_ip }}"
23+
start: "{{ control_plane_cidr | nthhost(4) }}"
24+
end: "{{ control_plane_cidr | nthhost(250) }}"
25+
26+
- name: Create OSD spec file
27+
ansible.builtin.copy:
28+
dest: "{{ osd_spec }}"
29+
content: |
30+
data_devices:
31+
paths:
32+
{% if ceph_devices is defined and ceph_devices | length > 0 %}
33+
{% for d in ceph_devices %}
34+
- {{ d }}
35+
{% endfor %}
36+
{% else %}
37+
- /dev/vg_ceph/data
38+
{% endif %}
39+
mode: '644'
40+
41+
- name: Create initial ceph.conf file
42+
ansible.builtin.copy:
43+
dest: "{{ initial_ceph_conf }}"
44+
content: |
45+
[global]
46+
osd_crush_chooseleaf_type = 0
47+
osd pool default size = 1
48+
[mon]
49+
mon_warn_on_pool_no_redundancy = false
50+
[mgr]
51+
mgr/cephadm/log_to_cluster_level = debug
52+
mode: '644'
53+
54+
- name: Create Ceph Spec file via tripleo-operator-ansible
55+
collections:
56+
- tripleo.operator
57+
ansible.builtin.include_role:
58+
name: tripleo_ceph_spec
59+
vars:
60+
tripleo_ceph_spec_standalone: true
61+
tripleo_ceph_spec_overwrite: true
62+
tripleo_ceph_spec_mon_ip: "{{ mon_ip }}"
63+
tripleo_ceph_spec_stack: "{{ stack }}"
64+
tripleo_ceph_spec_file: "{{ ceph_spec }}"
65+
tripleo_ceph_spec_osd_spec: "{{ osd_spec }}"
66+
tripleo_ceph_spec_debug: true
67+
tripleo_ceph_spec_generate_scripts: true
68+
69+
- name: Create ceph-admin user via tripleo-operator-ansible
70+
collections:
71+
- tripleo.operator
72+
ansible.builtin.include_role:
73+
name: tripleo_ceph_user
74+
vars:
75+
tripleo_ceph_user_spec: "{{ ceph_spec }}"
76+
tripleo_ceph_user_enable: true
77+
tripleo_ceph_user_stack: "{{ stack }}"
78+
tripleo_ceph_user_standalone: true
79+
tripleo_ceph_user_debug: true
80+
tripleo_ceph_user_generate_scripts: true
81+
82+
- name: Deploy Ceph via tripleo-operator-ansible
83+
collections:
84+
- tripleo.operator
85+
ansible.builtin.include_role:
86+
name: tripleo_ceph_deploy
87+
vars:
88+
tripleo_ceph_deploy_standalone: true
89+
tripleo_ceph_deploy_single_host_defaults: true
90+
tripleo_ceph_deploy_skip_user_create: true
91+
tripleo_ceph_deploy_skip_hosts_config: true
92+
tripleo_ceph_deploy_skip_container_registry_config: true
93+
tripleo_ceph_deploy_mon_ip: "{{ mon_ip }}"
94+
tripleo_ceph_deploy_spec: "{{ ceph_spec }}"
95+
tripleo_ceph_deploy_stack: "{{ stack }}"
96+
tripleo_ceph_deploy_config: "{{ initial_ceph_conf }}"
97+
tripleo_ceph_deploy_output: "{{ deployed_ceph }}"
98+
tripleo_ceph_deploy_container_image_prepare: "{{ containers_prep }}"
99+
tripleo_ceph_deploy_cephadm_extra_args: "--log-to-file --skip-mon-network"
100+
tripleo_ceph_deploy_force: true
101+
tripleo_ceph_deploy_become: true
102+
tripleo_ceph_deploy_overwrite: true
103+
tripleo_ceph_deploy_debug: true
104+
tripleo_ceph_deploy_generate_scripts: true
105+
tripleo_ceph_deploy_network_data: "{{ network_data }}"
106+
tripleo_ceph_deploy_cluster_network_name: storage
107+
108+
- name: Add ceph to enabled services
109+
ansible.builtin.set_fact:
110+
service_envs: "{{ service_envs | union(ceph_env) }}"
111+
vars:
112+
ceph_env:
113+
- "/usr/share/openstack-tripleo-heat-templates/environments/{{ ceph_env_base }}/{{ ceph_env_name }}.yaml"
114+
115+
- name: Add ceph network to enabled services
116+
when: ceph_adm_enabled
117+
ansible.builtin.set_fact:
118+
service_envs: "{{ service_envs | union(deployed_ceph_envs) }}"
119+
vars:
120+
deployed_ceph_envs:
121+
- "{{ deployed_ceph }}"
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
- name: Create network_data file
3+
ansible.builtin.copy:
4+
dest: "{{ network_data }}"
5+
mode: '644'
6+
content: |
7+
- name: Storage
8+
mtu: 1350
9+
vip: true
10+
name_lower: storage
11+
dns_domain: storage.mydomain.tld.
12+
service_net_map_replace: storage
13+
subnets:
14+
storage_subnet:
15+
ip_subnet: '{{ ceph_network }}'
16+
allocation_pools: [{'start': '{{ start }}', 'end': '{{ end }}'}]
17+
18+
- name: Create deployed_network environment file (with VIPs)
19+
ansible.builtin.copy:
20+
dest: "{{ deployed_network }}"
21+
mode: '644'
22+
content: |
23+
resource_registry:
24+
OS::TripleO::Network::Ports::ControlPlaneVipPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_vip_ctlplane.yaml
25+
OS::TripleO::Network::Ports::StorageVipPort: network/ports/deployed_vip_storage.yaml
26+
OS::TripleO::Network: /usr/share/openstack-tripleo-heat-templates/network/deployed_networks.yaml
27+
parameter_defaults:
28+
NodePortMap:
29+
standalone:
30+
ctlplane:
31+
ip_address: {{ local_ip }}
32+
ip_subnet: {{ local_ip }}/{{ control_plane_prefix }}
33+
ip_address_uri: {{ local_ip }}
34+
storage:
35+
ip_address: {{ mon_ip }}
36+
ip_subnet: {{ dummy_ip_cidr }}
37+
ip_address_uri: {{ mon_ip }}
38+
ControlPlaneVipData:
39+
fixed_ips:
40+
- ip_address: {{ control_plane_ip }}
41+
name: control_virtual_ip
42+
network:
43+
tags:
44+
- "{{ control_plane_cidr }}"
45+
subnets:
46+
- ip_version: 4
47+
VipPortMap:
48+
storage:
49+
ip_address: {{ dummy_vip }}
50+
ip_address_uri: {{ dummy_vip }}
51+
ip_subnet: {{ dummy_vip ~ '/' ~ control_plane_prefix | string }}
52+
DeployedNetworkEnvironment:
53+
net_attributes_map:
54+
storage:
55+
network:
56+
dns_domain: storage.mydomain.tld.
57+
mtu: 1350
58+
name: storage
59+
tags:
60+
- tripleo_network_name=Storage
61+
- tripleo_net_idx=0
62+
- tripleo_service_net_map_replace=storage
63+
- tripleo_vip=true
64+
subnets:
65+
storage_subnet:
66+
cidr: {{ ceph_network }}
67+
dns_nameservers: []
68+
gateway_ip: null
69+
host_routes: []
70+
ip_version: 4
71+
name: storage_subnet
72+
net_cidr_map:
73+
storage:
74+
- {{ ceph_network }}
75+
net_ip_version_map:
76+
storage: 4

playbooks/templates/standalone_parameters.ceph_ansible.yaml.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#vi:syntax=yaml
22

3+
CephPoolDefaultPgNum: 8
4+
CephPoolDefaultSize: 1
5+
CephSpecFqdn: true
6+
37
{% if ceph_devices is defined %}
48
CephAnsibleDisksConfig:
59
osd_scenario: lvm

playbooks/templates/standalone_parameters.cephadm.yaml.j2

Lines changed: 0 additions & 16 deletions
This file was deleted.

playbooks/templates/standalone_parameters.yaml.j2

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,10 @@ parameter_defaults:
116116
tripleo_kernel_defer_reboot: true
117117

118118
{% if ceph_enabled %}
119-
{% if ceph_adm_enabled %}
120-
{% include "standalone_parameters.cephadm.yaml.j2" %}
121-
{% else %}
119+
{% if not ceph_adm_enabled %}
122120
{% include "standalone_parameters.ceph_ansible.yaml.j2" %}
123121
{% endif %}
124122

125-
CephPoolDefaultPgNum: 8
126-
CephPoolDefaultSize: 1
127-
CephSpecFqdn: true
128123
NovaComputeStartupDelay: 180
129124

130125
# Don't use ceph for local ephemeral storage by default: its performance is

0 commit comments

Comments
 (0)