Initial Commit

This commit is contained in:
James Slagle 2014-02-13 07:57:57 -05:00
commit ce9faf8073
22 changed files with 417 additions and 0 deletions

16
Overcloud.md Normal file
View File

@ -0,0 +1,16 @@
Overcloud
=========
Once the Overcloud has deployed, you can use the devtest instructions to
interact with it. Start off with step 11 from
http://docs.openstack.org/developer/tripleo-incubator/devtest_overcloud.html.
You won't be able to follow the steps exactly. Here's what you need to modify:
* When $TRIPLEO_ROOT is used, replace with /opt/stack instead
* When running setup-neutron, correct subnet ranges will need to be used if
192.0.2.0/24 is not applicable to the environment.
* When loading the user.qcow2 image into glance, I would use a cirros image
instead. Download the cirros image from
https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
and specify the path to the downloaded file when you run the glance command.

100
README.md Normal file
View File

@ -0,0 +1,100 @@
Undercloud Install via instack
==============================
1. Clone this repository
git clone https://github.com/slagle/instack
2. Create and edit your answers file. The descriptions of the parameters that
can be set are in the sample answers file.
cd instack
cp instack.answers.sample instack.answers
# Return back to directory where instack was cloned
cd ..
3. Run script to install undercloud. The script will produce a lot of output on
the sceen. It also logs to ~/.instack/install-undercloud.log. You should see
`install-undercloud Complete!` at the end of a successful run.
instack/scripts/install-undercloud
4. The install script has to manipulate your $PATH (until we get everything
packaged), so you'll need to start a new shell.
bash
4. Copy the stackrc file to your homedir so that you can use it a normal user.
sudo cp /root/stackrc .
sudo chown $USER: stackrc
source stackrc
4. Add your ssh key pair to nova
user-config
5. Download the deployment kernel and ramdisk
curl -L -O http://fedorapeople.org/~slagle/slagle-tripleo-images-fedora-i2/deploy-ramdisk.initramfs
curl -L -O http://fedorapeople.org/~slagle/slagle-tripleo-images-fedora-i2/deploy-ramdisk.kernel
5. Download overcloud images
curl -L -O http://file.rdu.redhat.com/~jslagle/tripleo-images-fedora-i2-dib-patches/overcloud-compute.qcow2
curl -L -O http://file.rdu.redhat.com/~jslagle/tripleo-images-fedora-i2-dib-patches/overcloud-control.qcow2
5. Load images into glance
load-image overcloud-control.qcow2
load-image overcloud-compute.qcow2
6. Use the setup-baremetal script to add your baremetal nodes
# setup-baremetal requires this to be set
export TRIPLEO_ROOT=.
# $CPU = cpu count per node
# $MEM = memory per node in MB
# $DISK = disk per node in GB
# $ARCH = architecture of each node, i386 or amd64
# $MACS = space separated list of node mac addresses
# $PM_IPS = space separated list of power management IP addresses
# $PM_USERS = space separated list of power management users
# $PM_PASSWORDS = space separated list of power management passwords
# $MACS and $PM_* variables should be in the same node order, e.g., the
# first MAC address should correspond to the first power management
# IP, etc.
setup-baremetal $CPU $MEM $DISK $ARCH "$MACS" undercloud "$PM_IPS" "$PM_USERS" "$PM_PASSWORDS"
7. Create your overcloud heat template. You can adjust COMPUTESCALE to launch
more than one compute node if you choose to.
sudo make -C /opt/stack/tripleo-heat-templates overcloud.yaml COMPUTESCALE=1
8. Create and source the overcloud passwords
setup-overcloud-passwords
source tripleo-overcloud-passwords
9. Deploy the overcloud
# Define the interface that will be bridged onto the Neutron defined
# network.
NeutronPublicInterface=eth0
# Define the overcloud libvirt type for virtualization. kvm for
# baremetal, qemu for an overcloud running in vm's.
OVERCLOUD_LIBVIRT_TYPE=kvm
heat stack-create -f /opt/stack/tripleo-heat-templates/overcloud.yaml \
-P AdminToken=${OVERCLOUD_ADMIN_TOKEN} \
-P AdminPassword=${OVERCLOUD_ADMIN_PASSWORD} \
-P CinderPassword=${OVERCLOUD_CINDER_PASSWORD} \
-P GlancePassword=${OVERCLOUD_GLANCE_PASSWORD} \
-P HeatPassword=${OVERCLOUD_HEAT_PASSWORD} \
-P NeutronPassword=${OVERCLOUD_NEUTRON_PASSWORD} \
-P NovaPassword=${OVERCLOUD_NOVA_PASSWORD} \
-P NeutronPublicInterface=$NeutronPublicInterface \
-P SwiftPassword=${OVERCLOUD_SWIFT_PASSWORD} \
-P SwiftHashSuffix=${OVERCLOUD_SWIFT_HASH} \
-P NovaComputeLibvirtType=$OVERCLOUD_LIBVIRT_TYPE \
overcloud

