confusing usage of NFS config options
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
New
|
Undecided
|
Unassigned |
Bug Description
1. Documentation is bit confusing when mentioning where to put options to NFS shares:
- https:/
- https:/
2. Cinder code is actually using both of these locations
nfs_mount_options:
https:/
options specified in nfs_shares_config file:
https:/
When an options is specified on both places, mount command uses all of them:
https:/
(the ones from nfs_shares_config are passed as flags)
3. When attaching volume to the nova instance, nova (additionally to it's ability to use options specified in nova config file) should use the options passed from cinder connection:
https:/
However, in this case only the options that were specified in nfs_shares_config file are passed, and not the one in nfs_mount_options
Regarding point 3 (attaching volume to the instance), the configuration passed from cinder connection only includes the options written in nfs_shares_config file. See
https:/ /github. com/openstack/ cinder/ blob/stable/ newton/ cinder/ volume/ drivers/ remotefs. py#L172
There seems to be a code that tries to use nas_mount_options:
https:/ /github. com/openstack/ cinder/ blob/stable/ newton/ cinder/ volume/ drivers/ remotefs. py#L155
but this is not executed during the volume attach action.
So, we might need to pass the options explicitely in initialize_ connection, something like:
diff --git a/cinder/ volume/ drivers/ remotefs. py b/cinder/ volume/ drivers/ remotefs. py .d69540175 100644 volume/ drivers/ remotefs. py volume/ drivers/ remotefs. py driver. BaseVD) : provider_ location,
'name' : volume.name} provider_ location in self.shares: volume. provider_ location] volume. provider_ location] .split( ' ') ion.nfs_ mount_options: ion.nfs_ mount_options. .split( ' '))
' driver_ volume_ type': self.driver_ volume_ type,
' data': data,
index 99481bd34.
--- a/cinder/
+++ b/cinder/
@@ -172,8 +172,19 @@ class RemoteFSDriver(
"""
data = {'export': volume.
+
+ mount_options = []
if volume.
- data['options'] = self.shares[
+ mount_options = self.shares[
+
+ # FIXME: This should check both nfs and nas_mount options...
+ if self.configurat
+ mount_options = list(set(
+ mount_options + self.configurat
+ )
+
+ if mount_options:
+ data['options'] = "-o " + mount_options
return {
Although it still looks bit ugly and I'm not sure what should be the relation between nas_mount_options and nfs_mount_option if they both exist