Merge lp:~hopem/charms/precise/cinder/trunk into lp:charms/raring/cinder

Proposed by Edward Hope-Morley
Status: Superseded
Proposed branch: lp:~hopem/charms/precise/cinder/trunk
Merge into: lp:charms/raring/cinder
Diff against target: 74 lines (+26/-4)
4 files modified
README (+3/-3)
config.yaml (+9/-0)
hooks/cinder-hooks (+13/-0)
revision (+1/-1)
To merge this branch: bzr merge lp:~hopem/charms/precise/cinder/trunk
Reviewer Review Type Date Requested Status
Adam Gandelman (community) Needs Fixing
Review via email: mp+169067@code.launchpad.net

This proposal has been superseded by a proposal from 2013-06-14.

Commit message

If Cinder and Glance are using Ceph as a backend store,
the Cinder RBD driver requires Glance API v2 to perform
certain newer actions (as of Grizzly) e.g. copy-on-write
cloning of images. This fix applies glance_api_version to
/etc/cinder/cinder.conf with a default value of 2.

Note that Glance must have the following config set for
Cinder/Ceph copy-on-write to work:

show_image_direct_url = True

FIXES: LP1187123

Description of the change

If Cinder and Glance are using Ceph as a backend store,
the Cinder RBD driver requires Glance API v2 to perform
certain newer actions (as of Grizzly) e.g. copy-on-write
cloning of images. This fix applies glance_api_version to
/etc/cinder/cinder.conf with a default value of 2.

Note that Glance must have the following config set for
Cinder/Ceph copy-on-write to work:

show_image_direct_url = True

FIXES: LP1187123

To post a comment you must log in.
Revision history for this message
Adam Gandelman (gandelman-a) wrote :

Hey Edward, Thanks for the merge. Couple of things:

- Shouldn't to add the os_version_is_gte() to openstack-common, we can take advantage of dpkg's version checking to accomplish the same thing, eg:

if dpkg --compare-versions "$(get_os_version_package cinder-volume)" ge 2013.1 ; then
  # do some grizzly stuff
fi

Also, you should check for cinder-common's version and not cinder-volume. ATM cinder-common is installed for all cinder services. cinder-volume will only be installed if enabled-services includes volume.

- Not sure the best way to set the glance API is through config. Its potentially error prone eg, settings API v2 but current related glance server only supports v1. Some other options:

  * The API setting goes into config glance charms config and api_version='$(config-get api-version)' is sent to related services via the image-service interface. glance charm can take responsibility of ensuring its configured to support that API version.

  * During image-service-relation-changed the cinder charm can inspect the glance endpoint in keystone to set it in cinder.conf accordingly. This may be a simple curl request to the endpoint to list supported API versions (if the api server supports such a request)

review: Needs Fixing
23. By Edward Hope-Morley

If Cinder and Glance are using Ceph as a backend store,
the Cinder RBD driver requires Glance API v2 to perform
certain newer actions (as of Grizzly) e.g. copy-on-write
cloning of images. This fix applies, fro Grizzly and up,
glance_api_version to /etc/cinder/cinder.conf with a
default value of 1 for backwards comaptibility.

Note that Glance must have the following config set for
Cinder/Ceph copy-on-write to work:

show_image_direct_url = True

FIXES: LP1187123

Unmerged revisions

23. By Edward Hope-Morley

If Cinder and Glance are using Ceph as a backend store,
the Cinder RBD driver requires Glance API v2 to perform
certain newer actions (as of Grizzly) e.g. copy-on-write
cloning of images. This fix applies, fro Grizzly and up,
glance_api_version to /etc/cinder/cinder.conf with a
default value of 1 for backwards comaptibility.

Note that Glance must have the following config set for
Cinder/Ceph copy-on-write to work:

show_image_direct_url = True

FIXES: LP1187123

22. By Edward Hope-Morley

If Cinder and Glance are using Ceph as a backend store,
the Cinder RBD driver requires Glance API v2 to perform
certain newer actions (as of Grizzly) e.g. copy-on-write
cloning of images. This fix applies glance_api_version to
/etc/cinder/cinder.conf with a default value of 2.

Note that Glance must have the following config set for
Cinder/Ceph copy-on-write to work:

show_image_direct_url = True

FIXES: LP1187123

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2012-11-29 00:03:42 +0000
3+++ README 2013-06-14 12:41:34 +0000
4@@ -47,16 +47,16 @@
5
6 Separating the volume service from the API service allows the storage pool
7 to easily scale without the added complexity that accompanies load-balancing
8-the API server. When we've exhausted local storage on volume serve, we can
9+the API server. When we've exhausted local storage on volume server, we can
10 simply add-unit to expand our capacity. Future requests to allocate volumes
11-will be distributed across the pool for volume servers according to the
12+will be distributed across the pool of volume servers according to the
13 availability of storage space.
14
15 $ cat >cinder.cfg <<END
16 cinder-api:
17 enabled-services: api, scheduler
18 cinder-volume:
19- enabled-serfvices: volume
20+ enabled-services: volume
21 block-device: sdc
22 overwrite: true
23 END
24
25=== modified file 'config.yaml'
26--- config.yaml 2013-02-20 01:42:47 +0000
27+++ config.yaml 2013-06-14 12:41:34 +0000
28@@ -86,6 +86,15 @@
29 description: |
30 Default multicast port number that will be used to communicate between
31 HA Cluster nodes.
32+ glance-api-version:
33+ type: int
34+ default: 1
35+ description: |
36+ Some drivers in Grizzly require the v2 Glance API to perform certain
37+ actions e.g. Ceph RBD driver requires v2 API to perform copy-on-write
38+ cloning of images. This option will only be set for Grizzly and up
39+ and will default to v1 for backwards compatibility with related
40+ glance services.
41 # Per-service HTTPS configuration.
42 ssl_cert:
43 type: string
44
45=== modified file 'hooks/cinder-hooks'
46--- hooks/cinder-hooks 2013-05-22 00:53:45 +0000
47+++ hooks/cinder-hooks 2013-06-14 12:41:34 +0000
48@@ -295,6 +295,19 @@
49 do_openstack_upgrade "$install_src" $(determine_packages) python-keystoneclient
50 fi
51
52+ # default to api v1 for backwards compatibility
53+ local glance_api_version=
54+ glance_api_version=`config-get glance-api-version`
55+ [ -n "glance_api_version" ] || $glance_api_version=1
56+
57+ # refresh after possible upgrade
58+ cur=$(get_os_codename_package "cinder-common")
59+
60+ # only set for Grizzly and up
61+ dpkg --compare-versions $(get_os_version_codename "$cur") ge \
62+ $(get_os_version_codename "grizzly") && \
63+ set_or_update glance_api_version $glance_api_version
64+
65 configure_https
66 # Save our scriptrc env variables for health checks
67 declare -a env_vars=(
68
69=== modified file 'revision'
70--- revision 2013-05-22 00:19:16 +0000
71+++ revision 2013-06-14 12:41:34 +0000
72@@ -1,1 +1,1 @@
73-27
74+28

Subscribers

People subscribed via source and target branches