Add Debian OS support in DevStack
Fix bug #1176216 Change-Id: Ia94c332f02a921a936db249dc3b4a7ae4eff0400
This commit is contained in:
parent
b240ad472b
commit
b2ef890db3
@ -2,7 +2,7 @@
|
|||||||
nbd-client
|
nbd-client
|
||||||
lvm2
|
lvm2
|
||||||
open-iscsi
|
open-iscsi
|
||||||
open-iscsi-utils
|
open-iscsi-utils # Deprecated since quantal dist:lucid,oneiric,precise
|
||||||
genisoimage
|
genisoimage
|
||||||
sysfsutils
|
sysfsutils
|
||||||
sg3-utils
|
sg3-utils
|
||||||
|
12
functions
12
functions
@ -380,6 +380,12 @@ GetOSVersion() {
|
|||||||
os_VENDOR=""
|
os_VENDOR=""
|
||||||
done
|
done
|
||||||
os_PACKAGE="rpm"
|
os_PACKAGE="rpm"
|
||||||
|
# If lsb_release is not installed, we should be able to detect Debian OS
|
||||||
|
elif [[ -f /etc/debian_version ]] && [[ $(cat /proc/version) =~ "Debian" ]]; then
|
||||||
|
os_VENDOR="Debian"
|
||||||
|
os_PACKAGE="deb"
|
||||||
|
os_CODENAME=$(awk '/VERSION=/' /etc/os-release | sed 's/VERSION=//' | sed -r 's/\"|\(|\)//g' | awk '{print $2}')
|
||||||
|
os_RELEASE=$(awk '/VERSION_ID=/' /etc/os-release | sed 's/VERSION_ID=//' | sed 's/\"//g')
|
||||||
fi
|
fi
|
||||||
export os_VENDOR os_RELEASE os_UPDATE os_PACKAGE os_CODENAME
|
export os_VENDOR os_RELEASE os_UPDATE os_PACKAGE os_CODENAME
|
||||||
}
|
}
|
||||||
@ -425,8 +431,8 @@ function git_update_remote_branch() {
|
|||||||
# Sets ``DISTRO`` from the ``os_*`` values
|
# Sets ``DISTRO`` from the ``os_*`` values
|
||||||
function GetDistro() {
|
function GetDistro() {
|
||||||
GetOSVersion
|
GetOSVersion
|
||||||
if [[ "$os_VENDOR" =~ (Ubuntu) ]]; then
|
if [[ "$os_VENDOR" =~ (Ubuntu) || "$os_VENDOR" =~ (Debian) ]]; then
|
||||||
# 'Everyone' refers to Ubuntu releases by the code name adjective
|
# 'Everyone' refers to Ubuntu / Debian releases by the code name adjective
|
||||||
DISTRO=$os_CODENAME
|
DISTRO=$os_CODENAME
|
||||||
elif [[ "$os_VENDOR" =~ (Fedora) ]]; then
|
elif [[ "$os_VENDOR" =~ (Fedora) ]]; then
|
||||||
# For Fedora, just use 'f' and the release
|
# For Fedora, just use 'f' and the release
|
||||||
@ -459,11 +465,9 @@ function is_ubuntu {
|
|||||||
if [[ -z "$os_PACKAGE" ]]; then
|
if [[ -z "$os_PACKAGE" ]]; then
|
||||||
GetOSVersion
|
GetOSVersion
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ "$os_PACKAGE" = "deb" ]
|
[ "$os_PACKAGE" = "deb" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Determine if current distribution is a Fedora-based distribution
|
# Determine if current distribution is a Fedora-based distribution
|
||||||
# (Fedora, RHEL, CentOS).
|
# (Fedora, RHEL, CentOS).
|
||||||
# is_fedora
|
# is_fedora
|
||||||
|
@ -204,7 +204,7 @@ function configure_baremetal_nova_dirs() {
|
|||||||
sudo mkdir -p /tftpboot
|
sudo mkdir -p /tftpboot
|
||||||
sudo mkdir -p /tftpboot/pxelinux.cfg
|
sudo mkdir -p /tftpboot/pxelinux.cfg
|
||||||
sudo cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
|
sudo cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
|
||||||
sudo chown -R $STACK_USER:libvirtd /tftpboot
|
sudo chown -R $STACK_USER:$LIBVIRT_GROUP /tftpboot
|
||||||
|
|
||||||
# ensure $NOVA_STATE_PATH/baremetal is prepared
|
# ensure $NOVA_STATE_PATH/baremetal is prepared
|
||||||
sudo mkdir -p $NOVA_STATE_PATH/baremetal
|
sudo mkdir -p $NOVA_STATE_PATH/baremetal
|
||||||
|
@ -125,7 +125,7 @@ function install_ceilometerclient() {
|
|||||||
|
|
||||||
# start_ceilometer() - Start running processes, including screen
|
# start_ceilometer() - Start running processes, including screen
|
||||||
function start_ceilometer() {
|
function start_ceilometer() {
|
||||||
screen_it ceilometer-acompute "cd $CEILOMETER_DIR && sg libvirtd \"$CEILOMETER_BIN_DIR/ceilometer-agent-compute --config-file $CEILOMETER_CONF\""
|
screen_it ceilometer-acompute "cd $CEILOMETER_DIR && sg $LIBVIRT_GROUP \"$CEILOMETER_BIN_DIR/ceilometer-agent-compute --config-file $CEILOMETER_CONF\""
|
||||||
screen_it ceilometer-acentral "cd $CEILOMETER_DIR && $CEILOMETER_BIN_DIR/ceilometer-agent-central --config-file $CEILOMETER_CONF"
|
screen_it ceilometer-acentral "cd $CEILOMETER_DIR && $CEILOMETER_BIN_DIR/ceilometer-agent-central --config-file $CEILOMETER_CONF"
|
||||||
screen_it ceilometer-collector "cd $CEILOMETER_DIR && $CEILOMETER_BIN_DIR/ceilometer-collector --config-file $CEILOMETER_CONF"
|
screen_it ceilometer-collector "cd $CEILOMETER_DIR && $CEILOMETER_BIN_DIR/ceilometer-collector --config-file $CEILOMETER_CONF"
|
||||||
screen_it ceilometer-api "cd $CEILOMETER_DIR && $CEILOMETER_BIN_DIR/ceilometer-api -d -v --log-dir=$CEILOMETER_API_LOG_DIR --config-file $CEILOMETER_CONF"
|
screen_it ceilometer-api "cd $CEILOMETER_DIR && $CEILOMETER_BIN_DIR/ceilometer-api -d -v --log-dir=$CEILOMETER_API_LOG_DIR --config-file $CEILOMETER_CONF"
|
||||||
|
18
lib/nova
18
lib/nova
@ -298,14 +298,14 @@ EOF
|
|||||||
|
|
||||||
if is_fedora || is_suse; then
|
if is_fedora || is_suse; then
|
||||||
if is_fedora && [[ $DISTRO =~ (rhel6) || "$os_RELEASE" -le "17" ]]; then
|
if is_fedora && [[ $DISTRO =~ (rhel6) || "$os_RELEASE" -le "17" ]]; then
|
||||||
sudo bash -c 'cat <<EOF >/etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla
|
sudo bash -c "cat <<EOF >/etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla
|
||||||
[libvirt Management Access]
|
[libvirt Management Access]
|
||||||
Identity=unix-group:libvirtd
|
Identity=unix-group:$LIBVIRT_GROUP
|
||||||
Action=org.libvirt.unix.manage
|
Action=org.libvirt.unix.manage
|
||||||
ResultAny=yes
|
ResultAny=yes
|
||||||
ResultInactive=yes
|
ResultInactive=yes
|
||||||
ResultActive=yes
|
ResultActive=yes
|
||||||
EOF'
|
EOF"
|
||||||
elif is_suse && [[ $os_RELEASE = 12.2 || "$os_VENDOR" = "SUSE LINUX" ]]; then
|
elif is_suse && [[ $os_RELEASE = 12.2 || "$os_VENDOR" = "SUSE LINUX" ]]; then
|
||||||
# openSUSE < 12.3 or SLE
|
# openSUSE < 12.3 or SLE
|
||||||
# Work around the fact that polkit-default-privs overrules pklas
|
# Work around the fact that polkit-default-privs overrules pklas
|
||||||
@ -338,10 +338,10 @@ EOF"
|
|||||||
|
|
||||||
# The user that nova runs as needs to be member of **libvirtd** group otherwise
|
# The user that nova runs as needs to be member of **libvirtd** group otherwise
|
||||||
# nova-compute will be unable to use libvirt.
|
# nova-compute will be unable to use libvirt.
|
||||||
if ! getent group libvirtd >/dev/null; then
|
if ! getent group $LIBVIRT_GROUP >/dev/null; then
|
||||||
sudo groupadd libvirtd
|
sudo groupadd $LIBVIRT_GROUP
|
||||||
fi
|
fi
|
||||||
add_user_to_group $STACK_USER libvirtd
|
add_user_to_group $STACK_USER $LIBVIRT_GROUP
|
||||||
|
|
||||||
# libvirt detects various settings on startup, as we potentially changed
|
# libvirt detects various settings on startup, as we potentially changed
|
||||||
# the system configuration (modules, filesystems), we need to restart
|
# the system configuration (modules, filesystems), we need to restart
|
||||||
@ -648,11 +648,11 @@ function start_nova_api() {
|
|||||||
|
|
||||||
# start_nova() - Start running processes, including screen
|
# start_nova() - Start running processes, including screen
|
||||||
function start_nova() {
|
function start_nova() {
|
||||||
# The group **libvirtd** is added to the current user in this script.
|
# The group **$LIBVIRT_GROUP** is added to the current user in this script.
|
||||||
# Use 'sg' to execute nova-compute as a member of the **libvirtd** group.
|
# Use 'sg' to execute nova-compute as a member of the **$LIBVIRT_GROUP** group.
|
||||||
# ``screen_it`` checks ``is_service_enabled``, it is not needed here
|
# ``screen_it`` checks ``is_service_enabled``, it is not needed here
|
||||||
screen_it n-cond "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-conductor"
|
screen_it n-cond "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-conductor"
|
||||||
screen_it n-cpu "cd $NOVA_DIR && sg libvirtd $NOVA_BIN_DIR/nova-compute"
|
screen_it n-cpu "cd $NOVA_DIR && sg $LIBVIRT_GROUP $NOVA_BIN_DIR/nova-compute"
|
||||||
screen_it n-crt "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-cert"
|
screen_it n-crt "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-cert"
|
||||||
screen_it n-net "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-network"
|
screen_it n-net "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-network"
|
||||||
screen_it n-sch "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-scheduler"
|
screen_it n-sch "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-scheduler"
|
||||||
|
11
stack.sh
11
stack.sh
@ -32,6 +32,15 @@ source $TOP_DIR/functions
|
|||||||
# and ``DISTRO``
|
# and ``DISTRO``
|
||||||
GetDistro
|
GetDistro
|
||||||
|
|
||||||
|
# Some dependencies are not available in Debian Wheezy official
|
||||||
|
# repositories. However, it's possible to run OpenStack from gplhost
|
||||||
|
# repository.
|
||||||
|
if [[ "$os_VENDOR" =~ (Debian) ]]; then
|
||||||
|
echo 'deb http://archive.gplhost.com/debian grizzly main' | sudo tee /etc/apt/sources.list.d/gplhost_wheezy-backports.list
|
||||||
|
echo 'deb http://archive.gplhost.com/debian grizzly-backports main' | sudo tee -a /etc/apt/sources.list.d/gplhost_wheezy-backports.list
|
||||||
|
apt_get update
|
||||||
|
apt_get install --force-yes gplhost-archive-keyring
|
||||||
|
fi
|
||||||
|
|
||||||
# Global Settings
|
# Global Settings
|
||||||
# ===============
|
# ===============
|
||||||
@ -105,7 +114,7 @@ disable_negated_services
|
|||||||
|
|
||||||
# Warn users who aren't on an explicitly supported distro, but allow them to
|
# Warn users who aren't on an explicitly supported distro, but allow them to
|
||||||
# override check and attempt installation with ``FORCE=yes ./stack``
|
# override check and attempt installation with ``FORCE=yes ./stack``
|
||||||
if [[ ! ${DISTRO} =~ (oneiric|precise|quantal|raring|saucy|f16|f17|f18|opensuse-12.2|rhel6) ]]; then
|
if [[ ! ${DISTRO} =~ (oneiric|precise|quantal|raring|saucy|7.0|wheezy|sid|testing|jessie|f16|f17|f18|opensuse-12.2|rhel6) ]]; then
|
||||||
echo "WARNING: this script has not been tested on $DISTRO"
|
echo "WARNING: this script has not been tested on $DISTRO"
|
||||||
if [[ "$FORCE" != "yes" ]]; then
|
if [[ "$FORCE" != "yes" ]]; then
|
||||||
die $LINENO "If you wish to run this script anyway run with FORCE=yes"
|
die $LINENO "If you wish to run this script anyway run with FORCE=yes"
|
||||||
|
5
stackrc
5
stackrc
@ -162,6 +162,11 @@ BM_POSEUR_BRANCH=${BM_POSEUR_BRANCH:-master}
|
|||||||
# also install an **LXC** or **OpenVZ** based system.
|
# also install an **LXC** or **OpenVZ** based system.
|
||||||
VIRT_DRIVER=${VIRT_DRIVER:-libvirt}
|
VIRT_DRIVER=${VIRT_DRIVER:-libvirt}
|
||||||
LIBVIRT_TYPE=${LIBVIRT_TYPE:-kvm}
|
LIBVIRT_TYPE=${LIBVIRT_TYPE:-kvm}
|
||||||
|
if [[ "$os_VENDOR" =~ (Debian) ]]; then
|
||||||
|
LIBVIRT_GROUP=libvirt
|
||||||
|
else
|
||||||
|
LIBVIRT_GROUP=libvirtd
|
||||||
|
fi
|
||||||
|
|
||||||
# Specify a comma-separated list of UEC images to download and install into glance.
|
# Specify a comma-separated list of UEC images to download and install into glance.
|
||||||
# supported urls here are:
|
# supported urls here are:
|
||||||
|
Loading…
Reference in New Issue
Block a user