Kevin Carter a94f0a9026 Combine our two multi-node-aio processes into one
The original mnaio was built using a lot of bash and was tailored
specifically for ubuntu 14.04. The new mnaio was built using a mix of
bash and ansible and was tailored specifically for ubuntu 16.04. This
patch takes the two code bases and combines the best things from each
method and wraps it up into a single code path all written using ansible
playbooks and basic variables.

While underlying system has changed the bash environment variable syntax
for overrides remains the same. This allows users to continue with what
has become their normal work-flow while leveraging the new structure and
capabilities.

High level overview:
  * The general performance of the VMs running within the MNAIO will now
    be a lot better. Before the VMs were built within QCOW2 containers,
    while this was flexible and portable it was slower. The new
    capabilities will use RAW logical volumes and native IO.
  * New repo management starts with preseeds and allows the user to pin
    to specific repositories without having to worry about flipping them
    post build.
  * CPU overhead will be a lot less. The old VM system used an
    un-reasonable number of processors per VM which directly translated
    to sockets. The new system will use cores and a single socket
    allowing for generally better VM performance with a lot less
    overhead and resource contention on the host.
  * Memory consumption has been greatly reduced. Each VM is now
    following the memory restrictions we'd find in the gate, as a MAX.
    Most of the VMs are using 1 - 2 GiB of RAM which should be more than
    enough for our purposes.

Overall the deployment process is simpler and more flexible and will
work on both trusty and xenial out of the box with the hope to bring
centos7 and suse into the fold some time in the future.

Change-Id: Idc8924452c481b08fd3b9362efa32d10d1b8f707
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-07-28 15:35:23 +00:00

228 lines
6.1 KiB
YAML

---
# Copyright 2017, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in witing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Wait for deploy host
hosts: openstack_hosts
gather_facts: false
pre_tasks:
- name: Wait for container connectivity
wait_for_connection:
connect_timeout: 5
sleep: 10
timeout: 1200
tasks:
- name: copy host keys
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "0600"
with_items:
- src: /root/.ssh/id_rsa
dest: /root/.ssh/id_rsa
- src: /root/.ssh/id_rsa.pub
dest: /root/.ssh/id_rsa.pub
- name: un-mount deleteme mount
mount:
name: "/deleteme"
state: unmounted
- name: remote deleteme mount
mount:
name: "/deleteme"
state: absent
- name: Remove deleteme dir
file:
path: "/deleteme"
state: absent
- name: Remove deleteme lv
lvol:
vg: vg00
lv: deleteme00
force: true
state: absent
- name: Setup cinder host volume
hosts: cinder_hosts
gather_facts: false
tasks:
- name: Create cinder-volumes lv
lvol:
vg: vg00
lv: cinder-volumes00
size: 100%FREE
shrink: false
- name: Create data cinder-volumes group
lvg:
vg: cinder-volumes
pvs: "/dev/vg00/cinder-volumes00"
- name: Setup cinder host volume
hosts: swift_hosts
gather_facts: false
tasks:
- name: Remove deleteme lv
lvol:
vg: vg00
lv: "{{ item }}"
size: 4G
with_items:
- disk1
- disk2
- disk3
- name: Format swift drives
filesystem:
fstype: xfs
dev: "/dev/vg00/{{ item }}"
with_items:
- disk1
- disk2
- disk3
- name: Create drive directories
file:
path: "/srv/{{ item }}"
state: directory
owner: "root"
group: "root"
mode: "0755"
with_items:
- disk1
- disk2
- disk3
- name: Mount swift drives
mount:
name: "/srv/{{ item }}"
src: "/dev/mapper/vg00-{{ item }}"
fstype: xfs
state: mounted
with_items:
- disk1
- disk2
- disk3
- name: Setup deploy host
hosts: deploy_hosts
gather_facts: "{{ gather_facts | default(true) }}"
pre_tasks:
- name: Gather variables for each operating system
include_vars: "{{ item }}"
with_first_found:
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_os_family | lower }}.yml"
tags:
- always
tasks:
# Example read-write git checkout from github
- name: Get OSA
git:
repo: https://git.openstack.org/openstack/openstack-ansible
dest: /opt/openstack-ansible
version: "{{ osa_branch | default('master') }}"
when:
- pre_config_osa | default(true) | bool
- name: Create Basic configs
shell: cp -R etc/openstack_deploy/* /etc/openstack_deploy
args:
chdir: /opt/openstack-ansible
when:
- pre_config_osa | default(true) | bool
- name: Create base directories
file:
path: "{{ item }}"
state: directory
owner: "root"
group: "root"
mode: "0755"
with_items:
- /etc/openstack_deploy
- /etc/openstack_deploy/conf.d
- /etc/openstack_deploy/env.d
when:
- pre_config_osa | default(true) | bool
- name: Drop osa config
template:
src: "osa/openstack_user_config.yml"
dest: /etc/openstack_deploy/openstack_user_config.yml
mode: "0644"
owner: root
group: root
when:
- pre_config_osa | default(true) | bool
- name: Drop osa user variables
template:
src: "osa/user_mnaio_variables.yml"
dest: /etc/openstack_deploy/user_mnaio_variables.yml
mode: "0644"
owner: root
group: root
when:
- pre_config_osa | default(true) | bool
- name: Bootstrap ansible
command: bash ./scripts/bootstrap-ansible.sh
args:
chdir: /opt/openstack-ansible
when:
- pre_config_osa | default(true) | bool
- name: Get pip2 and pw gen deps
command: python2 /opt/get-pip.py pycrypto pyyaml
args:
chdir: /opt/openstack-ansible
when:
- pre_config_osa | default(true) | bool
- name: Create passwords
command: python2 ./scripts/pw-token-gen.py --file /etc/openstack_deploy/user_secrets.yml
args:
chdir: /opt/openstack-ansible
when:
- pre_config_osa | default(true) | bool
- name: Run OSA
command: "{{ item }}"
args:
chdir: /opt/openstack-ansible/playbooks
with_items:
- tmux new-session -d -s build-osa
- tmux select-pane -t 0
- tmux send-keys "ulimit -n 10240" C-m
- tmux send-keys "openstack-ansible setup-everything.yml" C-m
when:
- run_osa | default(true) | bool
- name: Finished notice
debug:
msg: |
OSA deploy running. To check on the state of this deployment, login
to the deploy1 VM and attach to the "build-osa" tmux session.
when:
- run_osa | default(true) | bool