Merge "Remove osd_pool_default_min_size to allow Ceph cluster to do the right thing...
[apex-tripleo-heat-templates.git] / puppet / services / ceph-osd.yaml
1 heat_template_version: pike
2
3 description: >
4   Ceph OSD service.
5
6 parameters:
7   ServiceNetMap:
8     default: {}
9     description: Mapping of service_name -> network name. Typically set
10                  via parameter_defaults in the resource registry.  This
11                  mapping overrides those in ServiceNetMapDefaults.
12     type: json
13   DefaultPasswords:
14     default: {}
15     type: json
16   RoleName:
17     default: ''
18     description: Role name on which the service is applied
19     type: string
20   RoleParameters:
21     default: {}
22     description: Parameters specific to the role
23     type: json
24   EndpointMap:
25     default: {}
26     description: Mapping of service endpoint -> protocol. Typically set
27                  via parameter_defaults in the resource registry.
28     type: json
29   MonitoringSubscriptionCephOsd:
30     default: 'overcloud-ceph-osd'
31     type: string
32   CephValidationRetries:
33     type: number
34     default: 40
35     description: Number of retry attempts for Ceph validation
36   CephValidationDelay:
37     type: number
38     default: 30
39     description: Interval (in seconds) in between validation checks
40   IgnoreCephUpgradeWarnings:
41     type: boolean
42     default: false
43     description: If enabled, Ceph upgrade will be forced even though cluster or PGs status is not clean
44
45 parameter_groups:
46 - label: deprecated
47   description: Do not use deprecated params, they will be removed.
48   parameters:
49   - IgnoreCephUpgradeWarnings
50
51 resources:
52   CephBase:
53     type: ./ceph-base.yaml
54     properties:
55       ServiceNetMap: {get_param: ServiceNetMap}
56       DefaultPasswords: {get_param: DefaultPasswords}
57       EndpointMap: {get_param: EndpointMap}
58       RoleName: {get_param: RoleName}
59       RoleParameters: {get_param: RoleParameters}
60
61 outputs:
62   role_data:
63     description: Role data for the Cinder OSD service.
64     value:
65       service_name: ceph_osd
66       monitoring_subscription: {get_param: MonitoringSubscriptionCephOsd}
67       config_settings:
68         map_merge:
69           - get_attr: [CephBase, role_data, config_settings]
70           - tripleo.ceph_osd.firewall_rules:
71               '111 ceph_osd':
72                 dport:
73                   - '6800-7300'
74       step_config: |
75         include ::tripleo::profile::base::ceph::osd
76       upgrade_batch_tasks:
77         - name: Check status
78           tags: step1,validation
79           shell: ceph health | grep -qv HEALTH_ERR
80         - name: Get OSD IDs
81           tags: step1
82           shell: ls /var/lib/ceph/osd | awk 'BEGIN { FS = "-" } ; { print $2 }'
83           register: osd_ids
84           # "so that mirrors aren't rebalanced as if the OSD died" - gfidente / leseb
85         - name: ceph osd set noout
86           tags: step1
87           command: ceph osd set noout
88         - name: ceph osd set norebalance
89           tags: step1
90           command: ceph osd set norebalance
91         - name: ceph osd set nodeep-scrub
92           tags: step1
93           command: ceph osd set nodeep-scrub
94         - name: ceph osd set noscrub
95           tags: step1
96           command: ceph osd set noscrub
97         - name: Stop CephOSD
98           tags: step1
99           service:
100             name: ceph-osd@{{ item }}
101             state: stopped
102           with_items: "{{osd_ids.stdout.strip().split()}}"
103         - name: Update Ceph packages
104           tags: step1
105           yum:
106             name: ceph-osd
107             state: latest
108         - name: Start CephOSD
109           tags: step1
110           service:
111             name: ceph-osd@{{ item }}
112             state: started
113           with_items: "{{osd_ids.stdout.strip().split()}}"
114         # with awk we are meant to check if $2 and $4 are *the same* but it returns 1 when
115         # they are, so the check is inverted to produce an useful exit code
116         - name: Wait for clean pgs...
117           tags: step1,ceph_pgs_clean_validation
118           vars:
119             ignore_warnings: {get_param: IgnoreCephUpgradeWarnings}
120           shell: |
121             ceph pg stat | awk '{exit($2!=$4)}' && ceph health | egrep -sq "HEALTH_OK|HEALTH_WARN"
122           register: ceph_pgs_healthcheck
123           until: ceph_pgs_healthcheck.rc == 0
124           retries: {get_param: CephValidationRetries}
125           delay: {get_param: CephValidationDelay}
126           when:
127             - not ignore_warnings
128         - name: ceph osd unset noout
129           tags: step1
130           command: ceph osd unset noout
131         - name: ceph osd unset norebalance
132           tags: step1
133           command: ceph osd unset norebalance
134         - name: ceph osd unset nodeep-scrub
135           tags: step1
136           command: ceph osd unset nodeep-scrub
137         - name: ceph osd unset noscrub
138           tags: step1
139           command: ceph osd unset noscrub