attempt to get lxc working #23
This commit is contained in:
parent
4ebd289de0
commit
c6d3042e06
1 changed files with 15 additions and 2 deletions
13
stack.sh
13
stack.sh
|
@ -308,9 +308,22 @@ if [[ "$ENABLED_SERVICES" =~ "n-cpu" ]]; then
|
|||
# qcow images) and kvm (hardware based virtualization). If unable to
|
||||
# load kvm, set the libvirt type to qemu.
|
||||
sudo modprobe nbd || true
|
||||
|
||||
if [[ "$LIBVIRT_TYPE" -eq "kvm" ]]; then
|
||||
if [ ! -e /dev/kvm ]; then
|
||||
LIBVIRT_TYPE=qemu
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$LIBVIRT_TYPE" -eq "lxc" ]]; then
|
||||
apt-get install lxc -y
|
||||
sudo mkdir -p /cgroup
|
||||
sudo mount none -t cgroup -o cpuacct,memory,devices,cpu,freezer,blkio /cgroup
|
||||
if ! grep -q cgroup /etc/fstab; then
|
||||
sudo echo none /cgroup cgroup cpuacct,memory,devices,cpu,freezer,blkio 0 0 >> /etc/fstab
|
||||
fi
|
||||
fi
|
||||
|
||||
# User needs to be member of libvirtd group for nova-compute to use libvirt.
|
||||
sudo usermod -a -G libvirtd `whoami`
|
||||
# if kvm wasn't running before we need to restart libvirt to enable it
|
||||
|
|
Loading…
Reference in a new issue