Merge lp:~james-page/charms/trusty/cinder/umount-mnt into lp:~openstack-charmers-archive/charms/trusty/cinder/next

Proposed by James Page
Status: Merged
Merged at revision: 115
Proposed branch: lp:~james-page/charms/trusty/cinder/umount-mnt
Merge into: lp:~openstack-charmers-archive/charms/trusty/cinder/next
Diff against target: 76 lines (+22/-1)
4 files modified
config.yaml (+10/-0)
hooks/cinder_hooks.py (+6/-0)
hooks/cinder_utils.py (+4/-0)
tests/basic_deployment.py (+2/-1)
To merge this branch: bzr merge lp:~james-page/charms/trusty/cinder/umount-mnt
Reviewer Review Type Date Requested Status
Ryan Beisner (community) Approve
Marco Ceppi (community) Approve
Review via email: mp+266803@code.launchpad.net
To post a comment you must log in.
Revision history for this message
James Page (james-page) wrote :

A recent charm-helpers change fixed the cinder charm so that ephemeral storage mounted on /mnt now correctly gets detected as in use storage.

This MP steals a concept from the ceph charm, supporting explicit umount of a single filesystem to support use in testing.

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #7486 cinder-next for james-page mp266803
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/7486/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #6943 cinder-next for james-page mp266803
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/6943/

Revision history for this message
Marco Ceppi (marcoceppi) wrote :

LGTM +1

review: Approve
Revision history for this message
Ryan Beisner (1chb1n) wrote :

+1!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2015-07-22 19:11:00 +0000
3+++ config.yaml 2015-08-03 20:20:00 +0000
4@@ -108,6 +108,16 @@
5 If True, charm will attempt to remove missing physical volumes from
6 volume group, even when logical volumes are allocated on them. This
7 option overrides 'remove-missing' when set.
8+ ephemeral-unmount:
9+ type: string
10+ default:
11+ description: |
12+ Cloud instances provide ephermeral storage which is normally mounted
13+ on /mnt.
14+ .
15+ Providing this option will force an unmount of the ephemeral device
16+ so that it can be used as a Cinder storage device. This is useful for
17+ testing purposes (cloud deployment is not a typical use case).
18 database-user:
19 default: cinder
20 type: string
21
22=== modified file 'hooks/cinder_hooks.py'
23--- hooks/cinder_hooks.py 2015-07-21 19:28:23 +0000
24+++ hooks/cinder_hooks.py 2015-08-03 20:20:00 +0000
25@@ -26,6 +26,7 @@
26 ceph_config_file,
27 setup_ipv6,
28 check_db_initialised,
29+ filesystem_mounted,
30 )
31
32 from charmhelpers.core.hookenv import (
33@@ -53,6 +54,7 @@
34 lsb_release,
35 restart_on_change,
36 service_reload,
37+ umount,
38 )
39
40 from charmhelpers.contrib.openstack.utils import (
41@@ -123,6 +125,10 @@
42 sync_db_with_multi_ipv6_addresses(config('database'),
43 config('database-user'))
44
45+ e_mountpoint = conf['ephemeral-unmount']
46+ if e_mountpoint and filesystem_mounted(e_mountpoint):
47+ umount(e_mountpoint)
48+
49 if (service_enabled('volume') and
50 conf['block-device'] not in [None, 'None', 'none']):
51 block_devices = conf['block-device'].split()
52
53=== modified file 'hooks/cinder_utils.py'
54--- hooks/cinder_utils.py 2015-07-27 15:49:26 +0000
55+++ hooks/cinder_utils.py 2015-08-03 20:20:00 +0000
56@@ -796,3 +796,7 @@
57 service_restart('tgtd')
58
59 [service_restart(s) for s in services()]
60+
61+
62+def filesystem_mounted(fs):
63+ return subprocess.call(['grep', '-wqs', fs, '/proc/mounts']) == 0
64
65=== modified file 'tests/basic_deployment.py'
66--- tests/basic_deployment.py 2015-07-13 16:07:29 +0000
67+++ tests/basic_deployment.py 2015-08-03 20:20:00 +0000
68@@ -68,7 +68,8 @@
69 """Configure all of the services."""
70 cinder_config = {'block-device': 'vdb',
71 'glance-api-version': '2',
72- 'overwrite': 'true'}
73+ 'overwrite': 'true',
74+ 'ephemeral-unmount': '/mnt'}
75 if self.git:
76 amulet_http_proxy = os.environ.get('AMULET_HTTP_PROXY')
77

Subscribers

People subscribed via source and target branches