Add missing files
Signed-off-by: Chuck Short <chuck.short@canonical.com>
This commit is contained in:
parent
d24efbe071
commit
c299f10b7e
|
@ -0,0 +1,55 @@
|
|||
# lib/flex
|
||||
|
||||
# Dependencies:
|
||||
# ``functions`` file
|
||||
# ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined
|
||||
|
||||
# ``stack.sh`` calls the entry points in this order:
|
||||
# install_flex
|
||||
|
||||
XTRACE=$(set +o | grep xtrace)
|
||||
set +o xtrace
|
||||
|
||||
LXD_DIR=$DEST/nova-compute-lxd
|
||||
LXD_BIN_DIR=$GOPATH/src/github.com/lxc/lxd
|
||||
|
||||
LXC_REPO=${LXC_REPO:-${GIT_BASE}/lxc/python2-lxc}
|
||||
LXC_DIR=$DEST/python2-lxc
|
||||
|
||||
|
||||
function configure_lxd {
|
||||
install_package python-software-properties
|
||||
sudo apt-add-repository -y ppa:ubuntu-lxc/lxd-daily
|
||||
sudo apt-add-repository -y ppa:ubuntu-lxc/stable
|
||||
apt_get update
|
||||
|
||||
install_package golang
|
||||
install_package lxc lxc-dev mercurial pkg-config build-essential
|
||||
|
||||
if [[ ! -d $HOME/go ]]; then
|
||||
mkdir -p $HOME/go
|
||||
export GOPATH=$HOME/go
|
||||
fi
|
||||
|
||||
go get github.com/lxc/lxd
|
||||
cd $GOPATH/src/github.com/lxc/lxd
|
||||
go get -v -d ./...
|
||||
make
|
||||
|
||||
if [[ ! -d /var/lib/lxd ]]; then
|
||||
sudo mkdir -p /var/lib/lxd/
|
||||
sudo chown $USER:$USER /var/lib/lxd
|
||||
fi
|
||||
|
||||
run_process lxd "$LXD_BIN_DIR/lxd/lxd --tcp $HOST_IP:8443 --debug"
|
||||
echo "Configure LXD API"
|
||||
}
|
||||
|
||||
|
||||
function install_lxd {
|
||||
git_clone $LXC_REPO $LXC_DIR
|
||||
setup_develop $LXC_DIR
|
||||
|
||||
setup_develop $LXD_DIR
|
||||
mkdir -p /etc/nova/rootwrap.d
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
# lib/nova_plugins/hypervisor-lxd
|
||||
# Configure the lxd hypervisor
|
||||
|
||||
# Enable with:
|
||||
# VIRT_DRIVER=lxd
|
||||
|
||||
# Dependencies:
|
||||
# ``functions`` file
|
||||
# ``nova`` configuration
|
||||
|
||||
# install_nova_hypervisor - install any external requirements
|
||||
# configure_nova_hypervisor - make configuration changes, including those to other services
|
||||
# start_nova_hypervisor - start any external services
|
||||
# stop_nova_hypervisor - stop any external services
|
||||
# cleanup_nova_hypervisor - remove transient data and cache
|
||||
|
||||
# Save trace setting
|
||||
MY_XTRACE=$(set +o | grep xtrace)
|
||||
set +o xtrace
|
||||
|
||||
|
||||
# Defaults
|
||||
# --------
|
||||
|
||||
|
||||
# Entry Points
|
||||
# ------------
|
||||
|
||||
# clean_nova_hypervisor - Clean up an installation
|
||||
function cleanup_nova_hypervisor {
|
||||
# This function intentionally left blank
|
||||
:
|
||||
}
|
||||
|
||||
# configure_nova_hypervisor - Set config files, create data dirs, etc
|
||||
function configure_nova_hypervisor {
|
||||
iniset $NOVA_CONF DEFAULT compute_driver nclxd.nova.virt.lxd.LXDDriver
|
||||
iniset $GLANCE_API_CONF DEFAULT container_formats ami,ari,aki,bare,ovf,root-tar
|
||||
iniset $GLANCE_API_CONF DEFAULT disk_formats ami,ari,aki,bare,ovf,root-tar
|
||||
}
|
||||
|
||||
# install_nova_hypervisor() - Install external components
|
||||
function install_nova_hypervisor {
|
||||
# This function intentionally left blank
|
||||
:
|
||||
}
|
||||
|
||||
# start_nova_hypervisor - Start any required external services
|
||||
function start_nova_hypervisor {
|
||||
# This function intentionally left blank
|
||||
:
|
||||
}
|
||||
|
||||
# stop_nova_hypervisor - Stop any external services
|
||||
function stop_nova_hypervisor {
|
||||
# This function intentionally left blank
|
||||
:
|
||||
}
|
||||
|
||||
|
||||
# Restore xtrace
|
||||
$MY_XTRACE
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# End:
|
Loading…
Reference in New Issue