commit ce9faf8073185a8cc8c99bd92b04ad1c378abbd7 Author: James Slagle Date: Thu Feb 13 07:57:57 2014 -0500 Initial Commit diff --git a/Overcloud.md b/Overcloud.md new file mode 100644 index 000000000..fef58723a --- /dev/null +++ b/Overcloud.md @@ -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. diff --git a/README.md b/README.md new file mode 100644 index 000000000..5d5aa39b1 --- /dev/null +++ b/README.md @@ -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 diff --git a/elements/undercloud-install/environment.d/.00-source-repo-refs.swp b/elements/undercloud-install/environment.d/.00-source-repo-refs.swp new file mode 100644 index 000000000..d6cf36054 Binary files /dev/null and b/elements/undercloud-install/environment.d/.00-source-repo-refs.swp differ diff --git a/elements/undercloud-install/environment.d/00-source-repo-refs b/elements/undercloud-install/environment.d/00-source-repo-refs new file mode 100755 index 000000000..d1aa39453 --- /dev/null +++ b/elements/undercloud-install/environment.d/00-source-repo-refs @@ -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 + + diff --git a/elements/undercloud-install/extra-data.d/00-cleanup b/elements/undercloud-install/extra-data.d/00-cleanup new file mode 100755 index 000000000..4a9dcf96d --- /dev/null +++ b/elements/undercloud-install/extra-data.d/00-cleanup @@ -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 diff --git a/elements/undercloud-install/post-install.d/50-tripleo-incubator-path b/elements/undercloud-install/post-install.d/50-tripleo-incubator-path new file mode 100755 index 000000000..e88a33f1e --- /dev/null +++ b/elements/undercloud-install/post-install.d/50-tripleo-incubator-path @@ -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 + diff --git a/elements/undercloud-install/post-install.d/90-restart-xinetd b/elements/undercloud-install/post-install.d/90-restart-xinetd new file mode 100755 index 000000000..ea22bf555 --- /dev/null +++ b/elements/undercloud-install/post-install.d/90-restart-xinetd @@ -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 diff --git a/elements/undercloud-install/pre-install.d/00-icehouse-repo b/elements/undercloud-install/pre-install.d/00-icehouse-repo new file mode 100755 index 000000000..8a59ccc98 --- /dev/null +++ b/elements/undercloud-install/pre-install.d/00-icehouse-repo @@ -0,0 +1,5 @@ +#!/bin/bash + +set -eux + +install-packages http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/rdo-release-icehouse-1.noarch.rpm diff --git a/elements/undercloud-install/pre-install.d/00-setenforce-0 b/elements/undercloud-install/pre-install.d/00-setenforce-0 new file mode 100755 index 000000000..4f00d7644 --- /dev/null +++ b/elements/undercloud-install/pre-install.d/00-setenforce-0 @@ -0,0 +1,5 @@ +#!/bin/bash + +set -eux + +setenforce 0 diff --git a/elements/undercloud-install/pre-install.d/01-iptables b/elements/undercloud-install/pre-install.d/01-iptables new file mode 100755 index 000000000..c93f7ed0b --- /dev/null +++ b/elements/undercloud-install/pre-install.d/01-iptables @@ -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 diff --git a/elements/undercloud-install/pre-install.d/01-pbr b/elements/undercloud-install/pre-install.d/01-pbr new file mode 100755 index 000000000..cc2a12d86 --- /dev/null +++ b/elements/undercloud-install/pre-install.d/01-pbr @@ -0,0 +1,5 @@ +#!/bin/bash + +set -eux + +install-packages python-pbr diff --git a/elements/undercloud-install/pre-install.d/01-pip b/elements/undercloud-install/pre-install.d/01-pip new file mode 100755 index 000000000..5d1adf518 --- /dev/null +++ b/elements/undercloud-install/pre-install.d/01-pip @@ -0,0 +1,5 @@ +#!/bin/bash + +set -eux + +install-packages python-pip diff --git a/elements/undercloud-install/pre-install.d/03-remove-mariadb-log b/elements/undercloud-install/pre-install.d/03-remove-mariadb-log new file mode 100755 index 000000000..45fb17be7 --- /dev/null +++ b/elements/undercloud-install/pre-install.d/03-remove-mariadb-log @@ -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 diff --git a/elements/undercloud-install/pre-install.d/04-sshd b/elements/undercloud-install/pre-install.d/04-sshd new file mode 100755 index 000000000..2cbf0d050 --- /dev/null +++ b/elements/undercloud-install/pre-install.d/04-sshd @@ -0,0 +1,7 @@ +#!/bin/bash + +set -eux + +# Make sure ssh is enabled and running +systemctl enable sshd +systemctl start sshd diff --git a/elements/undercloud-install/pre-install.d/skel b/elements/undercloud-install/pre-install.d/skel new file mode 100755 index 000000000..04ae68460 --- /dev/null +++ b/elements/undercloud-install/pre-install.d/skel @@ -0,0 +1,5 @@ +#!/bin/bash + +set -eux + + diff --git a/json-files/.fedora-20-undercloud.json.swo b/json-files/.fedora-20-undercloud.json.swo new file mode 100644 index 000000000..bfa24fc41 Binary files /dev/null and b/json-files/.fedora-20-undercloud.json.swo differ diff --git a/json-files/.fedora-20-undercloud.json.swp b/json-files/.fedora-20-undercloud.json.swp new file mode 100644 index 000000000..15ac13132 Binary files /dev/null and b/json-files/.fedora-20-undercloud.json.swp differ diff --git a/json-files/fedora-20-undercloud.json b/json-files/fedora-20-undercloud.json new file mode 100644 index 000000000..a06a37e1a --- /dev/null +++ b/json-files/fedora-20-undercloud.json @@ -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" + ] + } +] diff --git a/scripts/.deploy-overcloud.swp b/scripts/.deploy-overcloud.swp new file mode 100644 index 000000000..2086a1a1a Binary files /dev/null and b/scripts/.deploy-overcloud.swp differ diff --git a/scripts/.install-undercloud.swp b/scripts/.install-undercloud.swp new file mode 100644 index 000000000..47997f28f Binary files /dev/null and b/scripts/.install-undercloud.swp differ diff --git a/scripts/deploy-overcloud b/scripts/deploy-overcloud new file mode 100755 index 000000000..58557d84a --- /dev/null +++ b/scripts/deploy-overcloud @@ -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 diff --git a/scripts/install-undercloud b/scripts/install-undercloud new file mode 100755 index 000000000..adf72ce07 --- /dev/null +++ b/scripts/install-undercloud @@ -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!"