View File

@ -0,0 +1,47 @@
#!/bin/bash
set -eux
export DIB_REPOTYPE_nova=tar
export DIB_REPOLOCATION_nova=http://tarballs.openstack.org/nova/nova-2014.1.b2.tar.gz
# The heat icehouse-2 tarball had a blocker bug
# export DIB_REPOTYPE_heat=tar
# export
# DIB_REPOLOCATION_heat=http://tarballs.openstack.org/heat/heat-2014.1.b2.tar.gz
export DIB_REPOREF_heat=5f0f9f213c6cf2ddc3ced5600efba72785a3e939
# Getting a 403 from:
# https://googledrive.com/host/0Bwh63zyus-UlZ1dxQ08zczVRbXc/ipaddr-2.1.11.tar.gz
# so, install keystone from package
export DIB_REPOTYPE_keystone=package
# export
# DIB_REPOLOCATION_keystone=http://tarballs.openstack.org/keystone/keystone-2014.1.b2.tar.gz
export DIB_REPOTYPE_neutron=tar
export DIB_REPOLOCATION_neutron=http://tarballs.openstack.org/neutron/neutron-2014.1.b2.tar.gz
export DIB_REPOTYPE_glance=tar
export DIB_REPOLOCATION_glance=http://tarballs.openstack.org/glance/glance-2014.1.b2.tar.gz
export DIB_REPOTYPE_swift=tar
export DIB_REPOLOCATION_swift=http://tarballs.openstack.org/swift/swift-1.11.0.tar.gz
export DIB_REOTYPE_cinder=tar
export DIB_REPOLOCATION_cinder=http://tarballs.openstack.org/cinder/cinder-2014.1.b2.tar.gz
# Use packages for the clients
export DIB_REPOTYPE_python_cinderclient=package
export DIB_REPOTYPE_python_glanceclient=package
export DIB_REPOTYPE_python_heatclient=package
export DIB_REPOTYPE_python_keystoneclient=package
export DIB_REPOTYPE_python_neutronclient=package
export DIB_REPOTYPE_python_novaclient=package
export DIB_REPOTYPE_python_swiftclient=package
export DIB_REPOTYPE_python_ceilometerclient=package
export DIB_REPOTYPE_os_collect_config=tar
export DIB_REPOLOCATION_os_collect_config=http://tarballs.openstack.org/os-collect-config/os-collect-config-0.1.10.tar.gz
export DIB_REPOTYPE_os_refresh_config=tar
export DIB_REPOLOCATION_os_refresh_config=http://tarballs.openstack.org/os-refresh-config/os-refresh-config-0.0.7.tar.gz
export DIB_REPOTYPE_os_apply_config=tar
export DIB_REPOLOCATION_os_apply_config=http://tarballs.openstack.org/os-apply-config/os-apply-config-0.1.11.tar.gz

