Glance api deployed only on a single controller on multi-controller deployment [kolla]

Sean Mooney smooney at redhat.com
Fri Dec 30 16:17:31 UTC 2022


On Mon, 2022-12-19 at 22:29 +0530, pradeep wrote:
> Hi,
> 
> Sorry to hijack this thread. I have a similar issue. I have used netapp NAS
> share, mounted in all the 3 controllers as /glanceimages and modified
> glance_file_datadir_volume:/glanceimages in globals.yml. I have tried
> deploy and reconfigure commands but was unlucky. It doesn't deploy
> glance-api containers in controller2 and 3. Please let me know if you
> succeed in this.
looking at the glance-api group it is defiend as the childeren of the glance group
https://github.com/openstack/kolla-ansible/blob/master/ansible/inventory/multinode#L263-L264
[glance-api:children]
glance

which in trun is defiend as the  childern of the controler group
https://github.com/openstack/kolla-ansible/blob/master/ansible/inventory/multinode#L114-L115
[glance:children]
control

looking breifly at the glance role
the api will be deployed if its enabled and the current host is in the relevent group
https://github.com/openstack/kolla-ansible/blob/master/ansible/roles/glance/tasks/check-containers.yml#L15-L16
host_in_group is defiend here
https://github.com/openstack/kolla-ansible/blob/master/ansible/roles/glance/defaults/main.yml#L6
host_in_groups: "{{ inventory_hostname in glance_api_hosts }}"
glance_api_hosts is defined here
https://github.com/openstack/kolla-ansible/blob/ae3de342e48bc4293564a3b532a66bfbf1326c0d/ansible/group_vars/all.yml#L903
glance_api_hosts: "{{ [groups['glance-api'] | first] if glance_backend_file | bool and glance_file_datadir_volume == 'glance' else groups['glance-
api'] }}"

so that is what is making it only work with the first host.

with that said you have set glance_file_datadir_volume:/glanceimages  in the globals.yaml so that should have also caused the else banch to be taken.

i have not worked on kolla-ansible for 5+ years at this point but it looks like the ablity to use multiple api instance
was modifed by https://github.com/openstack/kolla-ansible/commit/d57c7019a92f498f8dd876f4daea9051801f856c
for https://bugs.launchpad.net/kolla-ansible/+bug/1722422 but that simply moved where that variable was defined 

the actual behavior change was intoduced by https://github.com/openstack/kolla-ansible/commit/4fde486dc8b29b8d087ab4bfff0e626b2479abd2
for https://bugs.launchpad.net/kolla-ansible/+bug/1681301

the intent of that change was not to prevent you runnign multipel glance api servers but just to ensure that by default only one
instance was deployed in a multinode config.

global.yaml is passed with -e to ansible by kolla-ansible so defining "glance_file_datadir_volume:/glanceimages" should have been enough
to enable multiple glance instnaces to be deployed.

so it sounds like you did everything correctly but perhaps the kolla-ansible team can point you in the right direction.
at first glance

you could try defining 
glance_api_hosts: [groups['glance-api']] 
in the global.yaml

but that should not be required if you have glance_file_datadir_volume defined to a non default value.


> 
> Regards
> Pradeep
> 
> On Mon, 19 Dec 2022 at 14:49, A Monster <amonster369 at gmail.com> wrote:
> 
> > Thank you for the clarification.
> > So in order to deploy glance on multiple nodes, I need to first set up an
> > NFS storage then specify the shared path either by overriding the content
> > of ansible/group_vars/all.yml or by adding
> > glance_file_datadir_volume:NFS_PATH in globals.yml ?
> > Which NFS tool do you think I should use?
> > Thank you again. Regards
> > 
> > On Thu, 21 Jul 2022 at 10:42, Pierre Riteau <pierre at stackhpc.com> wrote:
> > 
> > > With the default backend (file), Glance is deployed on a single
> > > controller, because it uses a local Docker volume to store Glance images.
> > > This is explained in the documentation [1]: "By default when using file
> > > backend only one glance-api container can be running". See also the
> > > definition of glance_api_hosts in ansible/group_vars/all.yml.
> > > 
> > > If you set glance_file_datadir_volume to a non-default path, it
> > > is assumed to be on shared storage and kolla-ansible will automatically use
> > > all glance-api group members.
> > > 
> > > You can also switch to another backend such as Ceph or Swift.
> > > 
> > > [1]
> > > https://docs.openstack.org/kolla-ansible/latest/reference/shared-services/glance-guide.html
> > > 
> > > On Thu, 21 Jul 2022 at 10:57, A Monster <amonster369 at gmail.com> wrote:
> > > 
> > > > I've deployed openstack xena using kolla ansible on a centos 8 stream
> > > > cluster, using two controller nodes, however I found out after the
> > > > deployment that glance api is not available in one node, I tried
> > > > redeploying but  I got the same behavior, although the deployment finished
> > > > without displaying any error.
> > > > 
> > > > Thank you. Regards
> > > > 
> > > 
> 




More information about the openstack-discuss mailing list