summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Short <chuck.short@canonical.com>2016-10-21 10:47:37 -0400
committerChuck Short <chuck.short@canonical.com>2016-10-21 15:31:54 -0400
commitc0d0fc50418867e702430f4d655da89f794e1f73 (patch)
tree29d5e8308624711a9ca3cbd014dfc214e1f3f4fb
parentf3895562257e0e0282df54365c2f2ac110d97bbd (diff)
downloadcharm-nova-lxd-c0d0fc50418867e702430f4d655da89f794e1f73.zip
charm-nova-lxd-c0d0fc50418867e702430f4d655da89f794e1f73.tar.gz
charm-nova-lxd-c0d0fc50418867e702430f4d655da89f794e1f73.tar.bz2
Disable ext4 userns when running in a container
/sys is read-only when using an LXD contianer due to lxcfs. So detect if we are running the charm inside a container and prevent ext4 userns from being configured. Closes-Bug: #1635659 Change-Id: Ia0668ea473ec1e80dd8b0a1136061a430883b0ec Signed-off-by: Chuck Short <chuck.short@canonical.com>
-rw-r--r--hooks/lxd_utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/hooks/lxd_utils.py b/hooks/lxd_utils.py
index a66d3db..7cfc121 100644
--- a/hooks/lxd_utils.py
+++ b/hooks/lxd_utils.py
@@ -425,7 +425,9 @@ def configure_lxd_host():
if ubuntu_release >= 'xenial':
modprobe('netlink_diag')
- if os.path.exists(EXT4_USERNS_MOUNTS):
+ # /sys is read-only when using a container
+ container_check = check_output(['systemd-detect-virt']).strip()
+ if (container_check != 'lxc' and os.path.exists(EXT4_USERNS_MOUNTS)):
with open(EXT4_USERNS_MOUNTS, 'w') as userns_mounts:
userns_mounts.write(
'Y\n' if config('enable-ext4-userns') else 'N\n'

This mirror site include all the OpenStack related repositories under: openstack, openstack-dev and openstack-infra.

NOTE: All repositories are updated every one hour.

Usage

For Git Clone
 git clone http://git.trystack.cn/openstack/nova.git 
For DevStack

Add GIT_BASE, NOVNC_REPO and SPICE_REPO variables to local.conf file.

[[local|localrc]]

# use TryStack git mirror
GIT_BASE=http://git.trystack.cn
NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git
SPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git