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