| Summary: | [RFE][glance]: Adding image location selection strategy | |||
|---|---|---|---|---|
| Product: | Red Hat OpenStack | Reporter: | RHOS Integration <rhos-integ> | |
| Component: | openstack-glance | Assignee: | Flavio Percoco <fpercoco> | |
| Status: | CLOSED ERRATA | QA Contact: | Tzach Shefi <tshefi> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | urgent | |||
| Version: | unspecified | CC: | adahms, dnavale, dron, eglynn, fpercoco, markmc, scohen, tshefi, yeylon | |
| Target Milestone: | Upstream M3 | Keywords: | FutureFeature, Triaged | |
| Target Release: | 5.0 (RHEL 7) | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| URL: | https://blueprints.launchpad.net/glance/+spec/image-location-selection-strategy | |||
| Whiteboard: | upstream_milestone_icehouse-3 upstream_status_implemented upstream_definition_approved | |||
| Fixed In Version: | openstack-glance-2014.1-2.el7ost | Doc Type: | Enhancement | |
| Doc Text: |
Multi-location support allows Glance to store locations pointing to copies of the same image data stored in different places. Previously, this feature did not allow Glance to choose the store from which to download an image. This update adds two strategies for selecting the location to send back to the client - the location from which to download the image. The two strategies are:
1. Location order: A simple round-robin that goes through all the available locations in order - as they were inserted.
2. Store type: Allows users to specify store preferences. A possible combination is: `http, file`. This tells Glance to try to download images from HTTP stores before downloading them from file stores.
|
Story Points: | --- | |
| Clone Of: | ||||
| : | 1082901 (view as bug list) | Environment: | ||
| Last Closed: | 2014-07-08 15:31:52 UTC | Type: | --- | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Bug Depends On: | ||||
| Bug Blocks: | 1082901 | |||
|
Description
RHOS Integration
2013-12-12 19:06:39 UTC
Test case for this feature: 1. Enable 'show_image_direct_url' option and/or 'show_multiple_locations' option for glance api service, for example: $ cat /etc/glance/glance-api.conf | grep 'show_' show_image_direct_url = True show_multiple_locations = False 2. Set 'location_strategy' option to 'location_order' or 'store_type' for glance api service as you needed, like this: $ cat /etc/glance/glance-api.conf | grep 'location_strategy' location_strategy = location_order $ glance image-create --disk-format qcow2 --container-format bare --name test +------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ | checksum | None | | container_format | bare | | created_at | 2014-03-21T09:40:57 | | deleted | False | | deleted_at | None | | disk_format | qcow2 | | id | a9ff0a36-c6bd-4c4e-b3b2-50a2a1cf4e44 | | is_public | False | | min_disk | 0 | | min_ram | 0 | | name | test | | owner | 9599f20756514c6085310f2b2998afa1 | | protected | False | | size | 0 | | status | queued | | updated_at | 2014-03-21T09:40:57 | | virtual_size | None | +------------------+--------------------------------------+ This curl command is needed. Support for multi-location is being added to the client: https://review.openstack.org/#/c/72539/3 $ curl -X PATCH -H 'X-Auth-Token: b1f05c68b0534e28b4c45e05f0ac67de' -H 'User-Agent: python-lient' -H 'Content-Type: application/openstack-images-v2.1-json-patch' -i http://127.0.0.1:9292/v2/images/a9ff0a36-c6bd-4c4e-b3b2-50a2a1cf4e44 -d '[{"op": "replace", "path": "/locations", "value": [{"url": "file:///home/fedora/test", "metadata": {}}, {"url": "http://127.0.0.1:9292/image_test_loc_2", "metadata": {}}]}]' Note that file:// is chosen instead of http. [fedora@glance-strategy devstack]$ glance --os-image-api-version 2 image-show a9ff0a36-c6bd-4c4e-b3b2-50a2a1cf4e44 +------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ | container_format | bare | | created_at | 2014-03-21T09:40:57Z | | direct_url | file:///home/fedora/test | | disk_format | qcow2 | | id | a9ff0a36-c6bd-4c4e-b3b2-50a2a1cf4e44 | | min_disk | 0 | | min_ram | 0 | | name | test | | owner | 9599f20756514c6085310f2b2998afa1 | | protected | False | | size | 4096 | | status | active | | tags | [] | | updated_at | 2014-03-21T09:43:34Z | | visibility | private | +------------------+--------------------------------------+ As alternative location strategy, if end user use 'location_order' strategy, and give 'http, file' as the value for 'store_type_preference' option, then the image locations result will as following: [fedora@glance-strategy devstack]$ cat /etc/glance/glance-api.conf | egrep "(location_strategy|store_type_preference)" location_strategy = store_type [store_type_location_strategy] # location strategy defined by the 'location_strategy' config option. store_type_preference = http, file [fedora@glance-strategy devstack]$ glance --os-image-api-version 2 image-show a9ff0a36-c6bd-4c4e-b3b2-50a2a1cf4e44 +------------------+----------------------------------------+ | Property | Value | +------------------+----------------------------------------+ | container_format | bare | | created_at | 2014-03-21T09:40:57Z | | direct_url | http://127.0.0.1:9292/image_test_loc_2 | | disk_format | qcow2 | | id | a9ff0a36-c6bd-4c4e-b3b2-50a2a1cf4e44 | | min_disk | 0 | | min_ram | 0 | | name | test | | owner | 9599f20756514c6085310f2b2998afa1 | | protected | False | | size | 4096 | | status | active | | tags | [] | | updated_at | 2014-03-21T09:43:34Z | | visibility | private | +------------------+----------------------------------------+ Verified on: RHEL7 python-glance-2014.1-2.el7ost.noarch python-glanceclient-0.12.0-1.el7ost.noarch openstack-glance-2014.1-2.el7ost.noarch Work flow see comment 4 and 13. Output from testing same as mentioned in comment 4. 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 |