[openstack-dev] [cinder] [nova] How to provide additional options to NFS backend?
eharney at redhat.com
Wed May 31 15:34:20 UTC 2017
On 05/25/2017 05:51 AM, Jiri Suchomel wrote:
> it seems to me that the way of adding extra NFS options to the cinder
> backend is somewhat confusing.
> 1. There is nfs_mount_options in cinder config file 
> 2. Then I can put my options to the nfs_shares_config file - that
> it could contain additional options mentiones  or the
> commit message that adds the feature 
> Now, when I put my options to both of these places, cinder-volume
> actually uses them twice and executes the command like this
> mount -t nfs -o nfsvers=3 -o nfsvers=3
> 192.168.241.10:/srv/nfs/vi7/cinder /var/lib/cinder/mnt/f5689da9ea41a66eff2ce0ef89b37bce
> BTW, the options coming from nfs_shares_config are called 'flags' by
> cinder/volume/drivers/nfs ().
> Now, to make it more fun, when I actually want to attach a volume to
> running instance, nova uses different way of realizing which NFS options to use:
> - It reads them from _nova_ config option of libvirt.nfs_mount_options
> - or it uses those it gets them from cinder when creating cinder
> connection  But these are only the options defined in
> nfs_shares_config file, NOT those nfs_mount_options specified in cinder
> config file.
> So. If I put my options to both places, nfs_shares_config file and
> nfs_mount_options, it actually works how I want it to work, as
> current mount does not complain that the option was provided twice.
> But it looks ugly. And I'm wondering - am I doing it wrong, or
> is there a problem with either cinder or nova (or both)?
This has gotten a bit more confusing than in necessary in Cinder due to
how the configuration for the NFS and related drivers has been tweaked
The method of putting a list of shares in the nfs_shares_config file is
effectively deprecated, but still works for now.
The preferred method now is to set the following options:
nas_host: server address
nas_share_path: export path
nas_mount_options: options for mounting the export
So whereas before the nfs_shares_config file would have:
127.0.0.1:/srv/nfs1 -o nfsvers=3
This would now translate to:
nas_mount_options = -o nfsvers=3
I believe if you try configuring the driver this way, you will get the
The goal was to remove the nfs_shares_config config method, but this
hasn't happened yet -- I/we need to revisit this area and see about
>  https://docs.openstack.org/admin-guide/blockstorage-nfs-backend.html
More information about the OpenStack-dev