When using glance_nfs_client config, the nfs store will fail to mount to the local_path variable if it is equal to "/var/lib/glance/images".
TASK: [os_glance | Create nfs shares local path] ******************************
ok: [568575-infra01_glance_container-abedf963] => (item={'local_path': '/var/lib/glance/images', 'type': 'nfs', 'options': '_netdev,auto', 'remote_path': '/glancefs0/', 'server': '172.29.244.24'})
ok: [569038-infra03_glance_container-b53f1ebd] => (item={'local_path': '/var/lib/glance/images', 'type': 'nfs', 'options': '_netdev,auto', 'remote_path': '/glancefs0/', 'server': '172.29.244.24'})
ok: [569037-infra02_glance_container-a7d423c5] => (item={'local_path': '/var/lib/glance/images', 'type': 'nfs', 'options': '_netdev,auto', 'remote_path': '/glancefs0/', 'server': '172.29.244.24'})
TASK: [os_glance | Glance mount nfs] ******************************************
failed: [568575-infra01_glance_container-abedf963] => (item={'local_path': '/var/lib/glance/images', 'type': 'nfs', 'options': '_netdev,auto', 'remote_path': '/glancefs0/', 'server': '172.29.244.24'}) => {"failed": true, "item": {"local_path": "/var/lib/glance/images", "options": "_netdev,auto", "remote_path": "/glancefs0/", "server": "172.29.244.24", "type": "nfs"}}
msg: Error mounting /var/lib/glance/images:
failed: [569037-infra02_glance_container-a7d423c5] => (item={'local_path': '/var/lib/glance/images', 'type': 'nfs', 'options': '_netdev,auto', 'remote_path': '/glancefs0/', 'server': '172.29.244.24'}) => {"failed": true, "item": {"local_path": "/var/lib/glance/images", "options": "_netdev,auto", "remote_path": "/glancefs0/", "server": "172.29.244.24", "type": "nfs"}}
msg: Error mounting /var/lib/glance/images:
failed: [569038-infra03_glance_container-b53f1ebd] => (item={'local_path': '/var/lib/glance/images', 'type': 'nfs', 'options': '_netdev,auto', 'remote_path': '/glancefs0/', 'server': '172.29.244.24'}) => {"failed": true, "item": {"local_path": "/var/lib/glance/images", "options": "_netdev,auto", "remote_path": "/glancefs0/", "server": "172.29.244.24", "type": "nfs"}}
msg: Error mounting /var/lib/glance/images:
FATAL: all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/root/os-glance-install.retry
568575-infra01_glance_container-abedf963 : ok=40 changed=29 unreachable=0 failed=1
569037-infra02_glance_container-a7d423c5 : ok=40 changed=29 unreachable=0 failed=1
569038-infra03_glance_container-b53f1ebd : ok=40 changed=28 unreachable=0 failed=1
I believe this is due to the fact that when the glance_store user_variable is set to file, "/var/lib/glance/images" is bind mounted to the physical host before the nfs task is run, causing the mount issue.
lxc.mount.entry = /openstack/568575-infra01_glance_container-abedf963 var/lib/glance/images none bind 0 0
If you set the local_path variable to any other point, the plays pass, but the cinder-api.conf still has /var/lib/glance/images as the datadir for glance images.
glance_nfs_client:
- server: "172.29.244.24" ## Hostname or IP address of NFS Server
remote_path: "/glancefs0/" ## Remote path from the NFS server's export
local_path: "/var/lib/glance/nfs_images" ## Local path on machine
type: "nfs" ## This can be nfs or nfs4
options: "_netdev,auto" ## Mount options
TASK: [os_glance | Create nfs shares local path] ******************************
changed: [568575-infra01_glance_container-abedf963] => (item={'local_path': '/var/lib/glance/nfs_images', 'type': 'nfs', 'options': '_netdev,auto', 'remote_path': '/glancefs0/', 'server': '172.29.244.24'})
changed: [569038-infra03_glance_container-b53f1ebd] => (item={'local_path': '/var/lib/glance/nfs_images', 'type': 'nfs', 'options': '_netdev,auto', 'remote_path': '/glancefs0/', 'server': '172.29.244.24'})
changed: [569037-infra02_glance_container-a7d423c5] => (item={'local_path': '/var/lib/glance/nfs_images', 'type': 'nfs', 'options': '_netdev,auto', 'remote_path': '/glancefs0/', 'server': '172.29.244.24'})
TASK: [os_glance | Glance mount nfs] ******************************************
changed: [568575-infra01_glance_container-abedf963] => (item={'local_path': '/var/lib/glance/nfs_images', 'type': 'nfs', 'options': '_netdev,auto', 'remote_path': '/glancefs0/', 'server': '172.29.244.24'})
changed: [569037-infra02_glance_container-a7d423c5] => (item={'local_path': '/var/lib/glance/nfs_images', 'type': 'nfs', 'options': '_netdev,auto', 'remote_path': '/glancefs0/', 'server': '172.29.244.24'})
changed: [569038-infra03_glance_container-b53f1ebd] => (item={'local_path': '/var/lib/glance/nfs_images', 'type': 'nfs', 'options': '_netdev,auto', 'remote_path': '/glancefs0/', 'server': '172.29.244.24'})
[glance_store]
default_store = file
stores = glance.store.filesystem.Store,glance.store.http.Store,glance.store.cinder.Store
filesystem_store_datadir = /var/lib/glance/images/
Fix proposed to branch: master /review. openstack. org/237058
Review: https:/