Updates to devstack build profile

This patch adds the ability to specify which devstack branch to use,
adds Heat and Neutron by default (the latter replacing the deprecated
Nova networking), and corrects an intermittent glitch in the detection
of a completed stack.sh.

The documentation has also been updated, including new steps for
deploying the new version.

Change-Id: I9dbe99973be16fc2785e02ff92e052b5f37ccde9
This commit is contained in:
David Schroeder 2016-02-29 16:08:40 -07:00
parent c1da663a49
commit d5e160f078
6 changed files with 50 additions and 30 deletions

View File

@ -13,6 +13,7 @@ The following services are enabled:
- Heat - Heat
- Horizon - Horizon
- Keystone - Keystone
- Neutron
- Nova - Nova
- Swift - Swift
@ -28,28 +29,40 @@ the VM is booted, all DevStack processes will start automatically.
From within this directory, run this command to build the server: From within this directory, run this command to build the server:
`vagrant up` `vagrant up`
You may optionally change the devstack branch from which to build by editing
`devstack_branch` in `ds-build.yml`.
The DevStack installation will take a long time, and you can follow its The DevStack installation will take a long time, and you can follow its
progress from another terminal by running `vagrant ssh` and then progress from another terminal by running `vagrant ssh` and then
`tail -f /opt/stack/logs/stack.sh.log` `tail -F /opt/stack/logs/stack.sh.log`
## Packaging for VagrantCloud ## Packaging for HashiCorp Atlas (formerly VagrantCloud)
To ensure that this VM can provision its own instances, launch and delete To ensure that this VM can provision its own instances, launch and delete
an instance prior to packging for VagrantCloud. an instance prior to packging for VagrantCloud.
- Open http://192.168.10.5 in a web browser 1. Open http://192.168.10.5 in a web browser
- Log in using default admin credentials specified above 2. Log in using default admin credentials specified above
- Click on 'Project' at left, then 'Instances' 3. Click on 'Project' at left, then 'Instances'
- Click the 'Launch Instance' button 4. Click the 'Launch Instance' button
- Enter an Instance Name, any name will do 5. Enter an Instance Name, any name will do
- Select Flavor 'm1.tiny' 6. Select Flavor 'm1.tiny'
- Set Instance Boot Source to 'Boot from image' 7. Set Instance Boot Source to 'Boot from image'
- Choose 'cirros' as the Image Name 8. Choose 'cirros' as the Image Name
- Click the 'Launch' button 9. Click the 'Launch' button
- Once the image is created successfully, terminate it 10. Once the image is created successfully, terminate it
- Sign out from the web interface; you are now ready to package the box image 11. Repeat steps 4-10 as needed for any other OS images
12. Sign out from the web interface; you are now ready to package the box image
From within the `ds-build` directory, run this command to build a new 13. From within the `ds-build` directory, run this command to build a new HashiCorp Atlas box image:
VagrantCloud box image:
``` ```
box='devstack.box'; [ -e ../$box ] && rm -v ../$box ; vagrant package devstack --output $box box='devstack.box'; [ -e ../$box ] && rm -v ../$box ; vagrant package devstack --output $box
``` ```
## Deploying a new Monasca devstack box version
1. Rename devstack.box to include an incremented version number, as in `mv devstack.box devstack-0.2.1.box` (from the `monasca-vagrant` directory)
2. Log in to MediaFire account, click Upload, select 'Upload' -> 'From computer', click the + sign and select the new .box file, select 'Begin Upload'
3. Once uploaded, select the copy link icon to copy a direct download URL to the clipboard
4. Log in to [Hasicorp Atlas](https://atlas.hashicorp.com/session) as the 'monasca' user
5. Go to the [list of monasca/devstack box versions](https://atlas.hashicorp.com/monasca/boxes/devstack)
6. Select 'New version' on the left
7. Enter version number and a description, click 'Create version', then 'Create new provider'
8. Set 'Provider' to 'virtualbox', choose 'URL', and paste the file sharing URL copied from MediaFire, click 'Create provider'
9. Click on the text link 'unreleased', then 'Release version'

View File

@ -3,6 +3,7 @@
vars: vars:
unpriv_user: vagrant unpriv_user: vagrant
unpriv_home: /home/{{unpriv_user}} unpriv_home: /home/{{unpriv_user}}
devstack_branch: stable/liberty
roles: roles:
- {role: devstack-build, tags: [devstack]} - {role: devstack-build, tags: [devstack]}

View File

@ -1,3 +1,4 @@
--- ---
unpriv_user: vagrant unpriv_user: vagrant
unpriv_home: /home/{{unpriv_user}} unpriv_home: /home/{{unpriv_user}}
devstack_branch: master

View File

@ -14,26 +14,27 @@ KEYSTONE_TOKEN_FORMAT=UUID
#KEYSTONE_SERVICE_HOST=0.0.0.0 #KEYSTONE_SERVICE_HOST=0.0.0.0
#KEYSTONE_ADMIN_BIND_HOST=0.0.0.0 #KEYSTONE_ADMIN_BIND_HOST=0.0.0.0
# Enable the swift services # Enable the Swift services
enable_service s-proxy s-object s-container s-account s-api enable_service s-proxy s-object s-container s-account s-api
## For Swift
# Swift
SWIFT_REPLICAS=1 SWIFT_REPLICAS=1
SWIFT_HASH=011688b44136573e209e SWIFT_HASH=011688b44136573e209e
# Heat
enable_service designate designate-central designate-api designate-pool-manager designate-mdns
enable_service heat h-api h-api-cfn h-api-cw h-eng
# Fedora image (required for heat)
#IMAGE_URLS+=",https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img,https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-23-20151030.x86_64.qcow2"
IMAGE_URLS+=",https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-23-20151030.x86_64.qcow2"
# Ceilometer # Ceilometer
# Enable the ceilometer metering services
enable_service ceilometer-acompute ceilometer-acentral ceilometer-anotification ceilometer-collector enable_service ceilometer-acompute ceilometer-acentral ceilometer-anotification ceilometer-collector
# Enable the ceilometer alarming services
enable_service ceilometer-alarm-evaluator ceilometer-alarm-notifier enable_service ceilometer-alarm-evaluator ceilometer-alarm-notifier
# Enable the ceilometer api services
enable_service ceilometer-api enable_service ceilometer-api
# Neutron (disabled for now) # Neutron
#Q_PLUGIN=linuxbridge disable_service n-net
#disable_service n-net enable_service neutron q-svc q-agt q-dhcp q-l3 q-meta q-lbaas
#enable_service neutron q-svc q-agt q-dhcp q-l3 q-meta
#enable_service q-fwaas q-vpn q-metering #enable_service q-fwaas q-vpn q-metering

View File

@ -9,7 +9,7 @@
copy: src=local.conf dest={{unpriv_home}}/local.conf mode=0755 owner={{unpriv_user}} copy: src=local.conf dest={{unpriv_home}}/local.conf mode=0755 owner={{unpriv_user}}
- name: Install autostack.sh script - name: Install autostack.sh script
copy: src=autostack.sh dest={{unpriv_home}}/autostack.sh mode=0755 owner={{unpriv_user}} template: src=autostack.sh.j2 dest={{unpriv_home}}/autostack.sh mode=0755 owner={{unpriv_user}}
- name: Run DevStack installer (may take 30-90 minutes, depending on bandwidth) - name: Run DevStack installer (may take 30-90 minutes, depending on bandwidth)
command: "{{unpriv_home}}/autostack.sh {{unpriv_user}}" command: "{{unpriv_home}}/autostack.sh {{unpriv_user}}"

View File

@ -7,6 +7,7 @@ IFS="
unpriv_user=$1 unpriv_user=$1
basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
log='/opt/stack/logs/stack.sh.log' log='/opt/stack/logs/stack.sh.log'
branch={{ devstack_branch }}
usage="Usage: autostack.sh [username] usage="Usage: autostack.sh [username]
where [username] is an unprivileged user under whom all DevStack where [username] is an unprivileged user under whom all DevStack
@ -32,6 +33,9 @@ su $unpriv_user -c "git clone https://github.com/openstack-dev/devstack.git || e
echo "Copying local.conf" echo "Copying local.conf"
cp $basedir/local.conf $basedir/devstack cp $basedir/local.conf $basedir/devstack
# Select branch
echo "Selecting devstack branch $branch"
su $unpriv_user -c "cd $basedir/devstack/ && git checkout $branch"
# Kick off stack.sh in the background # Kick off stack.sh in the background
echo "Running stack.sh (this will take a while, output in $log)" echo "Running stack.sh (this will take a while, output in $log)"
@ -44,7 +48,7 @@ retrystring='git call failed: \[git clone'
success=0 success=0
while [ "$success" = 0 ]; do while [ "$success" = 0 ]; do
if [ `tail -6 $log 2>/dev/null |grep -c "$donestring"` -gt 0 ]; then if [ `tail -6 $log 2>/dev/null |grep -ic "$donestring"` -gt 0 ]; then
success=1 success=1
elif [ `tail -2 $log 2>/dev/null |grep -c "$retrystring"` -gt 0 ]; then elif [ `tail -2 $log 2>/dev/null |grep -c "$retrystring"` -gt 0 ]; then
pkill -f devstack/stack.sh pkill -f devstack/stack.sh