Break out installers.
Change-Id: Ief31a62d72003a02c9291dd0125efb46cc730579
This commit is contained in:
parent
82bca99726
commit
1e94748243
58
README.md
58
README.md
@ -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.
|
||||
|
||||
|
||||
# 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
|
||||
$ cd browbeat/ansible
|
||||
$ ./gen_hostfile.sh localhost ~/.ssh/config
|
||||
$ ansible-playbook -i hosts install/setup.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
|
||||
$ . ~/rally/bin/activate
|
||||
$ . ~stack/overcloudrc
|
||||
$ rally deployment create --fromenv --name overcloud
|
||||
$ . ~stack/stackrc
|
||||
$ cd browbeat
|
||||
$ sudo yum install -y freetype-devel libpng-devel
|
||||
$ sudo pip install -Ur requirements.txt
|
||||
$ ./browbeat.sh test01
|
||||
$ ./gen_hostfile.sh <undercloud-ip> ~/.ssh/config
|
||||
$ ansible-playbook -i hosts install/browbeat.yml
|
||||
```
|
||||
|
||||
## (Optional) Install shaker:
|
||||
```
|
||||
$ ansible-playbook -i hosts install/shaker.yml
|
||||
```
|
||||
|
||||
## (Optional) Install connmon:
|
||||
```
|
||||
$ ansible-playbook -i hosts install/connmon.yml
|
||||
```
|
||||
|
||||
## (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`
|
||||
|
@ -1,5 +1,15 @@
|
||||
# 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
|
||||
|
||||
@ -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:
|
||||
|
||||
```
|
||||
# ./gen_hostfile.sh <undercloud-ip> ~/.ssh/config
|
||||
```
|
||||
**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"
|
||||
```
|
||||
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:
|
||||
|
||||
```
|
||||
# ansible-playbook -i hosts browbeat/adjustment.yml -e "workers=8 keystone_deployment=eventlet"
|
||||
```
|
||||
|
||||
To run Keystone in httpd, change keystone_deployment to httpd:
|
||||
|
||||
```
|
||||
# ansible-playbook -i hosts browbeat/adjustment.yml -e "workers=8 keystone_deployment=httpd"
|
||||
```
|
||||
|
||||
## Performance Checks:
|
||||
|
||||
Run the check playbook to identify common performance issues:
|
||||
|
||||
To switch to fernet tokens:
|
||||
```
|
||||
# ansible-playbook -i hosts check/site.yml
|
||||
# ansible-playbook -i hosts browbeat/keystone_token_type.yml -e "token_provider=fernet"
|
||||
```
|
||||
|
||||
## Ansible Installers:
|
||||
|
||||
Install connmon/shaker
|
||||
|
||||
To switch to UUID tokens:
|
||||
```
|
||||
# ansible-playbook -i hosts install/install.yml -e "connmon=true"
|
||||
# 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
|
||||
# ansible-playbook -i hosts browbeat/keystone_token_type.yml -e "token_provider=uuid"
|
||||
```
|
||||
|
10
ansible/install/browbeat.yml
Normal file
10
ansible/install/browbeat.yml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
#
|
||||
# Playbook to install browbeat on undercloud
|
||||
#
|
||||
|
||||
- hosts: undercloud
|
||||
remote_user: stack
|
||||
roles:
|
||||
- common
|
||||
- browbeat
|
@ -1,26 +1,22 @@
|
||||
---
|
||||
#
|
||||
# Playbook to install connmon and shaker on undercloud/overcloud
|
||||
# Playbook to install connmon on undercloud/overcloud
|
||||
#
|
||||
|
||||
- hosts: undercloud
|
||||
remote_user: stack
|
||||
vars:
|
||||
connmon: false
|
||||
ansible_sudo: true
|
||||
undercloud: true
|
||||
shaker: false
|
||||
roles:
|
||||
- common
|
||||
- undercloud
|
||||
- connmon
|
||||
- shaker
|
||||
|
||||
- hosts: controller
|
||||
remote_user: heat-admin
|
||||
vars:
|
||||
connmon: false
|
||||
ansible_sudo: true
|
||||
undercloud: false
|
||||
shaker: false
|
||||
roles:
|
||||
- common
|
||||
- connmon
|
@ -1,6 +1,4 @@
|
||||
---
|
||||
ansible_sudo: yes
|
||||
|
||||
centos_image: http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
|
||||
connmon_host: 192.0.2.1
|
||||
dns_server: 8.8.8.8
|
||||
|
@ -6,6 +6,7 @@
|
||||
- hosts: undercloud
|
||||
remote_user: stack
|
||||
vars:
|
||||
ansible_sudo: true
|
||||
undercloud: true
|
||||
roles:
|
||||
- common
|
||||
@ -14,6 +15,7 @@
|
||||
- hosts: controller
|
||||
remote_user: heat-admin
|
||||
vars:
|
||||
ansible_sudo: true
|
||||
undercloud: false
|
||||
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') }}"
|
||||
|
60
ansible/install/roles/browbeat/tasks/main.yml
Normal file
60
ansible/install/roles/browbeat/tasks/main.yml
Normal 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 }}'"
|
@ -4,4 +4,5 @@
|
||||
#
|
||||
|
||||
- name: Add DNS record
|
||||
become: true
|
||||
lineinfile: dest=/etc/resolv.conf state=present line="nameserver {{ dns_server }}" insertafter="^search"
|
||||
|
@ -5,11 +5,9 @@
|
||||
|
||||
- name: Install pip
|
||||
easy_install: name=pip
|
||||
when: connmon
|
||||
|
||||
- name: Install connmon
|
||||
pip: name=connmon
|
||||
when: connmon
|
||||
|
||||
#
|
||||
# Connmon Setup
|
||||
@ -24,10 +22,20 @@
|
||||
mode=0644
|
||||
with_items:
|
||||
- ip_address: "{{ connmon_host }}"
|
||||
when: connmon
|
||||
|
||||
# To remove the screen session: screen -X -S connmond kill
|
||||
- name: Run connmond in screen session on undercloud
|
||||
command: screen -d -S connmond -m connmond
|
||||
when: connmon and undercloud
|
||||
when: undercloud
|
||||
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
|
||||
|
@ -23,14 +23,13 @@
|
||||
|
||||
- name: Check for connmon in keystone.conf
|
||||
shell: grep -Eq 'connection\s?=\s?mysql:' /etc/keystone/keystone.conf
|
||||
when: connmon
|
||||
register: keystone_mysql
|
||||
ignore_errors: true
|
||||
changed_when: false
|
||||
|
||||
- name: Enable connmon in 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:
|
||||
- restart httpd
|
||||
- unmanage keystone
|
||||
|
@ -6,13 +6,12 @@
|
||||
- name: Check for connmon in neutron.conf
|
||||
shell: grep -Eq 'connection\s?=\s?mysql:' /etc/neutron/neutron.conf
|
||||
register: neutron_mysql
|
||||
when: connmon
|
||||
ignore_errors: true
|
||||
changed_when: false
|
||||
|
||||
- name: Enable Connmon in 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:
|
||||
- unmanage neutron-server
|
||||
- restart neutron-server
|
||||
|
@ -6,13 +6,12 @@
|
||||
- name: Check for connmon in nova.conf
|
||||
shell: grep -Eq 'connection\s?=\s?mysql:' /etc/nova/nova.conf
|
||||
register: nova_mysql
|
||||
when: connmon
|
||||
ignore_errors: true
|
||||
changed_when: false
|
||||
|
||||
- name: Enable Connmon in 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:
|
||||
- unmanage nova services
|
||||
- restart nova services
|
||||
|
@ -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
|
@ -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 }}
|
12
ansible/install/shaker.yml
Normal file
12
ansible/install/shaker.yml
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
#
|
||||
# Playbook to install shaker on undercloud/overcloud
|
||||
#
|
||||
|
||||
- hosts: undercloud
|
||||
remote_user: stack
|
||||
vars:
|
||||
ansible_sudo: true
|
||||
roles:
|
||||
- common
|
||||
- shaker
|
@ -1,5 +1,6 @@
|
||||
ansible
|
||||
matplotlib
|
||||
rally
|
||||
|
||||
# For pbench-agent compatibility:
|
||||
configtools
|
||||
|
Loading…
Reference in New Issue
Block a user