From 32028d091e6832704115f3ffa0013783feb6c48e Mon Sep 17 00:00:00 2001 From: zhouya Date: Sat, 8 Apr 2017 15:48:40 +0800 Subject: support mutinode deploy in vm deployment env Change-Id: Ic9e19d4e120fc53d96d0794239cd6e421f25ea27 Signed-off-by: zhouya --- ci/deploy/deploy.sh | 44 ++++++- .../bm_environment/zte-baremetal1/network.yml | 68 ++++++----- .../config/vm_environment/zte-virtual1/deploy.yml | 2 +- .../config/vm_environment/zte-virtual2/deploy.yml | 24 ++++ .../config/vm_environment/zte-virtual2/network.yml | 60 ++++++++++ templates/virtual_environment/vms/computer01.xml | 126 +++++++++++++++++++++ templates/virtual_environment/vms/computer02.xml | 126 +++++++++++++++++++++ templates/virtual_environment/vms/controller01.xml | 126 +++++++++++++++++++++ templates/virtual_environment/vms/controller02.xml | 126 +++++++++++++++++++++ templates/virtual_environment/vms/controller03.xml | 126 +++++++++++++++++++++ 10 files changed, 795 insertions(+), 33 deletions(-) create mode 100644 deploy/config/vm_environment/zte-virtual2/deploy.yml create mode 100644 deploy/config/vm_environment/zte-virtual2/network.yml create mode 100644 templates/virtual_environment/vms/computer01.xml create mode 100644 templates/virtual_environment/vms/computer02.xml create mode 100644 templates/virtual_environment/vms/controller01.xml create mode 100644 templates/virtual_environment/vms/controller02.xml create mode 100644 templates/virtual_environment/vms/controller03.xml diff --git a/ci/deploy/deploy.sh b/ci/deploy/deploy.sh index 4ec2c2f7..eba6b581 100755 --- a/ci/deploy/deploy.sh +++ b/ci/deploy/deploy.sh @@ -69,6 +69,7 @@ POD_NAME='' TARGET_HOSTS_NUM=0 DRY_RUN=0 IS_BARE=1 +VM_MULTINODE=("computer01" "computer02" "controller01" "controller02" "controller03") # # END of variables to customize ############################################################################ @@ -153,6 +154,11 @@ VMDEPLOY_TARGET_NODE_NET=$WORKSPACE/templates/virtual_environment/networks/os-al VMDEPLOY_DAISY_SERVER_VM=$WORKSPACE/templates/virtual_environment/vms/daisy.xml VMDEPLOY_TARGET_NODE_VM=$WORKSPACE/templates/virtual_environment/vms/all_in_one.xml +VMDEPLOY_NODE=[] +for ((i=0;i<${#VM_MULTINODE[@]};i++));do + VMDEPLOY_NODE[$i]=$WORKSPACE/templates/virtual_environment/vms/${VM_MULTINODE[$i]}.xml + echo ${VMDEPLOY_NODE[$i]} +done BMDEPLOY_DAISY_SERVER_NET=$WORKSPACE/templates/physical_environment/networks/daisy.xml BMDEPLOY_DAISY_SERVER_VM=$WORKSPACE/templates/physical_environment/vms/daisy.xml @@ -253,6 +259,10 @@ function clean_up echo "=====clean up all node and network======" if [ $IS_BARE == 0 ];then clean_up all_in_one daisy2 + for ((i=0;i<${#VM_MULTINODE[@]};i++));do + virsh destroy ${VM_MULTINODE[$i]} + virsh undefine ${VM_MULTINODE[$i]} + done clean_up daisy daisy1 else virsh destroy daisy @@ -305,8 +315,19 @@ ssh $SSH_PARAS $DAISY_IP "python ${REMOTE_SPACE}/deploy/tempest.py --dha $DHA -- echo "=====create and find node======" if [ $IS_BARE == 0 ];then - qemu-img create -f qcow2 ${VM_STORAGE}/all_in_one.qcow2 200G - create_node $VMDEPLOY_TARGET_NODE_NET daisy2 $VMDEPLOY_TARGET_NODE_VM all_in_one + if [ $TARGET_HOSTS_NUM == 1 ];then + qemu-img create -f qcow2 ${VM_STORAGE}/all_in_one.qcow2 200G + create_node $VMDEPLOY_TARGET_NODE_NET daisy2 $VMDEPLOY_TARGET_NODE_VM all_in_one + else + virsh net-define $VMDEPLOY_TARGET_NODE_NET + virsh net-autostart daisy2 + virsh net-start daisy2 + for ((i=0;i<${#VM_MULTINODE[@]};i++));do + qemu-img create -f qcow2 ${VM_STORAGE}/${VM_MULTINODE[$i]}.qcow2 200G + virsh define ${VMDEPLOY_NODE[$i]} + virsh start ${VM_MULTINODE[$i]} + done + fi sleep 20 else for i in $(seq 106 110); do @@ -320,8 +341,15 @@ ssh $SSH_PARAS $DAISY_IP "python ${REMOTE_SPACE}/deploy/tempest.py --dha $DHA - echo "======daisy virtual-deploy os and openstack===========" if [ $IS_BARE == 0 ];then - virsh destroy all_in_one - virsh start all_in_one + if [ $TARGET_HOSTS_NUM == 1 ];then + virsh destroy all_in_one + virsh start all_in_one + else + for ((i=0;i<${#VM_MULTINODE[@]};i++));do + virsh destroy ${VM_MULTINODE[$i]} + virsh start ${VM_MULTINODE[$i]} + done + fi sleep 20 ssh $SSH_PARAS $DAISY_IP "python ${REMOTE_SPACE}/deploy/tempest.py --dha $DHA --network $NETWORK --install 'yes'" fi @@ -334,7 +362,13 @@ fi sleep 10 if [ $IS_BARE == 0 ];then - virsh reboot all_in_one + if [ $TARGET_HOSTS_NUM == 1 ];then + virsh reboot all_in_one + else + for ((i=0;i<${#VM_MULTINODE[@]};i++));do + virsh reboot ${VM_MULTINODE[$i]} + done + fi fi ssh $SSH_PARAS $DAISY_IP "${REMOTE_SPACE}/deploy/check_openstack_progress.sh -n $TARGET_HOSTS_NUM" if [ $? -ne 0 ]; then diff --git a/deploy/config/bm_environment/zte-baremetal1/network.yml b/deploy/config/bm_environment/zte-baremetal1/network.yml index 53f21d90..ad0ec646 100644 --- a/deploy/config/bm_environment/zte-baremetal1/network.yml +++ b/deploy/config/bm_environment/zte-baremetal1/network.yml @@ -8,52 +8,66 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +############################################################################## +# Description +# MANAGEMENT: used for PXE, vlan used +# SOTRAGE: used for storage access +# EXTERNAL: tenant public/floating IP associated network, +# requires a dedicated interface +# PUBLICAPI: used for horizon access, openstack API access +# TENANT: used for tenant access, vlan and VxLan supported, default VxLan +############################################################################## network-config-metadata: - title: 'zte-bm-deploy network config' + title: 'Deployment Adapter for baremetal POD' version: '0.1' - created: 'Mon Oct 31 2016' - comment: + created: 'Feb 2 2017' + comment: 'For Daisy initial' networks: - - cidr: '10.20.7.0/24' - gateway: '10.20.7.1' + - cidr: '192.168.71.0/24' + gateway: '192.168.71.1' ip_ranges: - - 'start': '10.20.7.4' - 'end': '10.20.7.11' + - 'start': '192.168.71.2' + 'end': '192.168.71.254' + vlan_id: 171 name: 'MANAGEMENT' - - cidr: '10.20.7.0/24' - gateway: '10.20.7.1' + - cidr: '192.168.72.0/24' + gateway: '192.168.72.1' ip_ranges: - - start: '10.20.7.4' - end: '10.20.7.11' + - 'start': '192.168.72.2' + 'end': '192.168.72.254' + vlan_id: 172 name: 'STORAGE' - - cidr: '172.10.101.0/24' - gateway: '172.10.101.0' + - cidr: '172.70.0.0/24' + gateway: '172.70.0.0' ip_ranges: - - 'start': '172.10.101.1' - 'end': '172.10.101.10' + - 'start': '172.70.0.2' + 'end': '172.70.0.100' + vlan_id: 173 'name': 'EXTERNAL' - cidr: '10.20.7.0/24' gateway: '10.20.7.1' ip_ranges: - - 'start': '10.20.7.4' - 'end': '10.20.7.11' + - 'start': '10.20.7.20' + 'end': '10.20.7.200' + vlan_id: null name: 'PUBLICAPI' - - cidr: '10.20.7.0/24' - gateway: '10.20.7.1' + - cidr: '192.168.73.0/24' + gateway: '192.168.73.1' ip_ranges: - - 'start': '10.20.7.4' - 'end': '10.20.7.11' + - 'start': '192.168.73.2' + 'end': '192.168.73.254' + vlan_id: 1130 name: 'TENANT' interfaces: - name: 'EXTERNAL' - interface: 'ens12f1' + interface: 'ens44f1' - name: 'MANAGEMENT' - interface: 'ens4f0' + interface: 'ens12f0' - name: 'PUBLICAPI' interface: 'ens4f0' - name: 'STORAGE' - interface: 'ens4f0' + interface: 'ens12f1' - name: 'TENANT' - interface: 'ens4f0' -internal_vip: '10.20.7.12' -public_vip: '10.20.7.12' + interface: 'ens44f0' +internal_vip: '192.168.71.10' +public_vip: '10.20.7.11' diff --git a/deploy/config/vm_environment/zte-virtual1/deploy.yml b/deploy/config/vm_environment/zte-virtual1/deploy.yml index 12fa1690..14508fae 100644 --- a/deploy/config/vm_environment/zte-virtual1/deploy.yml +++ b/deploy/config/vm_environment/zte-virtual1/deploy.yml @@ -10,4 +10,4 @@ disks: daisy_passwd: 'r00tme' daisy_ip: '10.20.11.2' daisy_gateway: '10.20.11.1' -ceph_disk_name: '/dev/sdb' +ceph_disk_name: '' diff --git a/deploy/config/vm_environment/zte-virtual2/deploy.yml b/deploy/config/vm_environment/zte-virtual2/deploy.yml new file mode 100644 index 00000000..f2c8ac11 --- /dev/null +++ b/deploy/config/vm_environment/zte-virtual2/deploy.yml @@ -0,0 +1,24 @@ +hosts: +- name: 'controller01' + roles: + - 'CONTROLLER_LB' +- name: 'controller02' + roles: + - 'CONTROLLER_LB' +- name: 'controller03' + roles: + - 'CONTROLLER_LB' +- name: 'computer01' + roles: + - 'COMPUTER' +- name: 'computer02' + roles: + - 'COMPUTER' +disks: + daisy: 50 + controller: 50 + compute: 50 +daisy_passwd: 'r00tme' +daisy_ip: '10.20.11.2' +daisy_gateway: '10.20.11.1' +ceph_disk_name: '' diff --git a/deploy/config/vm_environment/zte-virtual2/network.yml b/deploy/config/vm_environment/zte-virtual2/network.yml new file mode 100644 index 00000000..28d531ce --- /dev/null +++ b/deploy/config/vm_environment/zte-virtual2/network.yml @@ -0,0 +1,60 @@ +############################################################################## +# Copyright (c) 2016 ZTE Coreporation and others. +# hu.zhijiang@zte.com.cn +# sun.jing22@zte.com.cn +# 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 +############################################################################## + +network-config-metadata: + title: 'zte-virtual2 network config' + version: '0.1' + created: 'Tue Apr 11 2017' + comment: +networks: + - cidr: '10.20.11.0/24' + gateway: '10.20.11.1' + ip_ranges: + - start: '10.20.11.3' + end: '10.20.11.10' + name: 'MANAGEMENT' + - cidr: '10.20.11.0/24' + gateway: '10.20.11.1' + ip_ranges: + - start: '10.20.11.3' + end: '10.20.11.10' + name: 'STORAGE' + - cidr: '172.10.101.0/24' + gateway: '172.10.101.1' + ip_ranges: + - start: 172.10.101.2 + end: 172.10.101.20 + name: EXTERNAL + network_name: admin_external + - cidr: '10.20.11.0/24' + gateway: '10.20.11.1' + ip_ranges: + - start: '10.20.11.3' + end: '10.20.11.10' + name: 'PUBLICAPI' + - cidr: '10.20.11.0/24' + gateway: '10.20.11.1' + ip_ranges: + - start: '10.20.11.3' + end: '10.20.11.10' + name: 'TENANT' +interfaces: + - name: 'EXTERNAL' + interface: 'ens8' + - name: 'MANAGEMENT' + interface: 'ens3' + - name: 'PUBLICAPI' + interface: 'ens3' + - name: 'STORAGE' + interface: 'ens3' + - name: 'TENANT' + interface: 'ens3' +internal_vip: '10.20.11.11' +public_vip: '10.20.11.11' diff --git a/templates/virtual_environment/vms/computer01.xml b/templates/virtual_environment/vms/computer01.xml new file mode 100644 index 00000000..323f741d --- /dev/null +++ b/templates/virtual_environment/vms/computer01.xml @@ -0,0 +1,126 @@ + + computer01 + 4194304 + 4194304 + 4 + + /machine + + + hvm + + + + + + + + + IvyBridge + + + + + + + destroy + restart + restart + + + + + + /usr/libexec/qemu-kvm + + + + + + +
+ + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +