Allow NovaNfs parameters to be role specific

Currently, TripleO does not support to have an NFS backend as Nova Ephemeral storage on
selected roles. An admin should be allowed to create Compute role(s) for InstanceHA
having NFS shared storage used then by selected workloads while leaving the majority of
the workloads on standard compute nodes without InstanceHA and shared storage.

Closes-Bug: 1823712

Change-Id: I2702a022565a130ab339d165cb2252ad67d1162e
(cherry picked from commit 1295868ddd)
(cherry picked from commit 0cd185954c)
(cherry picked from commit 4d478753b7)
This commit is contained in:
Piotr Kopec 2019-04-14 22:56:26 +02:00
parent 607e4acf9e
commit 74ba670bb6
2 changed files with 28 additions and 5 deletions

View File

@ -63,14 +63,20 @@ parameters:
default: false
description: Whether to enable or not the NFS backend for Nova
type: boolean
tags:
- role_specific
NovaNfsShare:
default: ''
description: NFS share to mount for nova storage (when NovaNfsEnabled is true)
type: string
tags:
- role_specific
NovaNfsOptions:
default: 'context=system_u:object_r:nfs_t:s0'
description: NFS mount options for nova storage (when NovaNfsEnabled is true)
type: string
tags:
- role_specific
NovaNfsVersion:
default: '4'
description: >
@ -81,6 +87,8 @@ parameters:
type: string
constraints:
- allowed_pattern: "^4.?[0-9]?"
tags:
- role_specific
CinderEnableRbdBackend:
default: false
description: Whether to enable or not the Rbd backend for Cinder
@ -182,6 +190,7 @@ conditions:
enable_live_migration_tunnelled:
or:
- equals: [{get_param: NovaNfsEnabled}, true]
- equals: [{get_param: [RoleParameters, NovaNfsEnabled]}, true]
- equals: [{get_param: NovaEnableRbdBackend}, true]
resources:
@ -210,6 +219,10 @@ resources:
nova::compute::libvirt::tx_queue_size: NovaLibvirtTxQueueSize
nova::compute::libvirt::volume_use_multipath: NovaLibvirtVolumeUseMultipath
nova::compute::rbd::libvirt_images_rbd_pool: NovaRbdPoolName
tripleo::profile::base::nova::compute::nova_nfs_enabled: NovaNfsEnabled
nfs_share: NovaNfsShare
nfs_options: NovaNfsOptions
nfs_vers: NovaNfsVersion
- values: {get_param: [RoleParameters]}
- values:
NovaVcpuPinSet: {get_param: NovaVcpuPinSet}
@ -218,6 +231,10 @@ resources:
NovaLibvirtTxQueueSize: {get_param: NovaLibvirtTxQueueSize}
NovaLibvirtVolumeUseMultipath: {get_param: NovaLibvirtVolumeUseMultipath}
NovaRbdPoolName: {get_param: NovaRbdPoolName}
NovaNfsEnabled: {get_param: NovaNfsEnabled}
NovaNfsShare: {get_param: NovaNfsShare}
NovaNfsOptions: {get_param: NovaNfsOptions}
NovaNfsVersion: {get_param: NovaNfsVersion}
outputs:
role_data:
@ -258,7 +275,6 @@ outputs:
- - 'client'
- {get_param: CephClientUserName}
tripleo::profile::base::nova::compute::cinder_nfs_backend: {get_param: CinderEnableNfsBackend}
tripleo::profile::base::nova::compute::nova_nfs_enabled: {get_param: NovaNfsEnabled}
rbd_persistent_storage: {get_param: CinderEnableRbdBackend}
nova::compute::rbd::libvirt_rbd_secret_key: {get_param: CephClientKey}
nova::compute::rbd::libvirt_rbd_secret_uuid: {get_param: CephClusterFSID}
@ -308,10 +324,10 @@ outputs:
host_prep_tasks:
- name: Mount Nova NFS Share
vars:
nfs_backend_enable: {get_param: NovaNfsEnabled}
nfs_share: {get_param: NovaNfsShare}
nfs_options: {get_param: NovaNfsOptions}
nfs_vers: {get_param: NovaNfsVersion}
nfs_backend_enable: {get_attr: [RoleParametersValue, value, nfs_backend_enable]}
nfs_share: {get_attr: [RoleParametersValue, value, nfs_share]}
nfs_options: {get_attr: [RoleParametersValue, value, nfs_options]}
nfs_vers: {get_attr: [RoleParametersValue, value, nfs_vers]}
mount: name=/var/lib/nova/instances src="{{nfs_share}}" fstype=nfs4 opts="_netdev,bg,{{nfs_options}},vers={{nfs_vers}},nfsvers={{nfs_vers}}" state=mounted
when: nfs_backend_enable|bool
upgrade_tasks:

View File

@ -0,0 +1,7 @@
---
features:
- |
The parameters ``NovaNfsEnabled``, ``NovaNfsShare``, ``NovaNfsOptions``,
``NovaNfsVersion`` are changed to be role specific. This requires the
usage of host aggregates as otherwise it will break live migration of
instances as we can not do this with different storage backends.