summaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
Diffstat (limited to 'deploy')
-rw-r--r--deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml9
-rwxr-xr-xdeploy/adapters/ansible/roles/config-osa/files/collect-log.sh17
-rw-r--r--deploy/adapters/ansible/roles/config-osa/files/collect-log.yml32
-rw-r--r--deploy/adapters/ansible/roles/config-osa/files/haproxy.yml11
-rw-r--r--deploy/adapters/ansible/roles/config-osa/files/polling.yaml6
-rw-r--r--deploy/adapters/ansible/roles/config-osa/files/user_ceph.yml10
-rwxr-xr-xdeploy/adapters/ansible/roles/config-osa/tasks/main.yml16
-rw-r--r--deploy/adapters/ansible/roles/config-osa/tasks/meters.yml12
-rwxr-xr-xdeploy/adapters/ansible/roles/post-osa/handlers/main.yml14
-rwxr-xr-xdeploy/adapters/ansible/roles/post-osa/tasks/ceilometer-upgrade.yml28
-rw-r--r--deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml17
-rw-r--r--deploy/adapters/ansible/roles/post-osa/tasks/main.yml16
-rw-r--r--deploy/adapters/ansible/roles/post-osa/tasks/tacker_horizon.yml33
-rw-r--r--deploy/adapters/ansible/roles/post-osa/vars/main.yml23
-rw-r--r--deploy/adapters/ansible/roles/storage/vars/main.yml2
-rwxr-xr-xdeploy/compass_vm.sh2
-rw-r--r--deploy/conf/virtual.conf1
-rwxr-xr-xdeploy/host_virtual.sh7
-rwxr-xr-xdeploy/network.sh13
19 files changed, 249 insertions, 20 deletions
diff --git a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
index f923d0d3..6ea57c04 100644
--- a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
+++ b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
@@ -45,6 +45,8 @@
- compute
- utility
- neutron_server
+ - ceilometer_all
+ - horizon_all
remote_user: root
roles:
- post-osa
@@ -56,6 +58,13 @@
- collectd
- hosts:
+ - controller
+ remote_user: root
+ roles:
+ - influxdb
+ - grafana
+
+- hosts:
- neutron_openvswitch_agent
- compute
remote_user: root
diff --git a/deploy/adapters/ansible/roles/config-osa/files/collect-log.sh b/deploy/adapters/ansible/roles/config-osa/files/collect-log.sh
new file mode 100755
index 00000000..7f51a2c3
--- /dev/null
+++ b/deploy/adapters/ansible/roles/config-osa/files/collect-log.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2018 HUAWEI TECHNOLOGIES CO.,LTD and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+set -o errexit
+set -o nounset
+set -o pipefail
+
+SCRIPT_PATH="$(dirname $(realpath ${BASH_SOURCE[0]}))"
+
+openstack-ansible $SCRIPT_PATH/collect-log.yml
diff --git a/deploy/adapters/ansible/roles/config-osa/files/collect-log.yml b/deploy/adapters/ansible/roles/config-osa/files/collect-log.yml
new file mode 100644
index 00000000..6e6f9e5a
--- /dev/null
+++ b/deploy/adapters/ansible/roles/config-osa/files/collect-log.yml
@@ -0,0 +1,32 @@
+---
+##############################################################################
+# Copyright (c) 2018 HUAWEI TECHNOLOGIES CO.,LTD and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+- name: Collect log
+ hosts: rsyslog[0]
+ user: root
+ tasks:
+ - name: ensure log directory exist
+ stat:
+ path: /var/log/log-storage
+ register: log_dir
+
+ - name: compress log directory
+ archive:
+ path: "{{ log_dir.stat.path }}"
+ dest: "{{ log_dir.stat.path }}/log.tar.gz"
+ format: gz
+ when: log_dir.stat.exists is defined and log_dir.stat.exists
+
+ - name: fetch the log tarball
+ fetch:
+ src: "{{ log_dir.stat.path }}/log.tar.gz"
+ dest: /opt/log.tar.gz
+ flat: "yes"
+ when: log_dir.stat.exists is defined and log_dir.stat.exists
diff --git a/deploy/adapters/ansible/roles/config-osa/files/haproxy.yml b/deploy/adapters/ansible/roles/config-osa/files/haproxy.yml
index 3085f6aa..a0a09e49 100644
--- a/deploy/adapters/ansible/roles/config-osa/files/haproxy.yml
+++ b/deploy/adapters/ansible/roles/config-osa/files/haproxy.yml
@@ -261,3 +261,14 @@ haproxy_default_services:
haproxy_backend_options:
- "httpchk GET /"
haproxy_whitelist_networks: "{{ haproxy_octavia_whitelist_networks }}"
+
+ - service:
+ haproxy_service_name: tacker
+ haproxy_backend_nodes: "{{ groups['tacker_all'] | default([]) }}"
+ haproxy_ssl: "{{ haproxy_ssl }}"
+ haproxy_port: 9890
+ haproxy_balance_type: http
+ haproxy_backend_options:
+ - "forwardfor"
+ - "httpchk"
+ - "httplog"
diff --git a/deploy/adapters/ansible/roles/config-osa/files/polling.yaml b/deploy/adapters/ansible/roles/config-osa/files/polling.yaml
new file mode 100644
index 00000000..631e3687
--- /dev/null
+++ b/deploy/adapters/ansible/roles/config-osa/files/polling.yaml
@@ -0,0 +1,6 @@
+---
+sources:
+ - name: all_pollsters
+ interval: 300
+ meters:
+ - "*"
diff --git a/deploy/adapters/ansible/roles/config-osa/files/user_ceph.yml b/deploy/adapters/ansible/roles/config-osa/files/user_ceph.yml
index 9d5f13a9..6daa1436 100644
--- a/deploy/adapters/ansible/roles/config-osa/files/user_ceph.yml
+++ b/deploy/adapters/ansible/roles/config-osa/files/user_ceph.yml
@@ -14,3 +14,13 @@ cinder_backends:
rbd_user: cinder
rbd_secret_uuid: "{{ cinder_ceph_client_uuid }}"
report_discard_supported: true
+
+gnocchi_storage_driver: ceph
+gnocchi_ceph_pool: "metrics"
+ceph_extra_components:
+ - component: gnocchi_api
+ package:
+ - "{{ python_ceph_package }}"
+ client:
+ - '{{ gnocchi_ceph_client }}'
+ service: '{{ ceph_gnocchi_service_names }}'
diff --git a/deploy/adapters/ansible/roles/config-osa/tasks/main.yml b/deploy/adapters/ansible/roles/config-osa/tasks/main.yml
index f9eef749..8bb56656 100755
--- a/deploy/adapters/ansible/roles/config-osa/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/config-osa/tasks/main.yml
@@ -332,6 +332,16 @@
when:
- "{{ hostvars[inventory_hostname]['groups']['controller'] | length < 2 }}"
+- name: copy collect-log.sh to /opt
+ copy:
+ src: collect-log.sh
+ dest: /opt/collect-log.sh
+
+- name: copy collect-log.yml to /opt
+ copy:
+ src: collect-log.yml
+ dest: /opt/collect-log.yml
+
# - name: change repore build
# lineinfile:
# dest: /etc/ansible/roles/repo_build/tasks/main.yml
@@ -345,3 +355,9 @@
- include: fix_pip_version.yml
- include: fix_rescue.yml
+
+- name: include tacker in setup-openstack
+ lineinfile:
+ dest: /opt/openstack-ansible/playbooks/setup-openstack.yml
+ insertafter: "^- include: os-trove"
+ line: "- include: os-tacker-install.yml"
diff --git a/deploy/adapters/ansible/roles/config-osa/tasks/meters.yml b/deploy/adapters/ansible/roles/config-osa/tasks/meters.yml
index 8f06a884..2b3bce5f 100644
--- a/deploy/adapters/ansible/roles/config-osa/tasks/meters.yml
+++ b/deploy/adapters/ansible/roles/config-osa/tasks/meters.yml
@@ -69,3 +69,15 @@
[database]{% raw %}
connection = mysql+pymysql://{{ ceilometer_galera_user }}:{{ ceilometer_container_db_password }}@{{ceilometer_galera_address }}/{{ ceilometer_galera_database }}?charset=utf86{% endraw %}
# yamllint enable rule:line-length
+
+- name: make sure the directory exist
+ file:
+ dest: /etc/openstack_deploy/ceilometer
+ state: directory
+ mode: 0755
+
+- name: copy the polling.yml
+ copy:
+ dest: /etc/openstack_deploy/ceilometer/polling.yaml
+ src: polling.yaml
+ mode: 0644
diff --git a/deploy/adapters/ansible/roles/post-osa/handlers/main.yml b/deploy/adapters/ansible/roles/post-osa/handlers/main.yml
index 3d979e6a..d685edca 100755
--- a/deploy/adapters/ansible/roles/post-osa/handlers/main.yml
+++ b/deploy/adapters/ansible/roles/post-osa/handlers/main.yml
@@ -9,3 +9,17 @@
- name: restart network service
shell: "/sbin/ifconfig eth0 0 &&/sbin/ifdown -a && \
/sbin/ifup --ignore-errors -a"
+
+- name: Restart ceilometer services
+ service:
+ name: "{{ item.0.service_name }}"
+ enabled: "yes"
+ state: "restarted"
+ with_subelements:
+ - "{{ ceilometer_services }}"
+ - group
+ when: inventory_hostname in groups[item.1]
+ register: _restart
+ until: _restart | success
+ retries: 5
+ delay: 2
diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/ceilometer-upgrade.yml b/deploy/adapters/ansible/roles/post-osa/tasks/ceilometer-upgrade.yml
new file mode 100755
index 00000000..3d991b74
--- /dev/null
+++ b/deploy/adapters/ansible/roles/post-osa/tasks/ceilometer-upgrade.yml
@@ -0,0 +1,28 @@
+#############################################################################
+# Copyright (c) 2017 HUAWEI TECHNOLOGIES CO.,LTD and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+- name: check for gnocchi resource file
+ stat:
+ path: "/etc/ceilometer/gnocchi_resources.yaml"
+ register: gnocchi_resource_file
+
+- name: get the path of ceilometer-upgrade
+ shell: "find / -name ceilometer-upgrade 2>/dev/null || true"
+ register: ceilometer_upgrade_path
+
+- name: Initialize Gnocchi database by creating ceilometer resources
+ command: "{{ ceilometer_upgrade_path.stdout }} --skip-metering-database"
+ become: "yes"
+ when: gnocchi_resource_file.stat.exists
+ register: _upgrade
+ until: _upgrade | success
+ retries: 10
+ delay: 2
+ notify:
+ - Restart ceilometer services
diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml b/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml
index fbed5815..d5a04e78 100644
--- a/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml
+++ b/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml
@@ -3,7 +3,7 @@
- name: install networking-sfc
pip:
name: networking-sfc
- virtualenv: /openstack/venvs/neutron-15.1.4
+ virtualenv: /openstack/venvs/neutron-{{ os_ver }}
when:
- inventory_hostname in groups['neutron_server']
@@ -11,14 +11,12 @@
package:
name: crudini
state: latest
- when:
- - inventory_hostname in groups['neutron_server']
- name: Install networking-sfc for CLI
pip:
name: networking-sfc
when:
- - inventory_hostname in groups['utility']
+ - inventory_hostname not in groups['neutron_server']
- name: turn off neutron-server on control node
service: name=neutron-server state=stopped
@@ -35,13 +33,18 @@
shell: crudini --merge /etc/neutron/neutron.conf < /opt/sfc.conf
when: inventory_hostname in groups['neutron_server']
+- name: Configure SFC extension on compute nodes
+ shell: crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini \
+ agent extensions sfc;
+ when: inventory_hostname in groups['compute']
+
- name: delete sfc.conf
shell: rm -rf {{ sfc_plugins.dst }}
when: inventory_hostname in groups['neutron_server']
- name: Perform a Neutron DB online upgrade
command: |
- /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage
+ /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-db-manage
--config-file /etc/neutron/neutron.conf
--config-file /etc/neutron/plugins/ml2/ml2_conf.ini
upgrade --expand
@@ -51,7 +54,7 @@
- name: Perform a Neutron DB offline upgrade
command: |
- /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage
+ /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-db-manage
--config-file /etc/neutron/neutron.conf
--config-file /etc/neutron/plugins/ml2/ml2_conf.ini
upgrade --contract
@@ -61,7 +64,7 @@
- name: SFC DB upgrade
command: |
- /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage
+ /openstack/venvs/neutron-{{ os_ver }}/bin/neutron-db-manage
--subproject networking-sfc
upgrade head
become: "yes"
diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/main.yml b/deploy/adapters/ansible/roles/post-osa/tasks/main.yml
index bd83b50f..fed3842f 100644
--- a/deploy/adapters/ansible/roles/post-osa/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/post-osa/tasks/main.yml
@@ -13,13 +13,19 @@
- ansible_distribution == 'Ubuntu'
# install networking-sfc for non odl scenarios
-# - include: install_networking_sfc.yml
-# when:
-# - odl_sfc is not defined or odl_sfc == "Disable"
-# - inventory_hostname not in groups['compute']
-# when: ansible_distribution == 'Ubuntu'
+- include: install_networking_sfc.yml
+ when:
+ - opendaylight is not defined or opendaylight == "Disable"
+ - inventory_hostname not in groups['horizon_all']
- include: "{{ ansible_os_family }}.yml"
when:
- ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7'
- inventory_hostname in groups['compute']
+
+- include: ceilometer-upgrade.yml
+ when:
+ - inventory_hostname in groups['ceilometer_all']
+
+- include: tacker_horizon.yml
+ when: inventory_hostname in groups['horizon_all']
diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/tacker_horizon.yml b/deploy/adapters/ansible/roles/post-osa/tasks/tacker_horizon.yml
new file mode 100644
index 00000000..2c1d2d87
--- /dev/null
+++ b/deploy/adapters/ansible/roles/post-osa/tasks/tacker_horizon.yml
@@ -0,0 +1,33 @@
+---
+
+- name: remove tacker-horizon directory
+ file:
+ path: "{{ tacker_horizon_dir }}"
+ state: absent
+
+- name: get tacker horizon (online)
+ git:
+ repo: "{{ tacker_horizon_repo }}"
+ dest: "{{ tacker_horizon_dir }}"
+ version: "{{ tacker_horizon_branch }}"
+ when: offline_deployment is defined and offline_deployment == "Disable"
+
+- name: copy installation script (offline)
+ get_url:
+ url: "http://{{ offline_repo_ip }}:{{ offline_repo_port }}/tacker-horizon.tar.gz"
+ dest: "/opt/"
+ when: offline_deployment is defined and offline_deployment == "Enable"
+
+- name: untar tacker-horizon tarball
+ command: su -s /bin/sh -c "tar xzf /opt/tacker-horizon.tar.gz -C /opt/"
+ when: offline_deployment is defined and offline_deployment == "Enable"
+
+- name: install tacker-horizon
+ shell: |
+ cd /opt/tacker-horizon/;
+ pip install -r requirements.txt;
+ sleep 30;
+ python setup.py install;
+ cp tacker_horizon/enabled/* \
+ {{ tacker_horizon_enable_path }}/;
+ service apache2 restart
diff --git a/deploy/adapters/ansible/roles/post-osa/vars/main.yml b/deploy/adapters/ansible/roles/post-osa/vars/main.yml
index da886028..95f51530 100644
--- a/deploy/adapters/ansible/roles/post-osa/vars/main.yml
+++ b/deploy/adapters/ansible/roles/post-osa/vars/main.yml
@@ -1,5 +1,17 @@
---
+os_ver: 16.0.5
+os_name: pike
+
+# yamllint disable rule:line-length
+tacker_horizon_repo: https://github.com/openstack/tacker-horizon.git
+tacker_horizon_dir: /opt/tacker-horizon
+tacker_horizon_branch: "stable/{{ os_name }}"
+openstack_release: "{{ os_ver }}"
+tacker_horizon_venv: "/openstack/venvs/horizon-{{ openstack_release }}"
+tacker_horizon_enable_path: "{{ tacker_horizon_venv }}/lib/python2.7/site-packages/openstack_dashboard/enabled"
+# yamllint enable rule:line-length
+
sfc_plugins:
src: sfc.conf
dst: /opt/sfc.conf
@@ -24,3 +36,14 @@ intf_storage: |-
{%- set intf_storage = intf_storage + '.' + compu_sys_mappings["storage"]["vlan_tag"]|string %}
{%- endif %}
{{- intf_storage }}
+
+ceilometer_services:
+ ceilometer-agent-notification:
+ group:
+ - ceilometer_agent_notification
+ service_name: ceilometer-agent-notification
+ ceilometer-polling:
+ group:
+ - ceilometer_agent_central
+ - ceilometer_agent_compute
+ service_name: ceilometer-polling
diff --git a/deploy/adapters/ansible/roles/storage/vars/main.yml b/deploy/adapters/ansible/roles/storage/vars/main.yml
index cbee9c1e..d6c5961a 100644
--- a/deploy/adapters/ansible/roles/storage/vars/main.yml
+++ b/deploy/adapters/ansible/roles/storage/vars/main.yml
@@ -7,7 +7,7 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
-host_loopback_ceph_size: "100G"
+host_loopback_ceph_size: "500G"
rc_local_insert_before: "^exit 0$"
bootstrap_host_data_disk_device: null
bootstrap_host_data_disk_device_force: "no"
diff --git a/deploy/compass_vm.sh b/deploy/compass_vm.sh
index cf215f3b..17171578 100755
--- a/deploy/compass_vm.sh
+++ b/deploy/compass_vm.sh
@@ -23,7 +23,7 @@ function check_container_alive() {
docker exec -it compass-mq bash -c "exit" 1>/dev/null 2>&1
local mq_state=$?
- if [ $((deck_state||tasks_state||cobbler_state||db_state||mq-state)) == 0 ]; then
+ if [ $((deck_state||tasks_state||cobbler_state||db_state||mq_state)) == 0 ]; then
echo "true"
else
echo "false"
diff --git a/deploy/conf/virtual.conf b/deploy/conf/virtual.conf
index 1e9034f3..1d47603d 100644
--- a/deploy/conf/virtual.conf
+++ b/deploy/conf/virtual.conf
@@ -7,3 +7,4 @@ export SWITCH_IPS="1.1.1.1"
export SWITCH_CREDENTIAL="version=2c,community=public"
export DEPLOYMENT_TIMEOUT="300"
export POLL_SWITCHES_FLAG="nopoll_switches"
+export NAT_EXTERNAL=${NAT_EXTERNAL:true}
diff --git a/deploy/host_virtual.sh b/deploy/host_virtual.sh
index 03a1230f..d955b747 100755
--- a/deploy/host_virtual.sh
+++ b/deploy/host_virtual.sh
@@ -52,6 +52,11 @@ function launch_host_vms() {
vm_template_file="$vm_template_dir/host.xml"
vm_template_arch="$vm_template_dir/host-$COMPASS_ARCH.xml"
[ -f $vm_template_arch ] && vm_template_file=$vm_template_arch
+ if [[ "$NAT_EXTERNAL" == "false" ]]; then
+ NET_IAAS="external"
+ else
+ NET_IAAS="external_nat"
+ fi
log_info "bringing up pxe boot vms"
i=0
@@ -67,7 +72,7 @@ function launch_host_vms() {
-e "s#REPLACE_IMAGE#$vm_dir/disk.img#g" \
-e "s/REPLACE_BOOT_MAC/${mac_array[i]}/g" \
-e "s/REPLACE_NET_INSTALL/install/g" \
- -e "s/REPLACE_NET_IAAS/external_nat/g" \
+ -e "s/REPLACE_NET_IAAS/$NET_IAAS/g" \
"$vm_template_file" \
> $vm_dir/libvirt.xml
diff --git a/deploy/network.sh b/deploy/network.sh
index 698771b3..eea62277 100755
--- a/deploy/network.sh
+++ b/deploy/network.sh
@@ -76,9 +76,9 @@ function setup_bridge_external()
sudo virsh net-destroy external
sudo virsh net-undefine external
- #save_network_info
+ save_network_info
sed -e "s/REPLACE_NAME/external/g" \
- -e "s/REPLACE_OVS/br-external_nat/g" \
+ -e "s/REPLACE_OVS/br-external/g" \
$COMPASS_DIR/deploy/template/network/bridge_ovs.xml \
> $WORK_DIR/network/external.xml
@@ -86,14 +86,12 @@ function setup_bridge_external()
sudo virsh net-start external
sudo virsh net-autostart external
- python $COMPASS_DIR/deploy/setup_vnic.py
}
function recover_bridge_external()
{
sudo virsh net-start external
- python $COMPASS_DIR/deploy/setup_vnic.py
}
function setup_nat_net() {
@@ -128,7 +126,12 @@ function recover_nat_net() {
function setup_virtual_net() {
setup_nat_net install $INSTALL_GW $INSTALL_NETMASK
- setup_nat_net external_nat $EXT_NAT_GW $EXT_NAT_MASK $EXT_NAT_IP_START $EXT_NAT_IP_END
+
+ if [[ "$NAT_EXTERNAL" == "false" ]]; then
+ setup_bridge_external
+ else
+ setup_nat_net external_nat $EXT_NAT_GW $EXT_NAT_MASK $EXT_NAT_IP_START $EXT_NAT_IP_END
+ fi
}
function recover_virtual_net() {