1
0
mirror of https://github.com/gryf/openstack.git synced 2025-12-17 11:30:24 +01:00

Open-source the OpenStack DB migration scripts and workshop

This commit is contained in:
PTC
2018-11-07 14:11:17 -08:00
parent 002a4a71c7
commit 875239ca08
20 changed files with 1053 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
[defaults]
host_key_checking=False
pipelining=True
forks=100

View File

@@ -0,0 +1,24 @@
kolla_base_distro: "centos"
kolla_install_type: "source"
openstack_release: "ocata"
kolla_internal_vip_address: "192.168.33.25"
network_interface: "eth1"
enable_heat: "no"
enable_horizon: "no"
database_password: "kolla"
keystone_admin_password: "steakfordinner"
nova_database_password: "nova"
nova_api_database_password: "nova"
rabbitmq_user: "guest"
rabbitmq_password: "guest"
keystone_token_provider: "fernet"
glance_database_password: "kolla"
glance_keystone_password: "glance"
keystone_database_password: "kolla"
nova_keystone_password: "nova"
neutron_database_password: "password"
neutron_keystone_password: "neutron"
placement_keystone_user: "nova"
placement_keystone_password: "nova"

View File

@@ -0,0 +1,39 @@
#!/bin/bash
# Copyright 2018, Oath Inc.
# Licensed under the terms of the MIT license. See LICENSE file for terms.
set -e
set -x
ROOT_DIR=/vagrant/ocata
yum remove -y docker-ce || :
rm -f /etc/yum.repos.d/docker-ce.repo || :
umount /var/lib/docker/devicemapper/ || :
rm -rf /var/lib/docker/ || :
yum install -y epel-release
yum install -y python-pip python-devel libffi-devel gcc openssl-devel libselinux-python git
pip install -U pip
[ -e ${ROOT_DIR}/kolla-ansible ] || git clone https://github.com/openstack/kolla-ansible.git ${ROOT_DIR}/kolla-ansible -b stable/ocata
pip install ${ROOT_DIR}/kolla-ansible
pip install "ansible>=2,<2.4" virtualenv
[ -e /etc/ansible ] || mkdir /etc/ansible
cp ${ROOT_DIR}/ansible.cfg /etc/ansible/
[ -e /etc/kolla ] || cp -r ${ROOT_DIR}/kolla-ansible/etc/kolla /etc/
kolla-genpwd
mkdir -p /etc/kolla/config/nova/
cat > /etc/kolla/config/nova/nova-compute.conf <<EOF
[libvirt]
virt_type = qemu
cpu_mode = none
EOF
cp ${ROOT_DIR}/kolla-ansible/ansible/inventory/all-in-one ${ROOT_DIR}
kolla-ansible -i ${ROOT_DIR}/all-in-one --extra @${ROOT_DIR}/extra.yaml bootstrap-servers
kolla-ansible -i ${ROOT_DIR}/all-in-one --extra @${ROOT_DIR}/extra.yaml prechecks
kolla-ansible -i ${ROOT_DIR}/all-in-one --extra @${ROOT_DIR}/extra.yaml pull
kolla-ansible -i ${ROOT_DIR}/all-in-one --extra @${ROOT_DIR}/extra.yaml deploy
docker exec openvswitch_db ovs-vsctl set interface eth1 type=internal
kolla-ansible --extra @${ROOT_DIR}/extra.yaml post-deploy
cp /etc/kolla/admin-openrc.sh /home/vagrant

View File

@@ -0,0 +1,11 @@
#!/bin/bash
# Copyright 2018, Oath Inc.
# Licensed under the terms of the MIT license. See LICENSE file for terms.
set -e
set -x
ROOT_DIR=/vagrant/ocata
docker rm -f $(docker ps -aq)
kolla-ansible -i ${ROOT_DIR}/all-in-one --extra @${ROOT_DIR}/extra.yaml bootstrap-servers
kolla-ansible -i ${ROOT_DIR}/all-in-one --extra @${ROOT_DIR}/extra.yaml deploy

View File

@@ -0,0 +1,10 @@
#!/bin/bash
# Copyright 2018, Oath Inc.
# Licensed under the terms of the MIT license. See LICENSE file for terms.
mysql -h192.168.33.10 -uroot -pkolla -e "show databases" | grep -v Database | grep -v mysql| grep -v information_schema| gawk '{print "drop database " $1 ";select sleep(0.1);"}' | mysql -h192.168.33.10 -uroot -pkolla
mysql -h192.168.33.10 -uroot -pkolla < ocata_db_dump.sql
cp -r instances/ /var/lib/docker/volumes/nova_compute/_data
cp -r images/ /var/lib/docker/volumes/glance/_data
chown --reference=/var/lib/docker/volumes/nova_compute/_data -R /var/lib/docker/volumes/nova_compute/_data
chown --reference=/var/lib/docker/volumes/glance/_data -R /var/lib/docker/volumes/glance/_data

View File

@@ -0,0 +1,5 @@
#!/bin/bash
# Copyright 2018, Oath Inc.
# Licensed under the terms of the MIT license. See LICENSE file for terms.
docker stop $(docker ps --format '{{.ID}} {{.Names}}' | grep -v maria | awk '{print $1}')