Merge ~afreiberger/charm-juju-lxd:init_with_dir_storage into charm-juju-lxd:master

Proposed by Drew Freiberger
Status: Merged
Approved by: Drew Freiberger
Approved revision: 7c963765a20f9b336b3701f696a67c181a810432
Merged at revision: 800a2b94ffc553bfecccbac2489721b08e507178
Proposed branch: ~afreiberger/charm-juju-lxd:init_with_dir_storage
Merge into: charm-juju-lxd:master
Diff against target: 39 lines (+14/-3)
2 files modified
config.yaml (+4/-0)
reactive/juju_lxd.py (+10/-3)
Reviewer Review Type Date Requested Status
Chris Sanders (community) Approve
Review via email: mp+362753@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Drew Freiberger (afreiberger) wrote :

This is untested. we should add this as a new charm to yobuko, and rebuild one of the boxes under this charm to test dir-based lxd deployment. Charmlab3/ewah is free for this from my perspective.

This change is necessary to work around https://github.com/conjure-up/conjure-up/issues/1430 where kubernetes-worker won't run kubelet service under a zfs/btrfs backed lxd.

Revision history for this message
Chris Sanders (chris.sanders) wrote :

lgtm, one day testing for this charm would be nice, but I wouldn't block on a complete port of testing just to land this change in the charm lab.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/config.yaml b/config.yaml
index 698900c..8db0ec4 100644
--- a/config.yaml
+++ b/config.yaml
@@ -3,3 +3,7 @@ options:
3 type: string3 type: string
4 default: "bootstack-squad"4 default: "bootstack-squad"
5 description: user group that should have members added to local lxd group5 description: user group that should have members added to local lxd group
6 use-zfs:
7 type: boolean
8 default: false
9 description: Whether to use zfs backend for LXD storage - default is dir
diff --git a/reactive/juju_lxd.py b/reactive/juju_lxd.py
index c48a917..c6c83ff 100644
--- a/reactive/juju_lxd.py
+++ b/reactive/juju_lxd.py
@@ -78,12 +78,19 @@ def check_reconfig():
78def lxd_init():78def lxd_init():
79 # f = open("files/lxd-init-preseed.yaml", "r")79 # f = open("files/lxd-init-preseed.yaml", "r")
80 # subprocess.call(['lxd', 'init', '--preseed'], stdin=f)80 # subprocess.call(['lxd', 'init', '--preseed'], stdin=f)
81 config = hookenv.config()
82 use_zfs = config.get('use-zfs')
83
81 subprocess.call(['apt-get', '-t', 'xenial-backports', 'install', '-y',84 subprocess.call(['apt-get', '-t', 'xenial-backports', 'install', '-y',
82 'lxd', 'lxd-client'])85 'lxd', 'lxd-client'])
8386
84 subprocess.call(['lxd', 'init', '--auto', '--storage-backend', 'zfs',87 if use_zfs:
85 '--storage-pool', 'lxd', '--storage-create-loop', '100'])88 subprocess.call(['lxd', 'init', '--auto', '--storage-backend', 'zfs',
86 subprocess.call(['zpool', 'set', 'autoexpand=on', 'lxd'])89 '--storage-pool', 'lxd', '--storage-create-loop', '100'])
90 subprocess.call(['zpool', 'set', 'autoexpand=on', 'lxd'])
91 else:
92 subprocess.call(['lxd', 'init', '--auto', '--storage-backend', 'dir'])
93
8794
88 subprocess.call(['lxc', 'network', 'delete', 'lxdbr0'])95 subprocess.call(['lxc', 'network', 'delete', 'lxdbr0'])
89 subprocess.call(['lxc', 'network', 'create', 'lxdbr0',96 subprocess.call(['lxc', 'network', 'create', 'lxdbr0',

Subscribers

People subscribed via source and target branches

to all changes: