Break out installers.

Change-Id: Ief31a62d72003a02c9291dd0125efb46cc730579
This commit is contained in:
Alex Krzos 2015-12-22 12:40:52 -05:00
parent 82bca99726
commit 1e94748243
18 changed files with 193 additions and 106 deletions

View File

@ -20,24 +20,50 @@ On the Red Hat OpenStack Director host, as the Stack user jump into a venv w/ Ra
* Why? We started with using bash to make changes to the Overcloud, creating complex sed/awks that we get for free with Ansible (for the most part). If you prefer to not use Ansible, the older versions (no longer maintained) of the browbeat.sh can be found here. * Why? We started with using bash to make changes to the Overcloud, creating complex sed/awks that we get for free with Ansible (for the most part). If you prefer to not use Ansible, the older versions (no longer maintained) of the browbeat.sh can be found here.
# Example Install and Run # Example Install, Check and Run
On director (As stack user): Installing Browbeat and running the performance checks can be performed either from your local machine or from the undercloud. The local machine install assumes you have ansible already installed.
## Install Browbeat from your local machine
``` ```
$ ssh-copy-id stack@<undercloud-ip>
$ git clone https://github.com/jtaleric/browbeat.git $ git clone https://github.com/jtaleric/browbeat.git
$ cd browbeat/ansible $ cd browbeat/ansible
$ ./gen_hostfile.sh localhost ~/.ssh/config $ ./gen_hostfile.sh <undercloud-ip> ~/.ssh/config
$ ansible-playbook -i hosts install/setup.yml $ ansible-playbook -i hosts install/browbeat.yml
$ cd ~ ```
$ sudo yum install -y libffi-devel gmp-devel postgresql-devel
$ wget -q -O- https://raw.githubusercontent.com/openstack/rally/master/install_rally.sh | bash ## (Optional) Install shaker:
$ . ~/rally/bin/activate ```
$ . ~stack/overcloudrc $ ansible-playbook -i hosts install/shaker.yml
$ rally deployment create --fromenv --name overcloud ```
$ . ~stack/stackrc
$ cd browbeat ## (Optional) Install connmon:
$ sudo yum install -y freetype-devel libpng-devel ```
$ sudo pip install -Ur requirements.txt $ ansible-playbook -i hosts install/connmon.yml
$ ./browbeat.sh test01 ```
## (Optional) Install pbench:
```
$ ansible-playbook -i hosts install/connmon.yml
```
* pbench install is under improvement at this time and likely requires additional setup to complete install.
## Next step is to run basic performance checks
```
$ ansible-playbook -i hosts check/site.yml
```
Your performance check output is located in check/bug_report.log
## Last step is to run performance stress tests through browbeat on the undercloud:
```
$ ssh undercloud-root
[root@ospd ~]# su - stack
[stack@ospd ~]$ screen -S browbeat
[stack@ospd ~]$ . browbeat-venv/bin/activate
(browbeat-venv)[stack@ospd ~]$ cd browbeat/
(browbeat-venv)[stack@ospd browbeat]$ vi browbeat.cfg # Edit browbeat.cfg to control how many stress tests are run.
(browbeat-venv)[stack@ospd browbeat]$ ./browbeat.sh test01
...
(browbeat-venv)[stack@ospd browbeat]$ ./graphing/rallyplot.py test01
``` ```
Edit `browbeat-config` for desired tests before running `browbeat.sh`

View File

@ -1,5 +1,15 @@
# Ansible for Browbeat # Ansible for Browbeat
Playbooks to modify and performance check the overcloud
Playbooks for:
* Install Browbeat
* Install connmon
* Install pbench
* Install shaker
* Check overcloud for performance issues
* Adjust number of workers for nova/keystone
* Deploy keystone in eventlet/httpd
* Switch keystone token type to UUID/Fernet
## To use ## To use
@ -9,51 +19,65 @@ Install your public key into stack's authorized_keys
``` ```
Then run gen_hosts.sh script to generate your overcloud's hosts file for ansible and generate a "jumpbox" ssh config: Then run gen_hosts.sh script to generate your overcloud's hosts file for ansible and generate a "jumpbox" ssh config:
``` ```
# ./gen_hostfile.sh <undercloud-ip> ~/.ssh/config # ./gen_hostfile.sh <undercloud-ip> ~/.ssh/config
``` ```
**Review the hosts file the script generates. **Review the hosts file the script generates.
To modify the number of workers each service is running:
## Ansible Installers:
Install Browbeat
```
# ansible-playbook -i hosts install/browbeat.yml
```
Install Connmon
```
# ansible-playbook -i hosts install/connmon.yml
```
Install Pbench (Requires some knowledge of setting up pbench to have this functionality work completely)
```
# ansible-playbook -i hosts install/pbench.yml
```
Install Shaker
```
# ansible-playbook -i hosts install/shaker.yml
```
## Performance Checks:
Run the check playbook to identify common performance issues:
```
# ansible-playbook -i hosts check/site.yml
```
## Adjust your overcloud:
To modify the number of workers each service is running:
``` ```
# ansible-playbook -i hosts browbeat/adjustment.yml -e "workers=8" # ansible-playbook -i hosts browbeat/adjustment.yml -e "workers=8"
``` ```
Nova and Keystone will be running 8 workers per service. Nova and Keystone will be running 8 workers per service.
To modify number of workers each service is running and ensure Keystone is deployed in eventlet: To modify number of workers each service is running and ensure Keystone is deployed in eventlet:
``` ```
# ansible-playbook -i hosts browbeat/adjustment.yml -e "workers=8 keystone_deployment=eventlet" # ansible-playbook -i hosts browbeat/adjustment.yml -e "workers=8 keystone_deployment=eventlet"
``` ```
To run Keystone in httpd, change keystone_deployment to httpd: To run Keystone in httpd, change keystone_deployment to httpd:
``` ```
# ansible-playbook -i hosts browbeat/adjustment.yml -e "workers=8 keystone_deployment=httpd" # ansible-playbook -i hosts browbeat/adjustment.yml -e "workers=8 keystone_deployment=httpd"
``` ```
## Performance Checks: To switch to fernet tokens:
Run the check playbook to identify common performance issues:
``` ```
# ansible-playbook -i hosts check/site.yml # ansible-playbook -i hosts browbeat/keystone_token_type.yml -e "token_provider=fernet"
``` ```
## Ansible Installers: To switch to UUID tokens:
Install connmon/shaker
``` ```
# ansible-playbook -i hosts install/install.yml -e "connmon=true" # ansible-playbook -i hosts browbeat/keystone_token_type.yml -e "token_provider=uuid"
# ansible-playbook -i hosts install/install.yml -e "shaker=true"
# ansible-playbook -i hosts install/install.yml -e "connmon=true shaker=true"
```
Install pbench (Requires some knowledge of setting up pbench to have this functionality work completely)
```
# ansible-playbook -i hosts install/pbench.yml
``` ```

View File

@ -0,0 +1,10 @@
---
#
# Playbook to install browbeat on undercloud
#
- hosts: undercloud
remote_user: stack
roles:
- common
- browbeat

View File

@ -1,26 +1,22 @@
--- ---
# #
# Playbook to install connmon and shaker on undercloud/overcloud # Playbook to install connmon on undercloud/overcloud
# #
- hosts: undercloud - hosts: undercloud
remote_user: stack remote_user: stack
vars: vars:
connmon: false ansible_sudo: true
undercloud: true undercloud: true
shaker: false
roles: roles:
- common - common
- undercloud
- connmon - connmon
- shaker
- hosts: controller - hosts: controller
remote_user: heat-admin remote_user: heat-admin
vars: vars:
connmon: false ansible_sudo: true
undercloud: false undercloud: false
shaker: false
roles: roles:
- common - common
- connmon - connmon

View File

@ -1,6 +1,4 @@
--- ---
ansible_sudo: yes
centos_image: http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 centos_image: http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
connmon_host: 192.0.2.1 connmon_host: 192.0.2.1
dns_server: 8.8.8.8 dns_server: 8.8.8.8

View File

@ -6,6 +6,7 @@
- hosts: undercloud - hosts: undercloud
remote_user: stack remote_user: stack
vars: vars:
ansible_sudo: true
undercloud: true undercloud: true
roles: roles:
- common - common
@ -14,6 +15,7 @@
- hosts: controller - hosts: controller
remote_user: heat-admin remote_user: heat-admin
vars: vars:
ansible_sudo: true
undercloud: false undercloud: false
undercloud_root_ssh_key: "{{ lookup('file', 'roles/pbench/files/undercloud_root_id_rsa.pub') }}" undercloud_root_ssh_key: "{{ lookup('file', 'roles/pbench/files/undercloud_root_id_rsa.pub') }}"
undercloud_stack_ssh_key: "{{ lookup('file', 'roles/pbench/files/undercloud_stack_id_rsa.pub') }}" undercloud_stack_ssh_key: "{{ lookup('file', 'roles/pbench/files/undercloud_stack_id_rsa.pub') }}"

View File

@ -0,0 +1,60 @@
---
#
# Browbeat Install
#
- name: Install Browbeat dependencies
yum: name={{ item }} state=present
become: true
with_items:
- freetype-devel
- libpng-devel
- name: Install pip
become: yes
easy_install: name=pip
- name: Install virtualenv
become: true
pip: name=virtualenv
- name: Create virtualenv
command: virtualenv /home/stack/browbeat-venv creates="/home/stack/browbeat-venv"
- name: Clone Browbeat on undercloud
git: repo=https://github.com/jtaleric/browbeat.git dest=/home/stack/browbeat
when: "'localhost' not in '{{ inventory_hostname }}'"
- name: Generate hosts and ~/.ssh/config on undercloud
shell: . /home/stack/stackrc; /home/stack/browbeat/ansible/gen_hostfile.sh localhost /home/stack/.ssh/config
when: "'localhost' not in '{{ inventory_hostname }}'"
- name: Move hosts file to correct location
command: mv /home/stack/hosts /home/stack/browbeat/ansible/hosts
- name: Install requirements.txt
become: true
pip: requirements=/home/stack/browbeat/requirements.txt virtualenv=/home/stack/browbeat-venv
- name: Setup Rally database
shell: . /home/stack/browbeat-venv/bin/activate; rally-manage db recreate
- name: Setup Rally deployment
shell: . /home/stack/browbeat-venv/bin/activate; . /home/stack/overcloudrc; rally deployment create --fromenv --name overcloud
#
# Nova boot image tasks
#
- name: Fetch centos7 image
get_url: url={{ centos_image }} dest=/home/stack/centos7.qcow2
- name: Determine is centos7 image exists
shell: . /home/stack/overcloudrc; glance image-list | grep "centos7"
register: centos7_image_exists
ignore_errors: true
changed_when: false
- name: Upload centos7 image into cloud
shell: . /home/stack/overcloudrc; glance image-create --name centos7 --visibility public --disk-format=qcow2 --container-format=bare < /home/stack/centos7.qcow2
when: "'centos7' not in '{{ centos7_image_exists.stdout }}'"

View File

@ -4,4 +4,5 @@
# #
- name: Add DNS record - name: Add DNS record
become: true
lineinfile: dest=/etc/resolv.conf state=present line="nameserver {{ dns_server }}" insertafter="^search" lineinfile: dest=/etc/resolv.conf state=present line="nameserver {{ dns_server }}" insertafter="^search"

View File

@ -5,11 +5,9 @@
- name: Install pip - name: Install pip
easy_install: name=pip easy_install: name=pip
when: connmon
- name: Install connmon - name: Install connmon
pip: name=connmon pip: name=connmon
when: connmon
# #
# Connmon Setup # Connmon Setup
@ -24,10 +22,20 @@
mode=0644 mode=0644
with_items: with_items:
- ip_address: "{{ connmon_host }}" - ip_address: "{{ connmon_host }}"
when: connmon
# To remove the screen session: screen -X -S connmond kill # To remove the screen session: screen -X -S connmond kill
- name: Run connmond in screen session on undercloud - name: Run connmond in screen session on undercloud
command: screen -d -S connmond -m connmond command: screen -d -S connmond -m connmond
when: connmon and undercloud when: undercloud
changed_when: false changed_when: false
- name: check iptables
shell: iptables -nvL | grep -q "dpt:5800"
changed_when: false
when: undercloud
register: connmon_port
ignore_errors: true
- name: open up iptables
shell: /usr/sbin/iptables -I INPUT 1 -p tcp --dport 5800 -j ACCEPT
when: undercloud and connmon_port.rc == 1

View File

