Browse Source

Make nova ephemeral storage backend configurable per-role

When multiple Compute roles are used, admins may want to use different storage
backends on each role.

This change turns NovaEnableRbdBackend into a role specific param.
Any other config that is implicitly enabled by the global NovaEnableRbdBackend
now requires a dedicated param.

Co-Authored-By: ratailor@redhat.com
Change-Id: I9f40a2a3561fcb1d1fec9d9c3c1f9cabaf02650c
Implements: blueprint nova-backend-per-role
(cherry picked from commit 65d7e55f54)
(cherry picked from commit ed8d9da9b6)
(cherry picked from commit b1febf785d)
tags/8.4.1
Oliver Walsh 5 months ago
parent
commit
e5f6ec75c3

+ 16
- 7
docker/services/nova-libvirt.yaml View File

@@ -58,8 +58,10 @@ parameters:
58 58
     type: number
59 59
   NovaEnableRbdBackend:
60 60
     default: false
61
-    description: Whether to enable or not the Rbd backend for Nova
61
+    description: Whether to enable the Rbd backend for Nova ephemeral storage.
62 62
     type: boolean
63
+    tags:
64
+      - role_specific
63 65
   CinderEnableRbdBackend:
64 66
     default: false
65 67
     description: Whether to enable or not the Rbd backend for Cinder
@@ -148,12 +150,19 @@ conditions:
148 150
 
149 151
   need_libvirt_secret:
150 152
     or:
151
-    - equals:
152
-      - {get_param: NovaEnableRbdBackend}
153
-      - true
154
-    - equals:
155
-      - {get_param: CinderEnableRbdBackend}
156
-      - true
153
+      - equals:
154
+        - {get_param: [RoleParameters, NovaEnableRbdBackend]}
155
+        - true
156
+      - and:
157
+        - equals:
158
+          - {get_param: [RoleParameters, NovaEnableRbdBackend]}
159
+          - ''
160
+        - equals:
161
+          - {get_param: NovaEnableRbdBackend}
162
+          - true
163
+      - equals:
164
+        - {get_param: CinderEnableRbdBackend}
165
+        - true
157 166
 
158 167
   use_tls_for_vnc:
159 168
     and:

+ 3
- 1
docker/services/octavia/octavia-deployment-config.yaml View File

@@ -67,8 +67,10 @@ parameters:
67 67
       provides a convenient way to e.g. debug load balancing services.
68 68
   NovaEnableRbdBackend:
69 69
     default: false
70
-    description: Whether to enable or not the Rbd backend for Nova
70
+    description: Whether to enable the Rbd backend for Nova ephemeral storage.
71 71
     type: boolean
72
+    tags:
73
+      - role_specific
72 74
   OctaviaControlNetwork:
73 75
     description: The name for the neutron network used for the amphora
74 76
                  control network

+ 14
- 0
environments/ceph-ansible/ceph-ansible-per-role.yaml View File

@@ -0,0 +1,14 @@
1
+resource_registry:
2
+  OS::TripleO::Services::CephMgr: ../../docker/services/ceph-ansible/ceph-mgr.yaml
3
+  OS::TripleO::Services::CephMon: ../../docker/services/ceph-ansible/ceph-mon.yaml
4
+  OS::TripleO::Services::CephOSD: ../../docker/services/ceph-ansible/ceph-osd.yaml
5
+  OS::TripleO::Services::CephClient: ../../docker/services/ceph-ansible/ceph-client.yaml
6
+
7
+parameter_defaults:
8
+  CinderEnableIscsiBackend: false
9
+  CinderEnableRbdBackend: true
10
+  CinderBackupBackend: ceph
11
+  GlanceBackend: rbd
12
+  GnocchiBackend: rbd
13
+  GlanceShowMultipleLocations: true
14
+  # NovaEnableRbdBackend can be set on individual roles to choose RBD or local ephemeral storage

+ 20
- 8
puppet/services/glance-api.yaml View File

@@ -129,7 +129,15 @@ parameters:
129 129
     type: string
130 130
   NovaEnableRbdBackend:
131 131
     default: false
132
-    description: Whether to enable or not the Rbd backend for Nova
132
+    description: Whether to enable the Rbd backend for Nova ephemeral storage.
133
+    type: boolean
134
+    tags:
135
+      - role_specific
136
+  GlanceShowMultipleLocations:
137
+    default: false
138
+    description: |
139
+      Whether to show multiple image locations e.g for copy-on-write support on
140
+      RBD or Netapp backends. Potential security risk, see glance.conf for more information.
133 141
     type: boolean
134 142
   GlanceEnabledImportMethods:
135 143
     default: 'web-download'
@@ -193,13 +201,17 @@ conditions:
193 201
   service_debug_unset: {equals : [{get_param: GlanceDebug}, '']}
194 202
   cinder_backend_enabled: {equals: [{get_param: GlanceBackend}, cinder]}
195 203
   glance_multiple_locations:
196
-    and:
197
-    - equals:
198
-      - get_param: GlanceBackend
199
-      - rbd
200
-    - equals:
201
-      - get_param: NovaEnableRbdBackend
202
-      - true
204
+    or:
205
+    - {equals : [{get_param: GlanceShowMultipleLocations}, true]}
206
+    - and:
207
+      # Keep this for compat, but ignore NovaEnableRbdBackend if it's a role param
208
+      - equals:
209
+        - get_param: GlanceBackend
210
+        - rbd
211
+      - equals:
212
+        - get_param: NovaEnableRbdBackend
213
+        - true
214
+
203 215
 
204 216
 resources:
205 217
 

+ 9
- 2
puppet/services/nova-compute.yaml View File

@@ -95,8 +95,10 @@ parameters:
95 95
     type: boolean
96 96
   NovaEnableRbdBackend:
97 97
     default: false
98
-    description: Whether to enable or not the Rbd backend for Nova
98
+    description: Whether to enable the Rbd backend for Nova ephemeral storage.
99 99
     type: boolean
100
+    tags:
101
+      - role_specific
100 102
   NovaComputeLibvirtVifDriver:
101 103
     default: ''
102 104
     description: Libvirt VIF driver configuration for the network
@@ -217,7 +219,10 @@ conditions:
217 219
         - equals: [{get_param: NovaNfsEnabled}, true]
218 220
         - equals: [{get_param: [RoleParameters, NovaNfsEnabled]}, '']
219 221
       - equals: [{get_param: [RoleParameters, NovaNfsEnabled]}, true]
220
-      - equals: [{get_param: NovaEnableRbdBackend}, true]
222
+      - equals: [{get_param: [RoleParameters, NovaEnableRbdBackend]}, true]
223
+      - and:
224
+        - equals: [{get_param: [RoleParameters, NovaEnableRbdBackend]}, '']
225
+        - equals: [{get_param: NovaEnableRbdBackend}, true]
221 226
 
222 227
 resources:
223 228
   NovaBase:
@@ -253,6 +258,7 @@ resources:
253 258
               nova::compute::libvirt::mem_stats_period_seconds: NovaLibvirtMemStatsPeriodSeconds
254 259
               nova::compute::resume_guests_state_on_host_boot: NovaResumeGuestsStateOnHostBoot
255 260
               resume_guests_state_on_host_boot: NovaResumeGuestsStateOnHostBoot
261
+              nova::compute::rbd::ephemeral_storage: NovaEnableRbdBackend
256 262
             - values: {get_param: [RoleParameters]}
257 263
           - values:
258 264
               NovaVcpuPinSet: {get_param: NovaVcpuPinSet}
@@ -267,6 +273,7 @@ resources:
267 273
               NovaNfsVersion: {get_param: NovaNfsVersion}
268 274
               NovaLibvirtMemStatsPeriodSeconds: {get_param: NovaLibvirtMemStatsPeriodSeconds}
269 275
               NovaResumeGuestsStateOnHostBoot: {get_param: NovaResumeGuestsStateOnHostBoot}
276
+              NovaEnableRbdBackend: {get_param: NovaEnableRbdBackend}
270 277
 
271 278
 outputs:
272 279
   role_data:

+ 62
- 0
roles/ComputeLocalEphemeral.yaml View File

