Fix for bug 936798. Allow a client to select which
region endpoint they want from the service catalogue.
The region can be set via the environment variable
OS_REGION_NAME or via the '-R/--region' command line
option.
If a single image endpoint is returned from keystone,
the client will use that even if no region was specified
(the default). Where multiple endpoints exist a region
must be provided.
Change-Id: I6797f8ddf88d5875caf194913082c3fe24c86585
Implements bp retrieve-image-from
Added support for a new header:
x-glance-api-copy-from: URI
where URI is a HTTP, S3, or Swift location that's accessible to the
glance API service. Where present, the image content is copied from
the external store to the backend store currently configured for
the glance API service.
Impedence between the representation returned by Store.get() and
the implicit requirements of Store.add() required careful iterator/
filelike wrapping.
Also rationalized the S3 and Swift functional test setup logic and
added a new decorator-based mechanism to allow a functional testcase
require multiple backend stores to be available and configured.
Change-Id: If783a09c273832b8926aabc60b7eba8b3ab956d6
Fixes lp 933702
For images created via the glance CLI, the container and disk formats
were previously defaulted if not explicitly set. However if created via
the python or REST APIs, these attributes were not defaulted if unset.
There is no real sensible default for these formats, so now an image
create fails with 400 "Bad Request" if the format metadata are missing.
Also we ensure unset image metadata are not reported in x-image-meta-*
headers in order to disambiguate None and empty string values.
Change-Id: I8189383f5f9adf42a8cdac7f8dc7e9327baf46da
Fix for bug 929591.
Change glance to require server certificate validation
by default when using https. The standard system
CA file will be used if available (and an alternative was not
provided).
The --insecure option can be used by clients to skip server
certificate validation if appropriate.
* This change will impact Nova clients accessing glance over https.
If the standard CA file is not suitable they will need to provide
a CA file or else create an 'insecure' glance client.
* Accesses to a https registry server must now perform server
certificate validation.
* If the package which provides the standard
system CA file is installed then that file will be used by default.
It probably makes sense for the glance package to have a
dependency on whichever package provides the default CA bundle.
(In Ubuntu this is 'ca-certificates')
Change-Id: I7c83361ba0881559ec77d4baf10dfeb5b8e32185
This patch implements a new notification strategy that sends
notifications to a message queue via Qpid.
Change-Id: Ie2640139dcf735e428af63e9e87b3667a2b22eb5
Fixes bug 923894
Add new '--respawn' option to cause glance services launched via
glance-control to be monitored for unexpected death and resuscitated
as necessary.
This option will cause glance-control itself to remain running.
Deliberately stopped services are not respawned, neither are rapidly
bouncing services (where process death occurred within one second
of the last launch).
Change-Id: I1a9a99cce9b6ad43274836e39ebe4f29c19455af
Fixes bug 923894
Previously all stdout/err from glance services was discarded
if launched via glance-control.
The --capture-output option allows such output to be instead
captured in the syslog.
Non-termination output should be flushed to ensure timely
arrival in /var/log/messages.
Change-Id: I5c11ad4b9f7f321a3d1cab71e34c2a6707ef1b5e
Fixes bug 853933
Add new --username|--password|--tenant|--auth_url|--auth_strategy
switches to bin/glance to allow the username, password, tenant name,
and authentication URL & strategy be specified on the command line.
Avoid needlessly falling back to keystone v2 auth after a successful:
GET /v1.0/tokens
returns with the X-Image-Management-Url or X-Glance header set,
as opposed to X-Server-Management-Url.
Extend the keystone functional test support to ensure that the URL
returned by keystone via the X-*-Url header contains the appropriate
dynamically allocated port for the glance API service.
Ensure the underlying $OS_* environment variables do not leak into the
TestPrivateImagesCli functional tests, also explicitly exercise both
noauth and keystone strategies.
Change-Id: Iee8bf3745d65a9c57a9da803d5cf9ae5f343a159
Implements blueprint multi-process-server. Allows several Glance API
worker processes to be started, which can increase performance on machines
with more than one CPU.
Change-Id: I1cbb48945fd23afd71de3a30b80836b590c023a1
Add an optional paste_deploy.config_file variable to identify
a non-default location for the paste.ini file (the default for
/path/to/component.conf is /path/to/component-paste.ini).
Change-Id: Ibd7aefe95706fb50e4e353c14eb6dab0f948331f
Define multiple pipelines in glace-api.conf to reflect the
various supported deployment flavors (minimal, with caching,
with cache management, with keystone-based auth etc.).
Add an optional paste_deploy.flavor config variable to allow the
user select the appropriate pipeline without having to edit the
paste config (i.e. uncommenting lines as before). For example
in glance-api.conf, a setting of:
[paste_deploy]
flavor = keystone+caching
identifies the following pipeline in glace-api-paste.ini:
[pipeline:glance-api-keystone+caching]
pipeline = versionnegotiation authtoken auth-context cache apiv1app
the advantage being that the user need not be concerned with
the precise sequence of filters required to realize the QoS
they desire.
Modify the functional tests that patch configuration (i.e. the
keystone and caching tests) to use the new deployment_flavor
mechanism.
Extend the TestConfigOpts to support option groups.
Change-Id: Ide843ada11bce115b7dc650440397853c6409b03
An image.send notification is to be sent to the notifier every time an image is
transmitted from glance. This can be used to track things such as bandwidth
usage.
Addresses bug 914440
Change-Id: If8b6504c4250fa6444d17d611de43d9704ca9aae
Remove the use of a temporary disk buffer when streaming to Swift. This
was added on the assumption that it was not possible to stream chunks to
Swift direct from webob.Request.body_file. That's not true -- a simple
file-like object wrapping body_file does the job perfectly.
This removes the need for swift_store_object_buffer_dir in the config file.
It is also significantly cheaper, since there is one copy fewer.
Fix the parsing of the swift_store_large_object_size and
swift_store_large_object_chunk_size options. These are
specified in MB in the config file, but needs to be in bytes internally,
because they are compared against the image_size parameter given to add().
Update the unit tests to match. This includes an additional check that
put_object is called the correct number of times. The unit tests missed the
latter problem problem because there was no check that a small object is only
uploaded in one chunk, and despite the comment to the contrary there was no
check that the right number of chunks were written in the large-object case
either. Added these in all places where store.add is called.
Change-Id: Ieb4cf68516b53bd16d2671e49e805b26118b3671
This change resolves 2 Fedora-related todo items in installing.rst.
It also cleans up a bit:
- fixes weird grammar
- fixes improper list numbering
- uses proper name for Red Hat, where space is necessary
- replaces A/B syntax with A, B
This is my first commit and I am adding myself to Authors file
on a suggestion by Brian Waldon.
Change-Id: I398ae8150d7912e0b61375a7bdc5aab1101f34bc
Use "python setup.py build_sphinx" instead. There are some things that
the Makefile did that setup.py does not do, but they will be easy enough
to add later if anyone misses them.
Change-Id: I430dcc027bac207af515fb7d927500db18320ba5
A few man pages were already in place. This patch uses the --help
output from each executable to seed a man page for the rest of the
executables, which include:
- glance
- glance-cache-cleaner
- glance-cache-manage
- glance-cache-prefetcher
- glance-cache-pruner
- glance-cache-queue-image
- glance-control
- glance-scrubber
Fixes bug 911291.
Change-Id: Ie0de990ff6617e7eb953f270a089c99bc340b4fe
Fixes bug 901376
Glance used a SimpleQueue which would end up with a direct queue with an
exchange named the same as the queue. This was different than Nova, which
uses a topic queue with an exchange named 'nova'.
This change makes Glance use a topic queue with a configurable exchange
name to match Nova.
Change-Id: Ia014e4c00060abc2345289a54e45bbfdc6b7e8e5
These generic factories allow us to dump the copied and pasted
app_factory and filter_factory methods in the codebase.
The main difference is the paste configuration changes from:
[app:apiv1app]
paste.app_factory = glance.api.v1:app_factory
...
[filter:cache]
paste.filter_factory = glance.api.middleware.cache:filter_factory
to this:
[app:apiv1app]
paste.app_factory = glance.common.wsgi:app_factory
glance.app_factory = glance.api.v1:API
...
[filter:cache]
paste.filter_factory = glance.common.wsgi:filter_factory
glance.filter_factory = glance.api.middleware.cache:CacheFilter
Apart from reducing code duplication, this will also allow us to have
the generic factories inject other data into the apps and filters.
Change-Id: I1d2be5630ab61d29b8948ff88d58e6e1b11c2e5f
Currently the wrong directory is searched for the
glance module, requiring glance to be installed
in the default system path, for docs to be buildable.
Also the path was appended, so the default system version
which may be completely different is referenced.
This ensures that only local glance files are referenced.
Change-Id: Ia226c90bbd24d7804401a7c9e444387c78a0f542
Implements blueprint custom-disk-buffer
When pushing an image large enough to be chunked into either a Swift
or S3 backend, the chunks are buffered to /tmp.
This change allows a user to define an alternate directory via the
configuration files.
Change-Id: I2660b6e5a76cbfd43834384b129550b66bb9afce
This patch removes the cache management commands
from the main bin/glance client and puts them in
a bin/glance-cache-manage program. It also adds
a number of cache management calls to manage the
cache queue via the HTTP API.
The reason I moved the cache management commands
into a separate utility is that I'm thinking towards
the future, where we have a separate admin API, and
having a separate management utility seemed like the
best way to go.
Change-Id: Ic916a72f39516a06be27ea6c8ef69eb9e1a70936
Adds documentation on managing the image cache
Adds a simple CLI program to queue an image for
caching.
Change-Id: I2b4c9708c521fdcfaf1c6b8f07505e130923c4b7
This just changes the value of image.id, leaving the key name alone. We also
enforce image ids provided on an image create be a uuid. Implements
blueprint uuid-image-identifiers
Change-Id: I22ba69550ccbc04a24d680748d60414d2d0f1a99
Fixes LP Bug#879136 - keyerror: 'image' when doing nova image-list
Fixes LP Bug#819936 - New image cache breaks Glance on Windows
This patch refactors the image cache further by adding an
adaptable driver layer to the cache. The existing filesystem-based
driver that depended on python-xattr and conditional fstab support
has been moved to /glance/image_cache/drivers/xattr.py, and a new
default driver is now based on SQLite and has no special requirements.
The image cache now contains a simple interface for pruning the
cache. Instead of the logic being contained in
/glance/image_cache/pruner.py, now the prune logic is self-contained
within the ImageCache.prune() method, with pruning calling the
simple well-defined driver methods of get_least_recently_accessed()
and get_cache_size().
Adds a functional test case for the caching middleware and adds
documentation on how to configure the image cache drivers.
TODO: cache-manage middleware...
TODO: cache management docs
Change-Id: Id7ae73549d6bb39222eb7ac0427b0083fd1af3ec
Fixes LP Bug#874580 - keyerror 'location' when fetch errors
Fixes LP Bug#817570 - Make new image cache a true extension
Fixes LP Bug#872372 - Image cache has virtually no unit test coverage
* Adds unit tests for the image cache (coverage goes from 26% to 100%)
* Removes caching logic from the images controller and places it into
a removeable transparent caching middleware
* Adds a functional test case that verifies caching of an image
and subsequent cache hits
* Removes the image_cache_enabled configuration variable, since it's
now enabled by simply including the cache in the application
pipeline
* Adds a singular glance-cache.conf to etc/ that replaces the
multiple glance-pruner.conf, glance-reaper.conf and
glance-prefetcher.conf files
* Adds documentation on enabling and configuring the image cache
TODO: Add documentation on the image cache utilities, like reaper,
prefetcher, etc.
Change-Id: I58845871deee26f81ffabe1750adc472ce5b3797
Addresses bug 871803 by expounding on what configuration should
look like. Also fixes the example config files, which generally
had the authentication setup completely wrong.
Change-Id: I44b2b8bd340ca95b5a2c2e9408797b0308000a65
* Adds SSL configuration params to all client classes
* Adds unit test for bad SSL client configuration
* Refactors the registry methods to no longer need
configuration options passed, and to configure the
registry client once, on images.Controller.__init__
* Adds glance-api.conf options for SSL support in
registry client connections.
* Adds SSL CA file socket wrappers via a client auth
HTTPS connection class
* Adds server SSL support, but not functional tests
for SSL support yet. Still need to research self-signed
cert generation for tests...
* Updates documentation for bind and startup options
* Adds functional test case for secure communication
with API server stood up with SSL supprt. Note it is
not very DRY. There is some DRY cleanup to do in the
future...
TODO: Integrate options with bin/glance CLI tool
Change-Id: Ie9fcd36337cc93fd5beeabb9186ad5e93ae2a0f0
Removes the Location field from the return of the
API server's GET /images/detail and GET /images/<ID>
calls. The Registry server API was unchanged, as the API
server needs to call the Registry server in order to
find location information...
Change-Id: I914456ad3879f19fa0b55c8a89b8217c193193d8