Commit cf85ef68 authored by David Johnson's avatar David Johnson

Lots of new features: real/vpn mgmt lans, real lvm, x86 arch, etc.

parent 2035ccd3
#!/bin/sh
##
## Initialize some basic aarch64 stuff.
##
set -x
DIRNAME=`dirname $0`
# Gotta know the rules!
if [ $EUID -ne 0 ] ; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Grab our libs
. "$DIRNAME/setup-lib.sh"
if [ "$HOSTNAME" != "$CONTROLLER" ]; then
exit 0;
fi
if [ -f $SETTINGS ]; then
. $SETTINGS
fi
. $OURDIR/admin-openrc.sh
echo "*** Building an ARM64 image ..."
# need growpart
apt-get update
apt-get install cloud-guest-utils
# Grab some files
wget http://boss.utah.cloudlab.us/downloads/vmlinuz-3.13.0-40-arm64-generic
wget http://boss.utah.cloudlab.us/downloads/initrd.img-3.13.0-40-arm64-generic
wget http://boss.utah.cloudlab.us/downloads/ubuntu-core-14.04.1-core-arm64.tar.gz
echo "*** adding growpart to initrd ***"
initrd=initrd.img-3.13.0-40-arm64-generic
cp -pv $initrd ${initrd}.orig
mkdir -p initrd
cd initrd
gunzip -c ../$initrd | cpio -i -H newc
#--verbose
cat <<'EOF' > scripts/local-premount/growpart
#/bin/sh -e
set -x
root_dev=`echo ${ROOT} | sed -n -e "s/.*\/\([a-z0-9]*[a-z]\).*/\1/p"`
part_num=`echo ${ROOT} | sed -n -e "s/.*\/[a-z0-9]*[a-z]\(.*\)/\1/p"`
echo "[] linux-rootfs-resize $ROOT ($root_dev and $part_num)..."
growpart -v /dev/${root_dev} ${part_num}
partprobe /dev/${root_dev}${part_num}
sleep 2
e2fsck -p -f /dev/${root_dev}${part_num}
sleep 2
resize2fs -f -p /dev/${root_dev}${part_num}
EOF
chmod ug+x scripts/local-premount/growpart
echo "/scripts/local-premount/growpart" >> scripts/local-premount/ORDER
# copy deps
deps="growpart cat sfdisk grep sed awk partx e2fsck resize2fs partprobe readlink"
for dep in $deps
do
path=`which $dep`
dir=`dirname $path`
mkdir -p ./$dir
cp -pv $path ./$path
libs=`ldd $path | cut -d ' ' -f 3 | xargs`
for lib in $libs
do
dir=`dirname $lib`
mkdir -p ./$dir
cp -pv $lib ./$lib
done
done
# rebuild initrd
find . | cpio -o -H newc | gzip > ../$initrd
cd ..
core=ubuntu-core-14.04.1-core-arm64.tar.gz
out=ubuntu-core-14.04.1-core-arm64.img
dd if=/dev/zero of="$out" bs=1M count=1024
dd conv=notrunc if=$DIRNAME/etc/mbr.img of="$out" bs=2048 count=1
ld=`losetup --show -f "$out"`
partprobe $ld
echo "*** making a new ext4 filesystem ..."
# if we don't pass 1024*1024*1023/4096 (size in blocks), mke2fs will make
# the fs 1024*1024*1024/4096 --- not factoring the offset into the estimated
# automatic size. This must be a bug...
mke2fs -t ext4 ${ld}p1
mkdir -p mnt
mount ${ld}p1 mnt
echo "*** adding contents of core tarball ..."
tar xzf "$core" -C mnt
echo "*** adding ttyAMA0 ..."
{
cat - <<EOM
# ttyAMA0 - getty
#
# This service maintains a getty on ttyAMA0 from the point the system is
# started until it is shut down again.
#start on stopped rc RUNLEVEL=[2345] and (
# not-container or
# container CONTAINER=lxc or
# container CONTAINER=lxc-libvirt)
start on started
stop on runlevel [!2345]
respawn
exec /sbin/getty -L ttyAMA0 115200
EOM
} | tee mnt/etc/init/ttyAMA0.conf >/dev/null
echo "*** adding NTP date and time synchronization ..."
{
cat - <<EOM
#
# This task is run on startup to set the system date and time via NTP
description "set the date and time via NTP"
start on startup
task
exec ntpdate -u ntp.ubuntu.com
EOM
} | tee mnt/etc/init/ntpdate.conf >/dev/null
#
# NOTE: we reduce the MTU arbitrarily here so that we can (easily) fit
# through a GRE tunnel. Also, add a second interface because our default
# config has two interfaces -- a GRE tunnel data net, and a flat data "control"
# net.
#
echo "*** adding networking for qemu ..."
{
cat - <<EOM
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
post-up /sbin/ifconfig eth0 mtu 1300
auto eth1
iface eth1 inet dhcp
post-up /sbin/ifconfig eth1 mtu 1300
EOM
} | tee -a mnt/etc/network/interfaces >/dev/null
echo 'Acquire::CompressionTypes::Order { "gz"; "bz2"; }' | tee mnt/etc/apt/apt.conf.d/99gzip >/dev/null
echo "*** fixing root password to root/root ..."
#sed -in -e 's@root:\*:@root:$6$pDWQLJGt$813e.4.vXznRlkCpxRtBdUZmHf6DnYg.XM58h6SGLF0Q2tCh5kTF2hCi7fm9NeaSSHeGBaUfpKQ9/wA54mcb51:@' mnt/etc/shadow
sed -in -e 's@root:\*:@root:$6$lMUVMHvx$JkBLzWKF/v6s/UQx1RlNPbIS7nEVjqfZwtQJcb1r.pEuMiV0JO1Z9r4w2s9ULJ22JLlY8.sU.whzQRil0f7sF/:@' mnt/etc/shadow
echo "*** unmounting ..."
umount mnt
rmdir mnt
echo "*** Importing new image ..."
glance image-create --name vmlinuz-3.13.0-40-arm64-generic --is-public True --progress --file vmlinuz-3.13.0-40-arm64-generic --disk-format aki --container-format aki
KERNEL_ID=`glance image-show vmlinuz-3.13.0-40-arm64-generic | grep id | sed -n -e 's/^.*id.*| \([0-9a-zA-Z-]*\).*$/\1/p'`
glance image-create --name initrd-3.13.0-40-arm64-generic --is-public True --progress --file initrd.img-3.13.0-40-arm64-generic --disk-format ari --container-format ari
RAMDISK_ID=`glance image-show initrd-3.13.0-40-arm64-generic | grep id | sed -n -e 's/^.*id.*| \([0-9a-zA-Z-]*\).*$/\1/p'`
glance image-create --name ubuntu-core-14.04.1-core-arm64 --is-public True --progress --file $out --disk-format ami --container-format ami
glance image-update --property kernel_args="console=ttyAMA0 root=/dev/sda" ubuntu-core-14.04.1-core-arm64
glance image-update --property kernel_id=${KERNEL_ID} ubuntu-core-14.04.1-core-arm64
glance image-update --property ramdisk_id=${RAMDISK_ID} ubuntu-core-14.04.1-core-arm64
glance image-update --property root_device_name=/dev/vda1 ubuntu-core-14.04.1-core-arm64
#
# Now do another one, with sshd installed
#
mkdir -p mnt
mount ${ld}p1 mnt
echo "*** installing ssh/sshd..."
echo "nameserver 8.8.8.8" > mnt/etc/resolv.conf
chroot mnt /usr/bin/apt-get update
chroot mnt /usr/bin/apt-get install -y openssh-server openssh-client
chroot mnt /usr/sbin/update-rc.d ssh defaults
chroot mnt /usr/sbin/update-rc.d ssh enable
cat <<EOF > mnt/etc/ssh/sshd_config
Port 22
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 1024
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
#PermitEmptyPasswords no
ChallengeResponseAuthentication no
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes
UseDNS no
StrictModes no
PermitRootLogin yes
PasswordAuthentication yes
EOF
echo "*** unmounting ..."
umount mnt
rmdir mnt
echo "*** Importing new image (with sshd) ..."
glance image-create --name ubuntu-core-14.04.1-core-arm64-sshd --is-public True --progress --file $out --disk-format ami --container-format ami
glance image-update --property kernel_args="console=ttyAMA0 root=/dev/sda" ubuntu-core-14.04.1-core-arm64-sshd
glance image-update --property kernel_id=${KERNEL_ID} ubuntu-core-14.04.1-core-arm64-sshd
glance image-update --property ramdisk_id=${RAMDISK_ID} ubuntu-core-14.04.1-core-arm64-sshd
glance image-update --property root_device_name=/dev/vda1 ubuntu-core-14.04.1-core-arm64-sshd
losetup -d ${ld}
exit 0
#!/bin/sh
##
## Initialize some basic aarch64 stuff.
##
set -x
DIRNAME=`dirname $0`
# Gotta know the rules!
if [ $EUID -ne 0 ] ; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Grab our libs
. "$DIRNAME/setup-lib.sh"
if [ "$HOSTNAME" != "$CONTROLLER" ]; then
exit 0;
fi
if [ -f $SETTINGS ]; then
. $SETTINGS
fi
. $OURDIR/admin-openrc.sh
echo "*** Downloading an x86_64 image ..."
wget https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img
echo "*** Importing new image ..."
glance image-create --name trusty-server --is-public True --disk-format qcow2 --container-format bare --progress --file trusty-server-cloudimg-amd64-disk1.img
exit 0
......@@ -17,7 +17,6 @@ fi
# Grab our libs
. "$DIRNAME/setup-lib.sh"
HOSTNAME=`hostname -s`
if [ "$HOSTNAME" != "$CONTROLLER" ]; then
exit 0;
fi
......@@ -28,168 +27,14 @@ fi
. $OURDIR/admin-openrc.sh
echo "*** Building an ARM64 image ..."
# need growpart
apt-get update
apt-get install cloud-guest-utils
# Grab some files
wget http://boss.utah.cloudlab.us/downloads/vmlinuz-3.13.0-40-arm64-generic
wget http://boss.utah.cloudlab.us/downloads/initrd.img-3.13.0-40-arm64-generic
wget http://boss.utah.cloudlab.us/downloads/ubuntu-core-14.04.1-core-arm64.tar.gz
echo "*** adding growpart to initrd ***"
initrd=initrd.img-3.13.0-40-arm64-generic
cp -pv $initrd ${initrd}.orig
mkdir -p initrd
cd initrd
gunzip -c ../$initrd | cpio -i -H newc
#--verbose
cat <<'EOF' > scripts/local-premount/growpart
#/bin/sh -e
set -x
root_dev=`echo ${ROOT} | sed -n -e "s/.*\/\([a-z0-9]*[a-z]\).*/\1/p"`
part_num=`echo ${ROOT} | sed -n -e "s/.*\/[a-z0-9]*[a-z]\(.*\)/\1/p"`
echo "[] linux-rootfs-resize $ROOT ($root_dev and $part_num)..."
growpart -v /dev/${root_dev} ${part_num}
partprobe /dev/${root_dev}${part_num}
sleep 2
e2fsck -p -f /dev/${root_dev}${part_num}
sleep 2
resize2fs -f -p /dev/${root_dev}${part_num}
EOF
chmod ug+x scripts/local-premount/growpart
echo "/scripts/local-premount/growpart" >> scripts/local-premount/ORDER
# copy deps
deps="growpart cat sfdisk grep sed awk partx e2fsck resize2fs partprobe readlink"
for dep in $deps
do
path=`which $dep`
dir=`dirname $path`
mkdir -p ./$dir
cp -pv $path ./$path
libs=`ldd $path | cut -d ' ' -f 3 | xargs`
for lib in $libs
do
dir=`dirname $lib`
mkdir -p ./$dir
cp -pv $lib ./$lib
done
done
# rebuild initrd
find . | cpio -o -H newc | gzip > ../$initrd
cd ..
core=ubuntu-core-14.04.1-core-arm64.tar.gz
out=ubuntu-core-14.04.1-core-arm64.img
dd if=/dev/zero of="$out" bs=1M count=1024
dd conv=notrunc if=$DIRNAME/etc/mbr.img of="$out" bs=2048 count=1
ld=`losetup --show -f "$out"`
partprobe $ld
echo "*** making a new ext4 filesystem ..."
# if we don't pass 1024*1024*1023/4096 (size in blocks), mke2fs will make
# the fs 1024*1024*1024/4096 --- not factoring the offset into the estimated
# automatic size. This must be a bug...
mke2fs -t ext4 ${ld}p1
mkdir -p mnt
mount ${ld}p1 mnt
echo "*** adding contents of core tarball ..."
tar xzf "$core" -C mnt
echo "*** adding ttyAMA0 ..."
{
cat - <<EOM
# ttyAMA0 - getty
#
# This service maintains a getty on ttyAMA0 from the point the system is
# started until it is shut down again.
#start on stopped rc RUNLEVEL=[2345] and (
# not-container or
# container CONTAINER=lxc or
# container CONTAINER=lxc-libvirt)
start on started
stop on runlevel [!2345]
respawn
exec /sbin/getty -L ttyAMA0 115200
EOM
} | tee mnt/etc/init/ttyAMA0.conf >/dev/null
echo "*** adding NTP date and time synchronization ..."
{
cat - <<EOM
#
# This task is run on startup to set the system date and time via NTP
description "set the date and time via NTP"
start on startup
task
exec ntpdate -u ntp.ubuntu.com
EOM
} | tee mnt/etc/init/ntpdate.conf >/dev/null
#
# NOTE: we reduce the MTU arbitrarily here so that we can (easily) fit
# through a GRE tunnel. Also, add a second interface because our default
# config has two interfaces -- a GRE tunnel data net, and a flat data "control"
# net.
#
echo "*** adding networking for qemu ..."
{
cat - <<EOM
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
post-up /sbin/ifconfig eth0 mtu 1300
auto eth1
iface eth1 inet dhcp
post-up /sbin/ifconfig eth1 mtu 1300
EOM
} | tee -a mnt/etc/network/interfaces >/dev/null
echo 'Acquire::CompressionTypes::Order { "gz"; "bz2"; }' | tee mnt/etc/apt/apt.conf.d/99gzip >/dev/null
echo "*** fixing root password to root/root ..."
#sed -in -e 's@root:\*:@root:$6$pDWQLJGt$813e.4.vXznRlkCpxRtBdUZmHf6DnYg.XM58h6SGLF0Q2tCh5kTF2hCi7fm9NeaSSHeGBaUfpKQ9/wA54mcb51:@' mnt/etc/shadow
sed -in -e 's@root:\*:@root:$6$lMUVMHvx$JkBLzWKF/v6s/UQx1RlNPbIS7nEVjqfZwtQJcb1r.pEuMiV0JO1Z9r4w2s9ULJ22JLlY8.sU.whzQRil0f7sF/:@' mnt/etc/shadow
echo "*** unmounting ..."
umount mnt
rmdir mnt
echo "*** Importing new image ..."
glance image-create --name vmlinuz-3.13.0-40-arm64-generic --is-public True --progress --file vmlinuz-3.13.0-40-arm64-generic --disk-format aki --container-format aki
KERNEL_ID=`glance image-show vmlinuz-3.13.0-40-arm64-generic | grep id | sed -n -e 's/^.*id.*| \([0-9a-zA-Z-]*\).*$/\1/p'`
glance image-create --name initrd-3.13.0-40-arm64-generic --is-public True --progress --file initrd.img-3.13.0-40-arm64-generic --disk-format ari --container-format ari
RAMDISK_ID=`glance image-show initrd-3.13.0-40-arm64-generic | grep id | sed -n -e 's/^.*id.*| \([0-9a-zA-Z-]*\).*$/\1/p'`
glance image-create --name ubuntu-core-14.04.1-core-arm64 --is-public True --progress --file $out --disk-format ami --container-format ami
glance image-update --property kernel_args="console=ttyAMA0 root=/dev/sda" ubuntu-core-14.04.1-core-arm64
glance image-update --property kernel_id=${KERNEL_ID} ubuntu-core-14.04.1-core-arm64
glance image-update --property ramdisk_id=${RAMDISK_ID} ubuntu-core-14.04.1-core-arm64
glance image-update --property root_device_name=/dev/vda1 ubuntu-core-14.04.1-core-arm64
echo "*** Adding Images ..."
ARCH=`uname -m`
if [ "$ARCH" = "aarch64" ] ; then
$DIRNAME/setup-basic-aarch64.sh
else
$DIRNAME/setup-basic-x86_64.sh
fi
echo "*** Creating GRE data network and subnet ..."
......@@ -213,77 +58,4 @@ if [ ${SETUP_FLAT_DATA_NETWORK} -eq 1 ]; then
#neutron router-gateway-set ${EPID}-router ext-net
fi
#
# Now do another one, with sshd installed
#
mkdir -p mnt
mount ${ld}p1 mnt
echo "*** installing ssh/sshd..."
echo "nameserver 8.8.8.8" > mnt/etc/resolv.conf
chroot mnt /usr/bin/apt-get update
chroot mnt /usr/bin/apt-get install -y openssh-server openssh-client
chroot mnt /usr/sbin/update-rc.d ssh defaults
chroot mnt /usr/sbin/update-rc.d ssh enable
cat <<EOF > mnt/etc/ssh/sshd_config
Port 22
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 1024
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
#PermitEmptyPasswords no
ChallengeResponseAuthentication no
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes
UseDNS no
StrictModes no
PermitRootLogin yes
PasswordAuthentication yes
EOF
echo "*** unmounting ..."
umount mnt
rmdir mnt
echo "*** Importing new image (with sshd) ..."
glance image-create --name ubuntu-core-14.04.1-core-arm64-sshd --is-public True --progress --file $out --disk-format ami --container-format ami
glance image-update --property kernel_args="console=ttyAMA0 root=/dev/sda" ubuntu-core-14.04.1-core-arm64-sshd
glance image-update --property kernel_id=${KERNEL_ID} ubuntu-core-14.04.1-core-arm64-sshd
glance image-update --property ramdisk_id=${RAMDISK_ID} ubuntu-core-14.04.1-core-arm64-sshd
glance image-update --property root_device_name=/dev/vda1 ubuntu-core-14.04.1-core-arm64-sshd
losetup -d ${ld}
exit 0
......@@ -12,8 +12,10 @@ if [ $EUID -ne 0 ] ; then
exit 1
fi
DIRNAME=`dirname $0`
# Grab our libs
. "`dirname $0`/setup-lib.sh"
. "$DIRNAME/setup-lib.sh"
HOSTNAME=`hostname -s`
if [ "$HOSTNAME" == "$CONTROLLER" -o "$HOSTNAME" == "$NETWORKMANAGER" ]; then
......@@ -28,10 +30,8 @@ if [ -f $SETTINGS ]; then
. $SETTINGS
fi
myip=`cat /etc/hosts | grep $NODEID | head -1 | sed -n -e 's/^\\([0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*\\).*$/\\1/p'`
apt-get install -y nova-compute sysfsutils
apt-get install -y libguestfs-tools libguestfs0 python-guestfs
apt-get install -y nova-compute sysfsutils < /dev/null
apt-get install -y libguestfs-tools libguestfs0 python-guestfs < /dev/null
#
# Change vnc_enabled = True for x86 -- but for aarch64, there is
......@@ -43,10 +43,10 @@ rpc_backend = rabbit
rabbit_host = $CONTROLLER
rabbit_password = ${RABBIT_PASS}
auth_strategy = keystone
my_ip = $myip
my_ip = $MGMTIP
vnc_enabled = False
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $myip
vncserver_proxyclient_address = $MGMTIP
novncproxy_base_url = http://$CONTROLLER:6080/vnc_auto.html
verbose = True
......@@ -68,9 +68,19 @@ compute_driver=libvirt.LibvirtDriver
[libvirt]
virt_type=kvm
EOF
if [ "$ARCH" = "aarch64" ] ; then
cat <<EOF >> /etc/nova/nova-compute.conf
cpu_mode=custom
cpu_model=host
EOF
fi
#
# Patch quick :(
#
patch -d / -p0 < $DIRNAME/etc/nova-juno-root-device-name.patch
service nova-compute restart
......
......@@ -22,11 +22,6 @@ if [ "$HOSTNAME" != "$CONTROLLER" ]; then
exit 0;
fi
#
# Give the controller a root login on all the machines
#
$DIRNAME/setup-root-ssh.sh
if [ -f $SETTINGS ]; then
. $SETTINGS
fi
......@@ -54,12 +49,13 @@ if [ -z "${DB_ROOT_PASS}" ]; then
mysqladmin --password=${DB_ROOT_PASS} shutdown
# Put it on the management network and set recommended settings
echo "[mysqld]" >> /etc/mysql/my.cnf
echo "bind-address = 192.168.0.3" >> /etc/mysql/my.cnf
echo "bind-address = $MGMTIP" >> /etc/mysql/my.cnf
echo "default-storage-engine = innodb" >> /etc/mysql/my.cnf
echo "innodb_file_per_table" >> /etc/mysql/my.cnf
echo "collation-server = utf8_general_ci" >> /etc/mysql/my.cnf
echo "init-connect = 'SET NAMES utf8'" >> /etc/mysql/my.cnf
echo "character-set-server = utf8" >> /etc/mysql/my.cnf
echo "max_connections = 5000" >> /etc/mysql/my.cnf
# Restart it!
service mysql restart
# Save the passwd
......@@ -248,7 +244,7 @@ if [ -z "${NOVA_DBPASS}" ]; then
NOVA_PASS=`$PSWDGEN`
# Make sure we're consistent with the clients
apt-get install nova-api
apt-get install -y nova-api
echo "create database nova" | mysql -u root --password="$DB_ROOT_PASS"
echo "grant all privileges on nova.* to 'nova'@'localhost' identified by '$NOVA_DBPASS'" | mysql -u root --password="$DB_ROOT_PASS"
......@@ -275,9 +271,9 @@ rpc_backend = rabbit
rabbit_host = $CONTROLLER
rabbit_password = ${RABBIT_PASS}
auth_strategy = keystone
my_ip = 192.168.0.3
vncserver_listen = 192.168.0.3
vncserver_proxyclient_address = 192.168.0.3
my_ip = ${MGMTIP}
vncserver_listen = ${MGMTIP}
vncserver_proxyclient_address = ${MGMTIP}
verbose = True
[database]
......@@ -368,9 +364,9 @@ rpc_backend = rabbit
rabbit_host = $CONTROLLER
rabbit_password = ${RABBIT_PASS}
auth_strategy = keystone
my_ip = 192.168.0.3
vncserver_listen = 192.168.0.3
vncserver_proxyclient_address = 192.168.0.3
my_ip = ${MGMTIP}
vncserver_listen = ${MGMTIP}
vncserver_proxyclient_address = ${MGMTIP}
verbose = True
core_plugin = ml2
service_plugins = router
......@@ -495,7 +491,7 @@ if [ -z "${NEUTRON_NETWORKS_DONE}" ]; then
--provider:physical_network external --provider:network_type flat
mygw=`ip route show default | sed -n -e 's/^default via \([0-9]*.[0-9]*.[0-9]*.[0-9]*\).*$/\1/p'`
mynet=`ip route show dev ${EXTERNAL_NETWORK_INTERFACE} | sed -n -e 's/^\([0-9]*.[0-9]*.[0-9]*.[0-9]*\/[0-9]*\) .*$/\1/p'`
mynet=`ip route show dev br-ex | sed -n -e 's/^\([0-9]*.[0-9]*.[0-9]*.[0-9]*\/[0-9]*\) .*$/\1/p'`
neutron subnet-create ext-net --name ext-subnet \
--allocation-pool start=${EXT_FLOAT_IP_START},end=${EXT_FLOAT_IP_END} \
......@@ -558,6 +554,8 @@ if [ -z "${CINDER_DBPASS}" ]; then
apt-get install -y cinder-api cinder-scheduler python-cinderclient
sed -i -e "s/^\\(.*volume_group.*=.*\\)$/#\1/" /etc/cinder/cinder.conf
# Just slap these in.
cat <<EOF >> /etc/cinder/cinder.conf
[database]
......@@ -568,9 +566,10 @@ rpc_backend = rabbit
rabbit_host = ${CONTROLLER}
rabbit_password = ${RABBIT_PASS}
auth_strategy = keystone
my_ip = 192.168.0.3
my_ip = ${MGMTIP}
verbose = True
glance_host = ${CONTROLLER}
volume_group = openstack-volumes
[keystone_authtoken]
auth_uri = http://$CONTROLLER:5000/v2.0
......@@ -588,6 +587,7 @@ EOF
service cinder-scheduler restart
service cinder-api restart
service cinder-volume restart
rm -f /var/lib/cinder/cinder.sqlite
echo "CINDER_DBPASS=\"${CINDER_DBPASS}\"" >> $SETTINGS
......@@ -635,7 +635,7 @@ if [ -z "${SWIFT_PASS}" ]; then
mkdir -p /etc/swift
curl -o /etc/swift/proxy-server.conf \
wget -O /etc/swift/proxy-server.conf \
https://raw.githubusercontent.com/openstack/swift/stable/juno/etc/proxy-server.conf-sample
# Just slap these in.
......@@ -673,7 +673,7 @@ EOF
sed -i -e "s/^\\(.*auth_port.*=.*\\)$/#\1/" /etc/swift/proxy-server.conf
sed -i -e "s/^\\(.*auth_protocol.*=.*\\)$/#\1/" /etc/swift/proxy-server.conf
curl -o /etc/swift/swift.conf \
wget -O /etc/swift/swift.conf \
https://raw.githubusercontent.com/openstack/swift/stable/juno/etc/swift.conf-sample
# Just slap these in.
......@@ -831,7 +831,7 @@ if [ -z "${CEILOMETER_DBPASS}" ]; then
if [ "${CEILOMETER_USE_MONGODB}" = "1" ]; then
apt-get install -y mongodb-server
sed -i -e "s/^.*bind_ip.*=.*$/bind_ip = 192.168.0.3/" /etc/mongodb.conf
sed -i -e "s/^.*bind_ip.*=.*$/bind_ip = ${MGMTIP}/" /etc/mongodb.conf
echo "smallfiles = true" >> /etc/mongodb.conf
service mongodb stop
......@@ -844,7 +844,7 @@ if [ -z "${CEILOMETER_DBPASS}" ]; then
pwd: \"${CEILOMETER_DBPASS}\",
roles: [ \"readWrite\", \"dbAdmin\" ]})"
else
apt-get install -y mariadb-server python-mysqldb
apt-get install -y mariadb-server python-mysqldb < /dev/null
echo "create database ceilometer" | mysql -u root --password="$DB_ROOT_PASS"
echo "grant all privileges on ceilometer.* to 'ceilometer'@'localhost' identified by '$CEILOMETER_DBPASS'" | mysql -u root --password="$DB_ROOT_PASS"
......
......@@ -13,10 +13,11 @@ fi
# Grab our libs
. "$DIRNAME/setup-lib.sh"
echo "*** Setting up root ssh pubkey access across all nodes..."
# All nodes need to publish public keys, and acquire others'
$DIRNAME/setup-root-ssh.sh 1> $OURDIR/setup-root-ssh.log 2>&1
HOSTNAME=`hostname -s`
if [ "$HOSTNAME" != "$NETWORKMANAGER" ]; then
exit 0;
fi
......@@ -25,36 +26,137 @@ if [ -f $SETTINGS ]; then
. $SETTINGS
fi