Hi Andy,
Yes it probably does not matter if the variables are visible in other
containers (you get a working system up and running anyway) but it is
not the expected behavior when using limit_container_types. I did manage
to get the variables limited to cinder_volume containers when I typed
the configuration like this:
XxX:
ip: 172.22.5.9
container_vars:
cinder_storage_availability_zone: cinderAZ_1
cinder_default_availability_zone: cinderAZ_1
cinder_backends:
limit_container_types: cinder_volume
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:
limit_container_types: cinder_volume
nfs_shares_config: /etc/cinder/nfs_shares
shares:
- ip: "172.22.20.254"
share: "/nfs/cinder/production"
However, I did not find any way to limit the glance nfs configuration to
only the glance containers. It looks like this in
openstack_user_config.yml.prod.example:
image_hosts:
infra1:
ip: 172.29.236.11
container_vars:
limit_container_types: glance
glance_nfs_client:
- server: "172.29.244.15"
remote_path: "/images"
local_path: "/var/lib/glance/images"
type: "nfs"
options: "_netdev,auto"
My workaround to the problem was to add the glance configuration to
user_variables.yml instead, that way you don't get the inventory full
with glance configuration on all containers. This is what I added to
user_variables.yml:
glance_nfs_client:
- server: "172.22.20.254"
remote_path: "/nfs/glance/production"
local_path: "/var/lib/glance/images"
type: "nfs"
options:
"_netdev,auto,rw,intr,noatime,async,vers=3,proto=tcp,wsize=1048576,rsize=1048576,timeo=1200,actimeo=120"
So it sounds like you are aware of the problem and are working on a fix,
that is great.
Thank you all for a very good work with openstack-ansible.
Regards,
Andreas
On 02/03/2017 05:27 PM, Andy McCrae wrote:
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.val...@it.uu.se
<mailto:andreas.val...@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.pro
<http://openstack_user_config.yml.pro>d.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@lists.openstack.org
<mailto:OpenStack-operators@lists.openstack.org>
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
<http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators>
_______________________________________________
OpenStack-operators mailing list
OpenStack-operators@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators