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/environments/storage/nova-nfs.yaml b/environments/storage/nova-nfs.yaml index b3a354c60e..fd92bc84b5 100644 --- a/environments/storage/nova-nfs.yaml +++ b/environments/storage/nova-nfs.yaml @@ -17,6 +17,10 @@ parameter_defaults: # Type: string NovaNfsShare: '' + # 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 + NovaNfsVersion: 4.2 + # ****************************************************** # Static parameters - these are values that must be # included in the environment but should not be changed. diff --git a/puppet/services/nova-compute.yaml b/puppet/services/nova-compute.yaml index 7a8fe7e327..ece26f4198 100644 --- a/puppet/services/nova-compute.yaml +++ b/puppet/services/nova-compute.yaml @@ -68,6 +68,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 @@ -297,7 +307,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 upgrade_tasks: - name: Stop nova-compute service 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 cd776d40ed..aa1894b9df 100644 --- a/sample-env-generator/storage.yaml +++ b/sample-env-generator/storage.yaml @@ -85,8 +85,10 @@ environments: - NovaNfsEnabled - NovaNfsShare - NovaNfsOptions + - NovaNfsVersion sample_values: NovaNfsEnabled: True + NovaNfsVersion: '4.2' static: - NovaNfsEnabled description: |