Skip to content

Instantly share code, notes, and snippets.

@johnduarte
Last active December 6, 2017 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnduarte/421ccf97b6f9a25f0bb8e9d9f3ab2ebe to your computer and use it in GitHub Desktop.
Save johnduarte/421ccf97b6f9a25f0bb8e9d9f3ab2ebe to your computer and use it in GitHub Desktop.
Testing rpc-openstack

Testing rpc-openstack

This document will illustrate the steps for testing against a local checkout of the rpc-openstack repository using either a Phobos instance or a Vagrant instance running in VirtualBox.

The presence of VirtualBox and Vagrant on your development system along with a checkout of the rpc-openstack repo are assumed. The installation of this software is left as an exercise for the user.

Phobos

Using a Phobos instance is recommended. The vm-osa-aio flavor specified below delivers 16GB of ram which makes running the testing suite MUCH faster.

If you intend to use a Phobos instance, follow the steps in this section. If you intend to use Vagrant, skip to the next section.

Create Instance

  1. Connect to Phobos VPN
  2. Log in to horizon interface at https://172.20.4.10
  3. Select Instances under the Compute menu
  4. Click the Launch Instance button
  5. Enter desired name of instance
  6. Click Next > button
  7. Choose Image from the Select Boot Source field
  8. Enter 100 in the Volume Size (GB) field
  9. Click the + button to the right of either Ubuntu 14.04 LTS or Ubuntu 16.04 from the available image list depending on your desired platform
  10. Click Next > button
  11. Click the + button to the right of vm-osa-aio flavor
  12. Click Next > button
  13. Click the + button to the right of ironic network
  14. Click the Launch Instance button

Copy repo

Copy your working git repo to your Phobos instance

scp -r <path/to/repo> ubuntu@<ip.of.phobos.instance>:.
ssh ubuntu@<ip.of.phobos.instance> sudo ln -s /home/ubuntu/rpc-openstack /opt/rpc-openstack

Vagrant

If you intend to use a Vagrant instance, follow the steps in this section. If you intend to use Phobos, follow the steps in the previous section.

Create and provision

Create a Vagrantfile with the following content. This will pull down the official Ubuntu Trusty vagrant image and copy the contents of the rpc-openstack repo to the provisioned vagrant instance.

cat > Vagrantfile << EOF
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.provision "file", source: "$HOME/Documents/src/rpc-openstack", destination: "rpc-openstack"
end
EOF

Provision the vagrant instance

vagrant up

Resize Image

Unfortunately, the base image is too small to deploy rpc-openstack on. We need to expand the size of the disk from 40GB to 80GB. This process is a bit involved, but bare with me.

Ref: https://gist.github.com/christopher-hopper/9755310 Ref: https://tvi.al/resize-sda1-disk-of-your-vagrant-virtualbox-vm/ Ref: https://www.virtualbox.org/manual/ch08.html

Shutdown the vagrant instance

vagrant halt

Resize VM disk image

Get full name of vm

VMNAME=$(VBoxManage  list vms | grep $(basename $(pwd)) | awk '{ print $1 }' | tr -d \")

Verify get path of disk image file. The path is expected to be $HOME/VirtualBox\ VMs/$VMNAME and the file name is expected to be box-disk1.vmdk. If the values for your system are different, please substitute accordingly in the commands that follow this one.

VBoxManage showvminfo $VMNAME | grep vmdk

Clone and resize disk image to 80GB

pushd  $HOME/VirtualBox\ VMs/$VMNAME
VBoxManage clonehd "box-disk1.vmdk" "clone-disk1.vdi" --format vdi
VBoxManage modifyhd "clone-disk1.vdi" --resize 81920

Get name of storage controller. This is expected to be SATAController, please substitute accordingly in the command that follows this one.

VBoxManage showvminfo $VMNAME | grep "Storage Controller Name"

Attach resized device

VBoxManage storageattach $VMNAME --storagectl "SATAController" --port 0 --device 0 --type hdd --medium clone-disk1.vdi

Reboot

Restart the vagrant image and confirm that the root storage device is now set to 80GB.

popd
vagrant up
vagrant ssh
df -h | grep /$

Link repo to /opt

ln -s /home/vagrant/rpc-openstack /opt/rpc-openstack

Ceph

This section includes the steps to test a ceph deploy

Requirements

If you are running in Vagrant, the generated hostname will cause the lxc container names to exceed the maximum length. You need to change the hostname to a shorter value. This step should not be necessary if you are using a Phobos instance.

hostname vtrusty

Setup environment for running the gating test suites. SSH onto the test instance and perform the following:

sudo su -
apt-get update
apt-get install -y git-core
apt-get install -y screen
cat > .screenrc << EOF
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'
EOF
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python get-pip.py
screen

Checkout the desired branch and run the test suites

cd /opt/rpc-openstack
git checkout kilo
git submodule init
git submodule update --recursive
export RE_JOB_ACTION=deploy
export RE_JOB_SCENARIO=ceph
gating/post_merge_test/pre
gating/post_merge_test/run

TODO

Add other deployment scenarios here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment