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

Proposed by Edward Hope-Morley
Status: Rejected
Rejected by: James Page
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) Disapprove
Review via email: mp+169406@code.launchpad.net

This proposal supersedes a proposal from 2013-06-12.

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, 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

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

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
Revision history for this message
Edward Hope-Morley (hopem) wrote :

I have fixed most points. I agree that ulitmately we should use glance relation to check what api version(s) are supported but this should not break anything as is. This value will not be set < G and even it id did it would be ignored. I have made the default v1 (which would be default even if the setting were not defined in cinder.conf). it is then up to the user to define the appropriate api version to use.

Revision history for this message
Adam Gandelman (gandelman-a) wrote :

Hey Edward-

Both the cinder and glance charms are in the middle of a python rewrite and I'd prefer to include the proper solution as part of that work. Since we both agree the solution should exist in the image-service relation interface, I'd prefer not to add temporary config options to config.yaml as a stop-gap.

One alternative solution for the short-term that comes to mind is implementing a 'config-flags' field in cinder similar to the nova-* that let you define arbitrary key=value settings that get set in config. This would let you set the flag (and any others) until the interface supports handling it for you.

review: Disapprove

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:40:47 +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:40:47 +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:40:47 +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:40:47 +0000
72@@ -1,1 +1,1 @@
73-27
74+28

Subscribers

People subscribed via source and target branches