128 Commits

Author SHA1 Message Date
Hengqing Hu
bbf46b45cd Remove trailing whitespaces in regular file
Change-Id: I0d015501492902ddf7fda20e0381fc21fbcaeb91
2012-03-03 12:10:46 +08:00
Jesse Andrews
c6a626e243 add git commit date / sha1 to sphinx html docs
Change-Id: I9f92a459fbf83bb42ff2fa31c2fb9c09372c8138
2012-03-02 16:03:22 -08:00
Stuart McLaren
8d46288e9c Allow region selection when using V2 keystone
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
2012-03-01 12:05:59 +00:00
Jenkins
44461b41f4 Merge "Support new image copied from external storage." 2012-02-22 19:02:02 +00:00
Brian Waldon
c0bce060b8 Correct kernel/ramdisk example in docs
* Fixes bug 937260

Change-Id: I43ea7d5c1434cc9e1454f6915e2b76586383bb89
2012-02-22 10:16:11 -08:00
Eoghan Glynn
c83bce1ce6 Support new image copied from external storage.
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
2012-02-22 18:03:48 +00:00
Eoghan Glynn
62c913c3ad Require container & disk formats on image create
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
2012-02-20 18:06:51 +00:00
Stuart McLaren
0f0fe2ba1b New -k/--insecure command line option
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
2012-02-13 13:57:13 +00:00
Russell Bryant
2fa1ed0da1 Implement blueprint add-qpid-support.
This patch implements a new notification strategy that sends
notifications to a message queue via Qpid.

Change-Id: Ie2640139dcf735e428af63e9e87b3667a2b22eb5
2012-02-10 15:36:13 -05:00
Eoghan Glynn
804396204e Respawn glance services on unexpected death.
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
2012-02-08 09:41:11 +00:00
Eoghan Glynn
132c54f173 Add --capture-output option to glance-control.
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
2012-02-02 22:57:28 +00:00
Rick Harris
7c2e32511a Typofix is_publi -> is_public
Change-Id: I58d6de4387c7915acf1fc139ef9a0ad81bf64a91
2012-02-02 19:28:43 +00:00
Jay Pipes
180ae8964d Adds documentation for policy files.
Implements interim-glance-authz-service

Change-Id: Ifefa4174aa45a29fd58ab40c74b5eaf6fecb4f83
2012-01-24 21:19:26 -05:00
Eoghan Glynn
6cac288a87 More flexible specification of auth credentials.
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
2012-01-24 17:45:41 +00:00
Stuart McLaren
e893b248a2 Multi-process Glance API server support.
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
2012-01-19 09:45:21 -08:00
Eoghan Glynn
097ced8cb2 Make paste.ini file location configurable.
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
2012-01-17 12:00:51 +00:00
Eoghan Glynn
5835b30cc2 Avoid the need for users to manually edit PasteDeploy config in order to switch pipelines.
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
2012-01-17 12:00:33 +00:00
Eoghan Glynn
14593a3b96 Split out paste deployment config from the core glance
*.conf files into corresponding *-paste.ini files.

Fixes LP #815208

Change-Id: I5acb8488cc25bb3c7dd735c8c2b0fe62fcea8e5e
2012-01-17 11:40:26 +00:00
Chris Behrens
195e6670c4 Implement retries in notify_kombu
Fixes bug 915817

Copies code from nova and includes improvements pending for nova as well

Change-Id: Ib596f4bacc5f58c4507f4111cdfac273029018bc
2012-01-12 23:49:41 -08:00
Alex Meade
e2f9d15e4c Add notifications for sending an image
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
2012-01-10 19:47:22 +00:00
Jenkins
e4bd841b6d Merge "Bug #909533: Swift uploads through Glance using ridiculously small chunks" 2012-01-09 22:26:08 +00:00
Jenkins
85a91606b1 Merge "Remove doc/Makefile." 2012-01-09 22:21:58 +00:00
Ewan Mellor
48449171a7 Bug #909533: Swift uploads through Glance using ridiculously small chunks
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
2012-01-06 19:44:49 -05:00
Pete Zaitcev
1cff8250c6 Add Fedora clauses to the installing document.
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
2012-01-05 15:39:55 -07:00
Russell Bryant
422c1e4aa9 Remove doc/Makefile.
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
2012-01-05 08:54:16 -05:00
Russell Bryant
58532a4373 Add more man pages.
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
2012-01-03 19:23:44 -05:00
Johannes Erdfelt
fa1b0b1f78 Synchronize notification queue setup between nova and glance
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
2011-12-29 00:03:19 +00:00
Mark McLoughlin
ba44d1c384 Add generic PasteDeploy app and filter factories
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
2011-12-07 12:42:03 +00:00
Stuart McLaren
d3e57489d8 Fix for bug 900258 -- add documentation for '--url' glance cli option.
Change-Id: If6e72c159209c073a4941b90c4a31fa054c84cd2
2011-12-05 12:24:25 +00:00
Lorin Hochstein
6bf61e8ce1 Added some examples for "glance add"
Fixed some warnings.

