From 393e89bfb6438781d6faaf5dfea2eb468341b451 Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Fri, 15 Mar 2019 11:14:25 +0100 Subject: [PATCH] Make nfs version for nova ephemeral storage configurable New parameter ``NovaNfsVersion`` allow configuring the NFS version used for nova storage (when NovaNfsEnabled is true). Since NFSv3 does not support full locking a NFSv4 version need to be used. To not break current installations the default is the previous hard coded version 4. Change-Id: I810478ed82ee6dc056d9652be91dc45b123e78cf --- deployment/nova/nova-compute-container-puppet.yaml | 13 ++++++++++++- environments/storage-environment.yaml | 2 ++ ...ova_add_nfs_vers_parameter-62b9e9d6150358d1.yaml | 8 ++++++++ sample-env-generator/storage.yaml | 2 ++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/nova_add_nfs_vers_parameter-62b9e9d6150358d1.yaml diff --git a/deployment/nova/nova-compute-container-puppet.yaml b/deployment/nova/nova-compute-container-puppet.yaml index 38dacb5ed8..db6a874164 100644 --- a/deployment/nova/nova-compute-container-puppet.yaml +++ b/deployment/nova/nova-compute-container-puppet.yaml @@ -97,6 +97,16 @@ parameters: default: 'context=system_u:object_r:nfs_t:s0' description: NFS mount options for nova storage (when NovaNfsEnabled is true) type: string + NovaNfsVersion: + default: '4' + description: > + NFS version used for nova storage (when NovaNfsEnabled is true). Since + NFSv3 does not support full locking a NFSv4 version need to be used. + To not break current installations the default is the previous hard + coded version 4. + type: string + constraints: + - allowed_pattern: "^4.?[0-9]?" CinderEnableRbdBackend: default: false description: Whether to enable or not the Rbd backend for Cinder @@ -582,7 +592,8 @@ outputs: nfs_backend_enable: {get_param: NovaNfsEnabled} nfs_share: {get_param: NovaNfsShare} nfs_options: {get_param: NovaNfsOptions} - mount: name=/var/lib/nova/instances src="{{nfs_share}}" fstype=nfs4 opts="_netdev,bg,{{nfs_options}},vers=4,nfsvers=4" state=mounted + nfs_vers: {get_param: NovaNfsVersion} + 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 - name: is Nova Resume Guests State On Host Boot enabled set_fact: diff --git a/environments/storage-environment.yaml b/environments/storage-environment.yaml index d15b7d2652..1fc7dc0dfc 100644 --- a/environments/storage-environment.yaml +++ b/environments/storage-environment.yaml @@ -60,6 +60,8 @@ parameter_defaults: # NovaNfsShare: '' ## Mount options for the NFS instance file storage mount point # NovaNfsOptions: 'context=system_u:object_r:nfs_t:s0' + ## NFS version to be used to mount the NovaNfsShare. Default 4 + # NovaNfsVersion: '4.2' #### CEPH SETTINGS #### diff --git a/releasenotes/notes/nova_add_nfs_vers_parameter-62b9e9d6150358d1.yaml b/releasenotes/notes/nova_add_nfs_vers_parameter-62b9e9d6150358d1.yaml new file mode 100644 index 0000000000..a001b7ca70 --- /dev/null +++ b/releasenotes/notes/nova_add_nfs_vers_parameter-62b9e9d6150358d1.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + New parameter ``NovaNfsVersion`` allow configuring the NFS version + used for nova storage (when NovaNfsEnabled is true). Since NFSv3 + does not support full locking a NFSv4 version need to be used. To + not break current installations the default is the previous hard + coded version 4. diff --git a/sample-env-generator/storage.yaml b/sample-env-generator/storage.yaml index 482c5b96b7..e7c132a063 100644 --- a/sample-env-generator/storage.yaml +++ b/sample-env-generator/storage.yaml @@ -50,8 +50,10 @@ environments: - NovaNfsEnabled - NovaNfsShare - NovaNfsOptions + - NovaNfsVersion sample_values: NovaNfsEnabled: True + NovaNfsVersion: '4.2' static: - NovaNfsEnabled description: |