Bug 985825

Summary: [glance.store] Don't enable all store drivers by default
Product: Red Hat OpenStack Reporter: Pádraig Brady <pbrady>
Component: openstack-glanceAssignee: Flavio Percoco <fpercoco>
Status: CLOSED ERRATA QA Contact: Dafna Ron <dron>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 4.0CC: adahms, apevec, eglynn, fpercoco, lhh, mattt, scohen, tshefi, yeylon
Target Milestone: Upstream M3   
Target Release: 5.0 (RHEL 7)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-glance-2014.1-2.el7ost Doc Type: Bug Fix
Doc Text:
Previously, Glance would enable all stores by default, resulting in certain stores printing errors unless manually configured. This update restricts the stores enabled by default, only enabling those that work out of the box and leaving those that require manual configuration disabled unless explicity configured by users.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-08 15:31:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Glance api.log none

Description Pádraig Brady 2013-07-18 10:31:46 UTC
Currently glance seems to have separate notification mechanisms in
glance/notifier and glance/openstack/common/notifier
The former at least is cofigured through the notifier_strategy config option.
If however one sets that to rabbit, but default you'll get very confusing error messages. Nothing direct, nor even an import error message.

To support "rabbit", one needs to install
  python-kombu, python-anyjson, and python-amqplib

So perhaps we should hard depend on them?
Note python-nova depends on them and so will mask this issue
when clance and nova are on the same system.

Note python-kombu was removed as a glance hard dep in:
http://pkgs.fedoraproject.org/cgit/openstack-glance.git/commit/?id=a3de523df99

If we don't add a hard dep, then perhaps we could improve the error message presented in this case.

Comment 1 Ayal Baron 2013-08-27 09:17:14 UTC
John, any input on this?

Comment 2 John Bresnahan 2013-08-27 23:02:13 UTC
I think we should certainly improve the error message.  kombu and anyjson are both in the requirements.txt file of Glance, so I think that the rpm should depend on them (amqplib is not in there).

In general I do not like how Glance handles plugins and dependencies.  It seems to me that if the base distribution has options like 'rabbit_host' that when installed such features should work.

Comment 3 Alan Pevec 2013-08-29 08:53:58 UTC
(In reply to John Bresnahan from comment #2)
> kombu and anyjson
> are both in the requirements.txt file of Glance, so I think that the rpm
> should depend on them (amqplib is not in there).

I wouldn't follow requirements blindly, in this case this is really a soft dep and should be handled gracefully i.e. try_import with the appropriate message when notifier config option is set.

Comment 5 Alan Pevec 2013-10-01 07:27:41 UTC
There are more issues related to soft deps on Glance startup, here's api.log from a smoketest again default Packstack allinone installation, which should be all defaults in glance config except notifier_strategy which is set to qpid:

ERROR glance.store.sheepdog [-] Error in store configuration: Unexpected error while running command.
Command: collie
Exit code: 127
Stdout: ''
Stderr: '/bin/sh: collie: command not found\n'
WARNING glance.store.base [-] Failed to configure store correctly: Store sheepdog could not be configured correctly. Reason: Error in store configuration: Unexpected error while running command.
Command: collie
Exit code: 127
Stdout: ''
Stderr: '/bin/sh: collie: command not found\n' Disabling add method.
WARNING glance.store.base [-] Failed to configure store correctly: Store cinder could not be configured correctly. Reason: Cinder storage requires a context. Disabling add method.
CRITICAL glance [-] 'glance.notifier.notify_qpid.QpidStrategy' is not an available notifier strategy.

BTW ^^^ qpid failed 1st time, but on 2nd run it worked, is that dependency issue with puppet-qpid?

Comment 6 Alan Pevec 2013-10-01 07:32:52 UTC
re. sheepdog and cinder store errors: Glance tries to configure all stores listed in known_stores config parameter and by default that's all of them:
#               glance.store.filesystem.Store,
#               glance.store.http.Store,
#               glance.store.rbd.Store,
#               glance.store.s3.Store,
#               glance.store.swift.Store,
#               glance.store.sheepdog.Store,
#               glance.store.cinder.Store,

This should be restricted in glance-api-dist.conf to avoid above errors on startup.

Comment 7 Flavio Percoco 2013-10-01 09:40:05 UTC
Agreed, stores should be restricted in glance-api-dist.conf. As for the notification code, it'll be aligned with Oslo's during Icehouse.

Comment 8 Pádraig Brady 2013-10-01 10:25:30 UTC
So there are 3 things in this bug:

1. improve warnings with "rabbit" selected but dependent packages not installed
2. Set an appropriate default list of "known_stores"
3. Fix the qpid "notifier_strategy" strategy.

2 and 3 are tracked at bug 1006783

Comment 9 Flavio Percoco 2014-01-03 09:35:37 UTC
Small update:

The list of known_stores will be limited in glance itself[0]. The default stores will be file / http, which don't require any configuration.

[0] https://review.openstack.org/#/c/59150/

Comment 10 Flavio Percoco 2014-01-15 12:45:05 UTC
Glance no longer implements its own notifier. It now relies on oslo.messaging

Comment 13 Flavio Percoco 2014-03-11 14:22:30 UTC
The patch was merged upstream. Only the filesystem store and the http store are enabled by default. All other stores will need to be enabled explicitly.

Comment 14 Tzach Shefi 2014-06-12 13:18:56 UTC
Verified on:
RHEL7
python-glance-2014.1-4.el7ost.noarch
python-glanceclient-0.12.0-1.el7ost.noarch
openstack-glance-2014.1-4.el7ost.noarch

1. Installed deployment
2. Enabled log
3. Restarted Glance service
4. Checked log no mention of start up errors for none default store. Only http and filesystem stores enabled by default.

Comment 15 Tzach Shefi 2014-06-12 13:19:25 UTC
Created attachment 908127 [details]
Glance api.log

Comment 18 errata-xmlrpc 2014-07-08 15:31:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2014-0851.html

Comment 19 Andrew Dahms 2017-08-28 22:59:25 UTC
Cancelling old needinfo request.