Bug 985825 - [glance.store] Don't enable all store drivers by default
[glance.store] Don't enable all store drivers by default
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-glance (Show other bugs)
Unspecified Unspecified
medium Severity unspecified
: Upstream M3
: 5.0 (RHEL 7)
Assigned To: Flavio Percoco
Dafna Ron
Depends On:
  Show dependency treegraph
Reported: 2013-07-18 06:31 EDT by Pádraig Brady
Modified: 2017-08-28 18:59 EDT (History)
9 users (show)

See Also:
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:
Last Closed: 2014-07-08 11:31:32 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Glance api.log (98.38 KB, text/plain)
2014-06-12 09:19 EDT, Tzach Shefi
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
OpenStack gerrit 59150 None None None Never

  None (edit)
Description Pádraig Brady 2013-07-18 06:31:46 EDT
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:

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 05:17:14 EDT
John, any input on this?
Comment 2 John Bresnahan 2013-08-27 19:02:13 EDT
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 04:53:58 EDT
(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 03:27:41 EDT
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 03:32:52 EDT
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 05:40:05 EDT
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 06:25:30 EDT
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 04:35:37 EST
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 07:45:05 EST
Glance no longer implements its own notifier. It now relies on oslo.messaging
Comment 13 Flavio Percoco 2014-03-11 10:22:30 EDT
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 09:18:56 EDT
Verified on:

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 09:19:25 EDT
Created attachment 908127 [details]
Glance api.log
Comment 18 errata-xmlrpc 2014-07-08 11:31:32 EDT
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.

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

Note You need to log in before you can comment on or make changes to this bug.