@@ -0,0 +1,62 @@
1
+###############################################################################
2
+# Role: ComputeLocalEphemeral                                                 #
3
+###############################################################################
4
+- name: ComputeLocalEphemeral
5
+  description: |
6
+    Per-role compute storage backend - basic Compute Node with local ephemeral disks
7
+  CountDefault: 0
8
+  networks:
9
+    - InternalApi
10
+    - Tenant
11
+    - Storage
12
+  HostnameFormatDefault: '%stackname%-novacompute-local-%index%'
13
+  RoleParametersDefault:
14
+    TunedProfileName: "virtual-host"
15
+    NovaEnableRbdBackend: false
16
+  ServicesDefault:
17
+    - OS::TripleO::Services::Aide
18
+    - OS::TripleO::Services::AuditD
19
+    - OS::TripleO::Services::CACerts
20
+    - OS::TripleO::Services::CephClient
21
+    - OS::TripleO::Services::CephExternal
22
+    - OS::TripleO::Services::CertmongerUser
23
+    - OS::TripleO::Services::Collectd
24
+    - OS::TripleO::Services::ComputeCeilometerAgent
25
+    - OS::TripleO::Services::ComputeNeutronCorePlugin
26
+    - OS::TripleO::Services::ComputeNeutronL3Agent
27
+    - OS::TripleO::Services::ComputeNeutronMetadataAgent
28
+    - OS::TripleO::Services::ComputeNeutronOvsAgent
29
+    - OS::TripleO::Services::Docker
30
+    - OS::TripleO::Services::Fluentd
31
+    - OS::TripleO::Services::IpaClient
32
+    - OS::TripleO::Services::Ipsec
33
+    - OS::TripleO::Services::Iscsid
34
+    - OS::TripleO::Services::Kernel
35
+    - OS::TripleO::Services::LoginDefs
36
+    - OS::TripleO::Services::MetricsQdr
37
+    - OS::TripleO::Services::MySQLClient
38
+    - OS::TripleO::Services::NeutronBgpVpnBagpipe
39
+    - OS::TripleO::Services::NeutronLinuxbridgeAgent
40
+    - OS::TripleO::Services::NeutronVppAgent
41
+    - OS::TripleO::Services::NovaCompute
42
+    - OS::TripleO::Services::NovaLibvirt
43
+    - OS::TripleO::Services::NovaLibvirtGuests
44
+    - OS::TripleO::Services::NovaMigrationTarget
45
+    - OS::TripleO::Services::Ntp
46
+    - OS::TripleO::Services::ContainersLogrotateCrond
47
+    - OS::TripleO::Services::OpenDaylightOvs
48
+    - OS::TripleO::Services::Rhsm
49
+    - OS::TripleO::Services::RsyslogSidecar
50
+    - OS::TripleO::Services::Securetty
51
+    - OS::TripleO::Services::SensuClient
52
+    - OS::TripleO::Services::SkydiveAgent
53
+    - OS::TripleO::Services::Snmp
54
+    - OS::TripleO::Services::Sshd
55
+    - OS::TripleO::Services::Timezone
56
+    - OS::TripleO::Services::TripleoFirewall
57
+    - OS::TripleO::Services::TripleoPackages
58
+    - OS::TripleO::Services::Tuned
59
+    - OS::TripleO::Services::Vpp
60
+    - OS::TripleO::Services::OVNController
61
+    - OS::TripleO::Services::OVNMetadataAgent
62
+    - OS::TripleO::Services::Ptp

+ 62
- 0
roles/ComputeRBDEphemeral.yaml View File

