Remove osd_pool_default_min_size to allow Ceph cluster to do the right thing by default
[apex-tripleo-heat-templates.git] / puppet / services / ceph-mon.yaml
1 heat_template_version: ocata
2
3 description: >
4   Ceph Monitor 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   EndpointMap:
17     default: {}
18     description: Mapping of service endpoint -> protocol. Typically set
19                  via parameter_defaults in the resource registry.
20     type: json
21   CephIPv6:
22     default: False
23     type: boolean
24   CephMonKey:
25     description: The Ceph monitors key. Can be created with ceph-authtool --gen-print-key.
26     type: string
27     hidden: true
28   CinderRbdPoolName:
29     default: volumes
30     type: string
31   ManilaCephFSDataPoolName:
32     default: manila_data
33     type: string
34   ManilaCephFSMetadataPoolName:
35     default: manila_metadata
36     type: string
37   CinderBackupRbdPoolName:
38     default: backups
39     type: string
40   GlanceRbdPoolName:
41     default: images
42     type: string
43   GnocchiRbdPoolName:
44     default: metrics
45     type: string
46   NovaRbdPoolName:
47     default: vms
48     type: string
49   CephPools:
50     description: >
51       It can be used to override settings for one of the predefined pools, or to create
52       additional ones. Example:
53       {
54         "volumes": {
55           "size": 5,
56           "pg_num": 128,
57           "pgp_num": 128
58          }
59       }
60     default: {}
61     type: json
62   CephValidationRetries:
63     type: number
64     default: 5
65     description: Number of retry attempts for Ceph validation
66   CephValidationDelay:
67     type: number
68     default: 10
69     description: Interval (in seconds) in between validation checks
70   MonitoringSubscriptionCephMon:
71     default: 'overcloud-ceph-mon'
72     type: string
73   CephPoolDefaultSize:
74     description: default minimum replication for RBD copies
75     type: number
76     default: 3
77
78 resources:
79   CephBase:
80     type: ./ceph-base.yaml
81     properties:
82       ServiceNetMap: {get_param: ServiceNetMap}
83       DefaultPasswords: {get_param: DefaultPasswords}
84       EndpointMap: {get_param: EndpointMap}
85
86 outputs:
87   role_data:
88     description: Role data for the Ceph Monitor service.
89     value:
90       service_name: ceph_mon
91       monitoring_subscription: {get_param: MonitoringSubscriptionCephMon}
92       config_settings:
93         map_merge:
94           - get_attr: [CephBase, role_data, config_settings]
95           - ceph::profile::params::ms_bind_ipv6: {get_param: CephIPv6}
96             ceph::profile::params::mon_key: {get_param: CephMonKey}
97             ceph::profile::params::osd_pool_default_pg_num: 32
98             ceph::profile::params::osd_pool_default_pgp_num: 32
99             ceph::profile::params::osd_pool_default_size: {get_param: CephPoolDefaultSize}
100             # repeat returns items in a list, so we need to map_merge twice
101             tripleo::profile::base::ceph::mon::ceph_pools:
102               map_merge:
103                 - map_merge:
104                     repeat:
105                       for_each:
106                         <%pool%>:
107                           - {get_param: CinderRbdPoolName}
108                           - {get_param: ManilaCephFSDataPoolName}
109                           - {get_param: ManilaCephFSMetadataPoolName}
110                           - {get_param: CinderBackupRbdPoolName}
111                           - {get_param: NovaRbdPoolName}
112                           - {get_param: GlanceRbdPoolName}
113                           - {get_param: GnocchiRbdPoolName}
114                       template:
115                         <%pool%>:
116                           pg_num: "%{hiera('ceph::profile::params::osd_pool_default_pg_num')}"
117                           pgp_num: "%{hiera('ceph::profile::params::osd_pool_default_pgp_num')}"
118                           size: "%{hiera('ceph::profile::params::osd_pool_default_size')}"
119                 - {get_param: CephPools}
120             tripleo.ceph_mon.firewall_rules:
121               '110 ceph_mon':
122                 dport:
123                   - 6789
124       service_config_settings:
125         get_attr: [CephBase, role_data, service_config_settings]
126       step_config: |
127         include ::tripleo::profile::base::ceph::mon
128       upgrade_batch_tasks:
129         # Note we perform these tasks in list order, but they are all step0 so
130         # we can perform a rolling upgrade of all mon nodes in step0, then a
131         # rolling upgrade of all osd nodes in step1
132         - name: Check status
133           tags: step0,validation
134           shell: ceph health | egrep -sq "HEALTH_OK|HEALTH_WARN"
135         - name: Stop CephMon
136           tags: step0
137           service:
138             name: ceph-mon@{{ ansible_hostname }}
139             state: stopped
140         - name: Update Ceph packages
141           tags: step0
142           yum:
143             name: ceph-mon
144             state: latest
145         - name: Start CephMon
146           tags: step0
147           service:
148             name: ceph-mon@{{ ansible_hostname }}
149             state: started
150         # ceph-ansible
151         # https://github.com/ceph/ceph-ansible/blob/master/infrastructure-playbooks/rolling_update.yml#L149-L157
152         - name: Wait for the monitor to join the quorum...
153           tags: step0,ceph_quorum_validation
154           shell: |
155             ceph -s | grep monmap | sed 's/.*quorum//' | egrep -sq {{ ansible_hostname }}
156           register: ceph_quorum_nodecheck
157           until: ceph_quorum_nodecheck.rc == 0
158           retries: {get_param: CephValidationRetries}
159           delay: {get_param: CephValidationDelay}
160         - name: ceph osd crush tunables default
161           tags: step0
162           shell: ceph osd crush tunables default