View File

@ -0,0 +1,15 @@
#!/bin/bash
set -eux
# Clean up from any previous runs...
# TODO: figure out if we want upstream patches for this along the lines of a
# "cleanup" element that cleans up the environment at the very beginning of a
# run.
sudo rm -rf \
/var/lib/use-ephemeral \
/etc/neutron/plugin.ini \
/opt/stack \
/usr/local/bin/* \
/mnt/state \
/var/lib/heat-cfntools

View File

@ -0,0 +1,13 @@
#!/bin/bash
set -eux
# Add scripts directory from tripleo-incubator and diskimage-builder to the
# path.
# These scripts can't just be symlinked into a bin directory because they do
# directory manipulation that assumes they're in a known location.
if [ ! -e /etc/profile.d/tripleo-incubator-scripts.sh ]; then
sudo bash -c "echo export PATH='\$PATH':/opt/stack/tripleo-incubator/scripts/ >> /etc/profile.d/tripleo-incubator-scripts.sh"
sudo bash -c "echo export PATH=/opt/stack/diskimage-builder/bin/:'\$PATH' >> /etc/profile.d/tripleo-incubator-scripts.sh"
fi

View File

@ -0,0 +1,8 @@
#!/bin/bash
set -eux
# xinetd controls starting the tftpd daemon so pxelinux.0 can be downloaded.
# This is not needed upstream b/c usually it starts on boot, but we aren't
# booting an undercloud here, we're installing one.
systemctl restart xinetd

View File

@ -0,0 +1,5 @@
#!/bin/bash
set -eux
install-packages http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/rdo-release-icehouse-1.noarch.rpm

View File

@ -0,0 +1,5 @@
#!/bin/bash
set -eux
setenforce 0

View File

@ -0,0 +1,12 @@
#!/bin/bash
set -eux
# Needed for our iptables rules
yum -y erase firewalld
install-packages iptables-services
# This does not happen automatically, but is required in the systemd service
# file for iptables: ConditionPathExists=/etc/sysconfig/iptables
touch /etc/sysconfig/iptables
os-svc-enable -n iptables
os-svc-restart -n iptables

View File

@ -0,0 +1,5 @@
#!/bin/bash
set -eux
install-packages python-pbr

View File

@ -0,0 +1,5 @@
#!/bin/bash
set -eux
install-packages python-pip

View File

@ -0,0 +1,10 @@
#!/bin/bash
set -eux
# Workaround for:
# https://bugzilla.redhat.com/show_bug.cgi?id=1061045
# Go ahead and install mariadb-server, and remove the logfile with wrong
# permissions.
install-packages mariadb-server
rm -f /var/log/mariadb/mariadb.log

View File

@ -0,0 +1,7 @@
#!/bin/bash
set -eux
# Make sure ssh is enabled and running
systemctl enable sshd
systemctl start sshd

View File

@ -0,0 +1,5 @@
#!/bin/bash
set -eux

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,41 @@
[
{ "element": [
"base",
"dib-run-parts"
],
"hook": [
"root",
"pre-install"
],
"blacklist": [
"01-ccache"
]
},
{
"element": [
"undercloud-install",
"fedora",
"boot-stack",
"nova-baremetal",
"os-collect-config",
"neutron-dhcp-agent",
"undercloud-stack-config",
"selinux-permissive"
],
"hook": [
"extra-data",
"pre-install",
"install",
"post-install"
],
"exclude-element": [
"yum",
"dkms"
],
"blacklist": [
"15-fedora-remove-grub",
"51-ironicclient",
"05-fstab-rootfs-label"
]
}
]

Binary file not shown.

Binary file not shown.

55
scripts/deploy-overcloud Executable file
View File

@ -0,0 +1,55 @@
#!/bin/bash
set -eux
sudo cp /root/stackrc .
sudo chown $USER: stackrc
source stackrc
# generate ssh authentication keys if they don't exist
if [ ! -f ~/.ssh/id_rsa ]; then
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
fi
user-config
load-image overcloud-control.qcow2
load-image overcloud-compute.qcow2
# setup-baremetal requires this to be set
export TRIPLEO_ROOT=.
CPU=1
MEM=2048
DISK=30
ARCH=amd64
MACS="52:54:00:b5:bd:f0 52:54:00:f2:be:f0"
setup-baremetal $CPU $MEM $DISK $ARCH "$MACS" undercloud
sleep 30
sudo make -C /opt/stack/tripleo-heat-templates overcloud.yaml COMPUTESCALE=1
setup-overcloud-passwords
source tripleo-overcloud-passwords
# Define the interface that will be bridged onto the Neutron defined
# network.
NeutronPublicInterface=eth0
# Define the overcloud libvirt type for virtualization. kvm for
# baremetal, qemu for an overcloud running in vm's.
OVERCLOUD_LIBVIRT_TYPE=qemu
heat stack-create -f /opt/stack/tripleo-heat-templates/overcloud.yaml \
-P AdminToken=${OVERCLOUD_ADMIN_TOKEN} \
-P AdminPassword=${OVERCLOUD_ADMIN_PASSWORD} \
-P CinderPassword=${OVERCLOUD_CINDER_PASSWORD} \
-P GlancePassword=${OVERCLOUD_GLANCE_PASSWORD} \
-P HeatPassword=${OVERCLOUD_HEAT_PASSWORD} \
-P NeutronPassword=${OVERCLOUD_NEUTRON_PASSWORD} \
-P NovaPassword=${OVERCLOUD_NOVA_PASSWORD} \
-P NeutronPublicInterface=$NeutronPublicInterface \
-P SwiftPassword=${OVERCLOUD_SWIFT_PASSWORD} \
-P SwiftHashSuffix=${OVERCLOUD_SWIFT_HASH} \
-P NovaComputeLibvirtType=$OVERCLOUD_LIBVIRT_TYPE \
overcloud

68
scripts/install-undercloud Executable file
View File

@ -0,0 +1,68 @@
#!/bin/bash
set -eux
LOGFILE=~/.instack/install-undercloud.log
mkdir -p ~/.instack
exec > >(tee $LOGFILE)
exec 2>&1
# generate ssh authentication keys if they don't exist
if [ ! -f ~/.ssh/id_rsa ]; then
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
fi
sudo yum -y install python-pip
pushd instack
sudo pip install -e .
popd
# Upstream dib is fine
if [ ! -d diskimage-builder ]; then
git clone https://git.openstack.org/openstack/diskimage-builder
pushd diskimage-builder
git remote add github-slagle https://github.com/slagle/diskimage-builder.git
git fetch github-slagle
git checkout environmentd
sudo python setup.py install
popd
fi
# We need the undercloud-stack-config branch of tie
if [ ! -d tripleo-image-elements ]; then
git clone https://github.com/slagle/tripleo-image-elements
pushd tripleo-image-elements
git checkout undercloud-stack-config
popd
fi
# Needed by source-repositories
sudo yum -y install tar
INSTACK_DIR=$(dirname $0)/..
source $INSTACK_DIR/instack.answers
export LOCAL_IP
export DNSMASQ_START
export DNSMASQ_END
export LOCAL_INTERFACE
export MASQUERADE_NETWORK
export POWER_DRIVER
export VIRTUAL_POWER_USER
export VIRTUAL_POWER_HOST
export DHCP_START
export DHCP_END
export NETWORK_CIDR
export NETWORK_GATEWAY
sudo -E instack \
-p diskimage-builder/elements/ tripleo-image-elements/elements/ instack/elements \
-j instack/json-files/fedora-20-undercloud.json
sudo os-refresh-config
echo "install-undercloud Complete!"