@@ -0,0 +1,62 @@
1
+###############################################################################
2
+# Role: ComputeRBDEphemeral                                                   #
3
+###############################################################################
4
+- name: ComputeRBDEphemeral
5
+  description: |
6
+    Per-role compute storage backend - basic Compute Node with RBD ephemeral disks
7
+  CountDefault: 0
8
+  networks:
9
+    - InternalApi
10
+    - Tenant
11
+    - Storage
12
+  HostnameFormatDefault: '%stackname%-novacompute-rbd-%index%'
13
+  RoleParametersDefault:
14
+    TunedProfileName: "virtual-host"
15
+    NovaEnableRbdBackend: true
16
+  ServicesDefault:
17
+    - OS::TripleO::Services::Aide
18
+    - OS::TripleO::Services::AuditD
19
+    - OS::TripleO::Services::CACerts
20
+    - OS::TripleO::Services::CephClient
21
+    - OS::TripleO::Services::CephExternal
22
+    - OS::TripleO::Services::CertmongerUser
23
+    - OS::TripleO::Services::Collectd
24
+    - OS::TripleO::Services::ComputeCeilometerAgent
25
+    - OS::TripleO::Services::ComputeNeutronCorePlugin
26
+    - OS::TripleO::Services::ComputeNeutronL3Agent
27
+    - OS::TripleO::Services::ComputeNeutronMetadataAgent
28
+    - OS::TripleO::Services::ComputeNeutronOvsAgent
29
+    - OS::TripleO::Services::Docker
30
+    - OS::TripleO::Services::Fluentd
31
+    - OS::TripleO::Services::IpaClient
32
+    - OS::TripleO::Services::Ipsec
33
+    - OS::TripleO::Services::Iscsid
34
+    - OS::TripleO::Services::Kernel
35
+    - OS::TripleO::Services::LoginDefs
36
+    - OS::TripleO::Services::MetricsQdr
37
+    - OS::TripleO::Services::MySQLClient
38
+    - OS::TripleO::Services::NeutronBgpVpnBagpipe
39
+    - OS::TripleO::Services::NeutronLinuxbridgeAgent
40
+    - OS::TripleO::Services::NeutronVppAgent
41
+    - OS::TripleO::Services::NovaCompute
42
+    - OS::TripleO::Services::NovaLibvirt
43
+    - OS::TripleO::Services::NovaLibvirtGuests
44
+    - OS::TripleO::Services::NovaMigrationTarget
45
+    - OS::TripleO::Services::Ntp
46
+    - OS::TripleO::Services::ContainersLogrotateCrond
47
+    - OS::TripleO::Services::OpenDaylightOvs
48
+    - OS::TripleO::Services::Rhsm
49
+    - OS::TripleO::Services::RsyslogSidecar
50
+    - OS::TripleO::Services::Securetty
51
+    - OS::TripleO::Services::SensuClient
52
+    - OS::TripleO::Services::SkydiveAgent
53
+    - OS::TripleO::Services::Snmp
54
+    - OS::TripleO::Services::Sshd
55
+    - OS::TripleO::Services::Timezone
56
+    - OS::TripleO::Services::TripleoFirewall
57
+    - OS::TripleO::Services::TripleoPackages
58
+    - OS::TripleO::Services::Tuned
59
+    - OS::TripleO::Services::Vpp
60
+    - OS::TripleO::Services::OVNController
61
+    - OS::TripleO::Services::OVNMetadataAgent
62
+    - OS::TripleO::Services::Ptp

+ 5
- 1
tools/yaml-validate.py View File

@@ -351,7 +351,7 @@ def validate_controller_no_ceph_role(filename, tpl):
351 351
                 return 1
352 352
     return 0
353 353
 
354
-def validate_with_compute_role_services(role_filename, role_tpl, exclude_service):
354
+def validate_with_compute_role_services(role_filename, role_tpl, exclude_service=()):
355 355
     cmpt_filename = os.path.join(os.path.dirname(role_filename),
356 356
                                  './Compute.yaml')
357 357
     cmpt_tpl = yaml.load(open(cmpt_filename).read())
@@ -777,6 +777,10 @@ def validate(filename, param_map):
777 777
         if filename.startswith('./roles/ControllerNoCeph.yaml'):
778 778
             retval = validate_controller_no_ceph_role(filename, tpl)
779 779
 
780
+        if filename in ('./roles/ComputeLocalEphemeral.yaml',
781
+                        './roles/ComputeRBDEphemeral.yaml'):
782
+            retval |= validate_with_compute_role_services(filename, tpl)
783
+
780 784
         if filename.startswith('./network_data_'):
781 785
             retval = validate_network_data_file(filename)
782 786
 

Loading…
Cancel
Save