@ -23,14 +23,13 @@
- name: Check for connmon in keystone.conf - name: Check for connmon in keystone.conf
shell: grep -Eq 'connection\s?=\s?mysql:' /etc/keystone/keystone.conf shell: grep -Eq 'connection\s?=\s?mysql:' /etc/keystone/keystone.conf
when: connmon
register: keystone_mysql register: keystone_mysql
ignore_errors: true ignore_errors: true
changed_when: false changed_when: false
- name: Enable connmon in keystone.conf - name: Enable connmon in keystone.conf
shell: sed -i 's/mysql:/mysql+connmon:/g' /etc/keystone/keystone.conf shell: sed -i 's/mysql:/mysql+connmon:/g' /etc/keystone/keystone.conf
when: connmon and keystone_mysql.rc == 0 when: keystone_mysql.rc == 0
notify: notify:
- restart httpd - restart httpd
- unmanage keystone - unmanage keystone

View File

@ -6,13 +6,12 @@
- name: Check for connmon in neutron.conf - name: Check for connmon in neutron.conf
shell: grep -Eq 'connection\s?=\s?mysql:' /etc/neutron/neutron.conf shell: grep -Eq 'connection\s?=\s?mysql:' /etc/neutron/neutron.conf
register: neutron_mysql register: neutron_mysql
when: connmon
ignore_errors: true ignore_errors: true
changed_when: false changed_when: false
- name: Enable Connmon in neutron.conf - name: Enable Connmon in neutron.conf
shell: sed -i 's/mysql:/mysql+connmon:/g' /etc/neutron/neutron.conf shell: sed -i 's/mysql:/mysql+connmon:/g' /etc/neutron/neutron.conf
when: connmon and neutron_mysql.rc == 0 when: neutron_mysql.rc == 0
notify: notify:
- unmanage neutron-server - unmanage neutron-server
- restart neutron-server - restart neutron-server

View File

@ -6,13 +6,12 @@
- name: Check for connmon in nova.conf - name: Check for connmon in nova.conf
shell: grep -Eq 'connection\s?=\s?mysql:' /etc/nova/nova.conf shell: grep -Eq 'connection\s?=\s?mysql:' /etc/nova/nova.conf
register: nova_mysql register: nova_mysql
when: connmon
ignore_errors: true ignore_errors: true
changed_when: false changed_when: false
- name: Enable Connmon in nova.conf - name: Enable Connmon in nova.conf
shell: sed -i 's/mysql:/mysql+connmon:/g' /etc/nova/nova.conf shell: sed -i 's/mysql:/mysql+connmon:/g' /etc/nova/nova.conf
when: connmon and nova_mysql.rc == 0 when: nova_mysql.rc == 0
notify: notify:
- unmanage nova services - unmanage nova services
- restart nova services - restart nova services

View File

@ -1,15 +0,0 @@
---
#
# Tasks for undercloud to run browbeat with connmon
#
- name: check iptables
shell: iptables -nvL | grep -q "dpt:5800"
changed_when: false
when: connmon
register: connmon_port
ignore_errors: true
- name: open up iptables
shell: /usr/sbin/iptables -I INPUT 1 -p tcp --dport 5800 -j ACCEPT
when: connmon and connmon_port.rc == 1

View File

@ -1,33 +0,0 @@
---
#
# Playbook to setup undercloud for browbeat
#
- hosts: undercloud
remote_user: stack
vars:
undercloud: true
gather_facts: false
roles:
- common
tasks:
- name: Fetch centos7 image
get_url: url={{ centos_image }} dest=/home/stack/centos7.qcow2
- name: Determine is centos7 image exists
shell: . /home/stack/overcloudrc; glance image-list | grep "centos7"
register: centos7_image_exists
ignore_errors: true
changed_when: false
- name: Upload centos7 image into cloud
shell: . /home/stack/overcloudrc; glance image-create --name centos7 --disk-format=qcow2 --container-format=bare < /home/stack/centos7.qcow2
when: "'centos7' not in '{{ centos7_image_exists.stdout }}'"
- name: Get centos7 image id
shell: . /home/stack/overcloudrc; glance image-list | grep "centos7" | awk '{print $2}'
register: centos7_image_id
changed_when: false
- name: Set centos7 image public
shell: . /home/stack/overcloudrc; glance image-update --visibility public {{ centos7_image_id.stdout }}

View File

@ -0,0 +1,12 @@
---
#
# Playbook to install shaker on undercloud/overcloud
#
- hosts: undercloud
remote_user: stack
vars:
ansible_sudo: true
roles:
- common
- shaker

View File

@ -1,5 +1,6 @@
ansible ansible
matplotlib matplotlib
rally
# For pbench-agent compatibility: # For pbench-agent compatibility:
configtools configtools