Change-Id: I9658c7458f3073b4bab93d0105d6ba174a4d0ca1
2011-11-29 13:10:50 -05:00
Jenkins
0be6359d28 Merge "Bug#894027: use correct module when building docs" 2011-11-28 03:47:41 +00:00
Jenkins
bf2b9d01b3 Merge "Fixes LP Bug#837817 - bin/glance cache disabled" 2011-11-23 17:08:17 +00:00
Pádraig Brady
03372c77aa Bug#894027: use correct module when building docs
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
2011-11-23 15:24:52 +00:00
Paul Bourke
49d67bd505 Adds option to set custom data buffer dir
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
2011-11-22 17:08:32 +00:00
Jay Pipes
8878046089 Fixes LP Bug#837817 - bin/glance cache disabled
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
2011-11-15 07:02:02 -05:00
Rick Harris
94dcf3acd0 Using Keystone's new port number 35357.
Fixes bug 888753

Change-Id: I22894a31ee54edd6d00ac3458ea4a2f8842aa4a0
2011-11-10 23:33:45 +00:00
Jay Pipes
2a5a0e9a35 Fixes LP Bug#878411 - No docs for image cache
Adds documentation on managing the image cache

Adds a simple CLI program to queue an image for
caching.

Change-Id: I2b4c9708c521fdcfaf1c6b8f07505e130923c4b7
2011-11-09 13:40:49 -05:00
Jay Pipes
2418efd7b7 Fixes LP Bug#882185 - Document Swift HTTPS default
Documentation should mention Swift auth address
HTTPS by default.

Change-Id: Ibe0fc1c3590961eb4e025a2fc86b54ac82d9d63d
2011-11-01 12:32:53 -04:00
Jay Pipes
dcc884708a Fixes LP Bug#884297 - Install docs should have git
Updated installation docs to reference Git, not Bzr/LP

Change-Id: I166e10efafd8d0941e5239671668841e863718e9
2011-11-01 12:30:14 -04:00
Brian Waldon
ceab6b3ed4 Convert image id value to a uuid
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
2011-10-26 21:16:12 -04:00
Jay Pipes
39c8557434 Adds Driver Layer to Image Cache
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
2011-10-25 12:54:31 -04:00
Jay Pipes
ad9e9ca3f7 Overhauls the image cache to be truly optional
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
2011-10-19 16:35:35 -04:00
Jenkins
d3a31b372e Merge "Adds SSL configuration params to the client" 2011-10-18 14:48:01 +00:00
Kevin L. Mitchell
5b27c663b9 Better document using Glance with Keystone.
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
2011-10-13 17:03:39 +00:00
Jay Pipes
eec5c1afa1 Adds SSL configuration params to the client
* 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
2011-10-11 16:40:06 -04:00
Josh Durgin
42300518ea Add RBD store backend.
To use this you'll need the latest version of Ceph from git,
which will become version 0.37.

Change-Id: Ia2126395525759eb8c11df055bdc6f286dea97b9
2011-09-29 13:54:19 -07:00
Rick Harris
e7d06e409e Documenting nova_to_os_env.sh tool
Change-Id: I4a416e01e4333b43a75944ace01e8b0abe3ec2a3
2011-09-20 18:06:48 -05:00
Alex Meade
20b7c69758 Added min_disk and min_ram properties to images
Fixes LP Bug#849368

Change-Id: I3e17370537144d117d99af5fa5a21df830b7c7ed
2011-09-20 14:43:35 -04:00
Jay Pipes
e7ec4a1d02 Fixes LP Bug#755916 - Location field shows creds
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
2011-09-19 14:42:11 -04:00
Brian Waldon
ee8c8ba8f5 Updating image status docs
Fixes lp bug#844932

Change-Id: Iee4571a2ebdd295f4324e02cde65a96fb53aceb9
2011-09-12 20:50:47 -04:00