[Openstack-operators] [openstack-ansible] configuration to use nfs for glance and cinder

Andy McCrae andy.mccrae at gmail.com
Fri Feb 3 16:27:08 UTC 2017


Hi Andreas,

The way you're doing it at the end looks correct - the docs are not quite
right on that one.
The nfs_shares file will only get templated on the cinder_volumes hosts, as
will the nfs_shares_config option  - so in essence it shouldn't matter that
the var isn't limited to volume hosts.

That said, there is a bug here that we've been working to fix - this will
work if you have one backend.
Mainly it means there is no support for multiple backends, if one of them
is an NFS backend, and there is no support for multiple NFS backends.
A patch has gone in to allow multiple NFS backends (and change the way
they're configured) - but it's not quite ready for release - so we're
working on a subsequent fix that will then be a part of newton 14.0.8
release for OSA.

I'd be happy to keep you updated - if you'd like to drop into
#openstack-ansible on Freednode IRC there are a lot of active
operators/developers/deployers, we'd be happy to help further.

But barring that I'll try add a reminder to drop an update here once that's
working.

Andy


On 3 February 2017 at 08:56, Andreas Vallin <andreas.vallin at it.uu.se> wrote:

> Hi!
>
> I need to ask how do you correctly configure nfs to be used with
> openstack-ansible newton (14.0.6). I think it is great that there is an
> production example file that uses nfs for glance and cinder (
> openstack_user_config.yml.prod.example) but the cinder config is not
> working for me.
>
> I use this config for storage_hosts, only changing ip, and share from
> production example:
>
> storage_hosts:
>   XxXx:
>     ip: 172.22.5.9
>     container_vars:
>       cinder_backends:
>         limit_container_types: cinder_volume
>         cinder_nfs_client:
>           nfs_shares_config: /etc/cinder/nfs_shares
>           shares:
>             - ip: "172.22.20.254"
>               share: "/nfs/cinder/production"
>
> And this is the failure when running os-cinder-install.yml
>
> TASK [os_cinder : Add in cinder devices types]
> *********************************
> fatal: [XxXx_cinder_volumes_container-080139bd]: FAILED! => {"failed":
> true, "msg": "the field 'args' has an invalid value, which appears to
> include a variable that is undefined. The error was: 'dict object' has no
> attribute 'volume_backend_name'\n\nThe error appears to have been in
> '/etc/ansible/roles/os_cinder/tasks/cinder_backends.yml': line 30, column
> 3, but may\nbe elsewhere in the file depending on the exact syntax
> problem.\n\nThe offending line appears to be:\n\n\n- name: Add in cinder
> devices types\n  ^ here\n"}
>
> OK, so volume_backend_name is missing. The playbook runs if I add
> volume_backend_name to the config like this:
>
>
> storage_hosts:
>   XxXx:
>     ip: 172.22.5.9
>     container_vars:
>       cinder_backends:
>         limit_container_types: cinder_volume
>         cinder_nfs_client:
>           volume_backend_name: cinder_nfs
>           nfs_shares_config: /etc/cinder/nfs_shares
>           shares:
>             - ip: "172.22.20.254"
>               share: "/nfs/cinder/production"
>
>
> But now there is no /etc/cinder/nfs_shares file in the
> cinder-volumes-container so the nfs share will not be mounted. This is
> because the "Create nfs shares export file" task in cinder_post_install.yml
> doesn't see that cinder_nfs_client is defined. You also get this in
> cinder.conf:
>
> enabled_backends=cinder_nfs_client
> # All given backend(s)
> [cinder_nfs_client]
> volume_backend_name=cinder_nfs
> nfs_shares_config=/etc/cinder/nfs_shares
> shares=[{u'ip': u'172.22.20.254', u'share': u'/nfs/cinder/production'}]
>
>
> This configuration works for me:
>
> storage_hosts:
>   XxXx:
>     ip: 172.22.5.9
>     container_vars:
>       cinder_storage_availability_zone: cinderAZ_1
>       cinder_default_availability_zone: cinderAZ_1
>       limit_container_types: cinder_volume
>       cinder_backends:
>         cinder_nfs:
>           volume_backend_name: cinder_nfs
>           volume_driver: cinder.volume.drivers.nfs.NfsDriver
>           nfs_mount_options: "_netdev,auto,rw,intr,noatime,
> async,vers=3,proto=tcp,wsize=1048576,rsize=1048576,timeo=1200,actimeo=120"
>       cinder_nfs_client:
>         nfs_shares_config: /etc/cinder/nfs_shares
>         shares:
>           - ip: "172.22.20.254"
>             share: "/nfs/cinder/production"
>
>
> BUT when I look in the inventory file (openstack_inventory.json) it
> doesn't look like this configuration is limited to cinder_volume containers
> even if "limit_container_types: cinder_volume" is used. So now I feel it is
> time to ask how a correct configuration should look like.
>
> Regards,
> Andreas
>
>
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-operators/attachments/20170203/93298c96/attachment.html>


More information about the OpenStack-operators mailing list