Richard Jones' Log Richard Jones' Log: OpenStack

Tue, 10 Nov 2015
Horizon development with openstack-ansible

Previously, I had written about getting openstack-ansible (was "OSAD") up and running as a development stack for Horizon to target. Things changed slightly since then, so I thought I'd write a small update post.

Mostly, follow the OSA quick start guide as-is, with a small change:

# Update repository information and install git
apt-get update && apt-get install -y git

# Clone the OSA repository
git clone https://github.com/openstack/openstack-ansible /opt/openstack-ansible

# Bootstrap the env
cd /opt/openstack-ansible
./scripts/bootstrap-ansible.sh
./scripts/bootstrap-aio.sh
At this point, we deviate from the instructions because we need to edit the configuration to expose all of the service URLs in the service catalog through the external IP address, rather than just the public URLs. This is necessary because OSA only uses the external address for the public URLs, but Horizon requires access to the admin URLs also.
# Set the internal address to the external
sed -i "s/internal_lb_vip_address:.*/internal_lb_vip_address: \"{{ external_lb_vip_address }}\"/" \
  /etc/openstack_deploy/openstack_user_config.yml​

Now we're going to edit the configuration so we don't set up all those unnecessary services. Open /etc/openstack_deploy/openstack_user_config.yml in an editor and turn off the Horizon container creation by editing:

os-infra_hosts:
  aio1:
    # Horizon is set to multiple to test clustering. This test only requires x2.
    affinity:
      horizon_container: 2
    ip: 172.29.236.100

to:

os-infra_hosts:
  aio1:
    # Horizon is set to multiple to test clustering. This test only requires x2.
    affinity:
      horizon_container: 0
    ip: 172.29.236.100

Similar edits can be made to reduce the size of the Galera and RabbitMQ clusters from 3 to 1 in the "galera_container" and "rabbit_mq_container" settings.

Now we can continue on and create the stack:

scripts/run-playbooks.sh

The stack will be empty (no networks, flavours or images) so to add some, I run:

pushd playbooks
openstack-ansible os-tempest-install.yml
popd

A Keystone endpoint will be created on port 5000 on the public IP of the host you set OSAD up on. This is the HAProxy (load-balancer) endpoint, so it's there no matter how many actual Keystones are set up by the OSAD setup.

The final step is to edit the Horizon configuration (local_settings.py) for that endpoint and to also hard-set the Keystone API version:

OPENSTACK_API_VERSIONS = {
    "identity": 3,
}

Oh, and if you're wondering what your admin password is, it's here:

# grep admin_pass /etc/openstack_deploy/user_secrets.yml
heat_stack_domain_admin_password: [some random string]
keystone_auth_admin_password: [some other random string]

To log in as "admin" you need that second password. You can edit that value to something of your own choosing after the "scripts/bootstrap-aio.sh" step above.

Fri, 15 May 2015
Easy installation of a new stack with OpenStack Ansible Deployment (OSAD)

Update: this blog post has been superseded by new instructions.

OSAD is a project that deploys OpenStack using Ansible ("OpenStack Ansible Deployment") and I decided to see whether I could use it to create the development stack I needed behind my Horizon work.

OSAD Simple Installation

The absolute simplest installation is the one the OSAD project uses for its testing using Tempest. It sets up a moderately complex stack environment (multiple Keystones, Horizons, rabbitmq backends, etc all load balanced through a configured HAProxy). You'll need a system with 8GB of RAM and 40GB of disk. You don't want it to run the actual Tempest suite though, so include RUN_TEMPEST=hellno (anything that's not "yes" will do):

apt-get update && apt-get install -y git

# Clone the source code
git clone https://github.com/stackforge/os-ansible-deployment /opt/os-ansible-deployment

# Change your directory
cd /opt/os-ansible-deployment

# Checkout your desired branch (master for bleeding edge)
git checkout kilo

# Run the script from the root directory of the cloned repository
RUN_TEMPEST=no ./scripts/gate-check-commit.sh

For my purposes, I need the following setup:

So, I need my local Horizon to talk to a remote stack, and the default OSAD install has all of the Admin services accessed locally-only. We need to reconfigure it just a little to have it expose the public interface for all of those services. We can also edit the configuration to reduce the number of services started: I don't need to set up Horizon at all, and don't need a large mysql and rabbitmq cluster either.

So, the initial steps are very similar:

# Clone the source code
git clone https://github.com/stackforge/os-ansible-deployment /opt/os-ansible-deployment
 
# Change your directory
cd /opt/os-ansible-deployment
 
# Checkout your desired branch.
git checkout master
 
# Bootstrap the env
./scripts/bootstrap-aio.sh
 
# Bootstrap Ansible
./scripts/bootstrap-ansible.sh

# Set the internal address to the external
sed -i "s/internal_lb_vip_address:.*/internal_lb_vip_address: \"{{ external_lb_vip_address }}\"/" \
  /etc/openstack_deploy/openstack_user_config.yml​

Now we're going to edit the configuration so we don't set up all those unnecessary services. Open /etc/openstack_deploy/openstack_user_config.yml in an editor and turn off the Horizon container creation by editing:

os-infra_hosts:
  aio1:
    # Horizon is set to multiple to test clustering. This test only requires x2.
    affinity:
      horizon_container: 2
    ip: 172.29.236.100

to:

os-infra_hosts:
  aio1:
    # Horizon is set to multiple to test clustering. This test only requires x2.
    affinity:
      horizon_container: 0
    ip: 172.29.236.100

Similar edits can be made to reduce the size of the Galera and RabbitMQ clusters from 3 to 1 in the "galera_container" and "rabbit_mq_container" settings.

Now we can continue on and create the stack:

# Enter the playbooks directory
pushd playbooks
# Setup all the things
openstack-ansible haproxy-install.yml
openstack-ansible setup-everything.yml
popd

The stack will be empty (no networks, flavours or images) so to add some, I run:

pushd playbooks
openstack-ansible os-tempest-install.yml
popd

This sets up the tempest environment but does not run the tests.

A Keystone endpoint will be created on port 5000 on the public IP of the host you set OSAD up on. This is the HAProxy (load-balancer) endpoint, so it's there no matter how many actual Keystones are set up by the OSAD setup.