summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhijiang Hu <hu.zhijiang@zte.com.cn>2017-02-23 00:54:36 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-02-23 00:54:36 +0000
commitcd585136acb636d6b13b173cf593c5f01c5f33a8 (patch)
tree3a1d2a4a61ccdd99433b923b9bca3d4f03908f28
parentf4a614caf60085929165a21f7c1bfe5d5f47fb09 (diff)
parent3b6f139b066fa61df852f480be3a583479c78eb6 (diff)
Merge "Baremetal Deployment on zte-pod2 JIRA: DAISY-30"
-rwxr-xr-xci/deploy/deploy.sh79
-rwxr-xr-xdeploy/check_os_progress.sh50
-rw-r--r--deploy/config/bm_environment/zte-baremetal1/deploy.yml23
-rw-r--r--deploy/config/bm_environment/zte-baremetal1/network.yml59
-rw-r--r--deploy/config/vm_environment/zte-virtual1/deploy.yml25
-rw-r--r--deploy/config/vm_environment/zte-virtual1/network.yml118
-rw-r--r--[-rwxr-xr-x]deploy/get_para_from_deploy.py19
-rw-r--r--[-rwxr-xr-x]deploy/tempest.py41
-rw-r--r--templates/physical_environment/networks/daisy.xml12
-rw-r--r--templates/physical_environment/vms/daisy.xml126
10 files changed, 432 insertions, 120 deletions
diff --git a/ci/deploy/deploy.sh b/ci/deploy/deploy.sh
index 238b1ad5..c3b78055 100755
--- a/ci/deploy/deploy.sh
+++ b/ci/deploy/deploy.sh
@@ -11,7 +11,7 @@
# [x] 1. Pass full path for parameter for -d and -n
# [x] 2. Refactor para fetching procedure of paras_from_deploy
# [x] 3. Refactor execute_on_jumpserver
-# [ ] 4. Refactor for names for var such like net_daisy1, net_daisy2
+# [ ] 4. Refactor for names for var such like daisy_server_net, target_node_net
# [ ] 5. Store PODs' configruation files into securelab
# [ ] 6. Use POD name as the parameter instead of files
##############################################################################
@@ -69,6 +69,7 @@ DHA_CONF=''
NETWORK_CONF=''
LAB_NAME=''
POD_NAME=''
+TARGET_HOSTS_NUM=0
DRY_RUN=0
IS_BARE=1
#
@@ -152,15 +153,22 @@ SSH_PARAS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
deploy_path=$WORKSPACE/deploy
create_qcow2_path=$WORKSPACE/tools
-net_daisy1=$WORKSPACE/templates/virtual_environment/networks/daisy.xml
-net_daisy2=$WORKSPACE/templates/virtual_environment/networks/os-all_in_one.xml
-pod_daisy=$WORKSPACE/templates/virtual_environment/vms/daisy.xml
-pod_all_in_one=$WORKSPACE/templates/virtual_environment/vms/all_in_one.xml
+
+daisy_server_net=$WORKSPACE/templates/virtual_environment/networks/daisy.xml
+target_node_net=$WORKSPACE/templates/virtual_environment/networks/os-all_in_one.xml
+vmdeploy_daisy_server_vm=$WORKSPACE/templates/virtual_environment/vms/daisy.xml
+vmdeploy_target_node_vm=$WORKSPACE/templates/virtual_environment/vms/all_in_one.xml
+
+
+bmdeploy_daisy_server_net=$WORKSPACE/templates/physical_environment/networks/daisy.xml
+bmdeploy_daisy_server_vm=$WORKSPACE/templates/physical_environment/vms/daisy.xml
PARAS_FROM_DEPLOY=`python $WORKSPACE/deploy/get_para_from_deploy.py --dha $DHA_CONF`
-DAISY_IP=`echo $PARAS_FROM_DEPLOY | cut -d " " -f 1`
-DAISY_PASSWD=`echo $PARAS_FROM_DEPLOY | cut -d " " -f 2`
-PARAS_IMAGE=${PARAS_FROM_DEPLOY#* * }
+TARGET_HOSTS_NUM=`echo $PARAS_FROM_DEPLOY | cut -d " " -f 1`
+DAISY_IP=`echo $PARAS_FROM_DEPLOY | cut -d " " -f 2`
+DAISY_PASSWD=`echo $PARAS_FROM_DEPLOY | cut -d " " -f 3`
+PARAS_IMAGE=${PARAS_FROM_DEPLOY#* * * }
+
if [ $DRY_RUN -eq 1 ]; then
echo """
@@ -171,10 +179,10 @@ if [ $DRY_RUN -eq 1 ]; then
DAISY_IP: $DAISY_IP
DAISY_PASSWD: $DAISY_PASSWD
PARAS_IMAGE: $PARAS_IMAGE
- net_daisy1: $net_daisy1
- net_daisy2: $net_daisy2
- pod_daisy: $pod_daisy
- pod_all_in_one: $pod_all_in_one
+ daisy_server_net: $daisy_server_net
+ target_node_net: $target_node_net
+ vmdeploy_daisy_server_vm: $vmdeploy_daisy_server_vm
+ vmdeploy_target_node_vm: $vmdeploy_target_node_vm
"""
exit 1
fi
@@ -244,15 +252,22 @@ function clean_up
}
echo "=====clean up all node and network======"
-clean_up all_in_one daisy2
+if [ $IS_BARE == 0 ];then
+ clean_up all_in_one daisy2
+fi
clean_up daisy daisy1
if [ -f $WORKDIR/daisy/centos7.qcow2 ]; then
rm -rf $WORKDIR/daisy/centos7.qcow2
fi
echo "=======create daisy node================"
-$create_qcow2_path/daisy-img-modify.sh -c $create_qcow2_path/centos-img-modify.sh -a $DAISY_IP $PARAS_IMAGE
-create_node $net_daisy1 daisy1 $pod_daisy daisy
+if [ $IS_BARE == 0 ];then
+ $create_qcow2_path/daisy-img-modify.sh -c $create_qcow2_path/centos-img-modify.sh -a $DAISY_IP $PARAS_IMAGE
+ create_node $daisy_server_net daisy1 $vmdeploy_daisy_server_vm daisy
+else
+ $create_qcow2_path/daisy-img-modify.sh -c $create_qcow2_path/centos-img-modify.sh -a $DAISY_IP $PARAS_IMAGE
+ create_node $bmdeploy_daisy_server_net daisy1 $bmdeploy_daisy_server_vm daisy
+fi
sleep 20
echo "====== install daisy==========="
@@ -278,24 +293,38 @@ ssh $SSH_PARAS $DAISY_IP "echo -e '[libvirt]\nvirt_type=qemu' > /etc/kolla/confi
echo "===prepare cluster and pxe==="
ssh $SSH_PARAS $DAISY_IP "python ${REMOTE_SPACE}/deploy/tempest.py --dha $DHA --network $NETWORK --cluster 'yes'"
-echo "=====create all-in-one node======"
-qemu-img create -f qcow2 ${VM_STORAGE}/all_in_one.qcow2 200G
-create_node $net_daisy2 daisy2 $pod_all_in_one all_in_one
-sleep 20
+echo "=====create and find node======"
+if [ $IS_BARE == 0 ];then
+ qemu-img create -f qcow2 ${VM_STORAGE}/all_in_one.qcow2 200G
+ create_node $target_node_net daisy2 $vmdeploy_target_node_vm all_in_one
+ sleep 20
+else
+ for i in $(seq 106 110); do
+ ipmitool -I lanplus -H 192.168.1.$i -U zteroot -P superuser -R 1 chassis bootdev pxe
+ ipmitool -I lanplus -H 192.168.1.$i -U zteroot -P superuser -R 1 chassis power reset
+ done
+fi
echo "======prepare host and pxe==========="
-ssh $SSH_PARAS $DAISY_IP "python ${REMOTE_SPACE}/deploy/tempest.py --dha $DHA --network $NETWORK --host 'yes'"
+ssh $SSH_PARAS $DAISY_IP "python ${REMOTE_SPACE}/deploy/tempest.py --dha $DHA --network $NETWORK --host 'yes' --env $IS_BARE"
echo "======daisy deploy os and openstack==========="
-virsh destroy all_in_one
-virsh start all_in_one
+if [ $IS_BARE == 0 ];then
+ virsh destroy all_in_one
+ virsh start all_in_one
+fi
-echo "===========check install progress==========="
+echo "============restart daisy service==========="
ssh $SSH_PARAS $DAISY_IP "systemctl restart daisy-api"
ssh $SSH_PARAS $DAISY_IP "systemctl restart daisy-registry"
-ssh $SSH_PARAS $DAISY_IP "${REMOTE_SPACE}/deploy/check_os_progress.sh"
+
+echo "===========check install progress==========="
+ssh $SSH_PARAS $DAISY_IP "${REMOTE_SPACE}/deploy/check_os_progress.sh -d $IS_BARE -n $TARGET_HOSTS_NUM"
sleep 10
-virsh reboot all_in_one
+
+if [ $IS_BARE == 0 ];then
+ virsh reboot all_in_one
+fi
ssh $SSH_PARAS $DAISY_IP "${REMOTE_SPACE}/deploy/check_openstack_progress.sh"
exit 0
diff --git a/deploy/check_os_progress.sh b/deploy/check_os_progress.sh
index bf44fe28..abbd7e5a 100755
--- a/deploy/check_os_progress.sh
+++ b/deploy/check_os_progress.sh
@@ -1,20 +1,62 @@
#!/bin/bash
+usage()
+{
+ cat << EOF
+USAGE: `basename $0` [-d deploy_env] [-n hosts_num]
+
+OPTIONS:
+ -d deploy environment of daisy(0:virtual or 1:baremetal)
+ -n target node numbers
+
+EXAMPLE:
+ sudo `basename $0` -d 1 -n 5
+EOF
+}
+
+while getopts "d:n:h" OPTION
+do
+ case $OPTION in
+ d)
+ deploy_env=${OPTARG}
+ ;;
+ n)
+ hosts_num=${OPTARG}
+ ;;
+ h)
+ usage
+ exit 0
+ ;;
+ *)
+ echo "${OPTION} is not a valid argument"
+ usage
+ exit 0
+ ;;
+ esac
+done
+
source /root/daisyrc_admin
cluster_id=`daisy cluster-list | awk -F "|" '{print $2}' | sed -n '4p'`
-daisy install $cluster_id --skip-pxe-ipmi true
+skip=false
+if [ $deploy_env == 0 ];then
+ skip=true
+fi
+
+echo "run daisy install command"
+daisy install $cluster_id --skip-pxe-ipmi $skip
+
echo "check os installing progress..."
while true; do
os_install_active=`daisy host-list --cluster-id $cluster_id | awk -F "|" '{print $8}' | grep -c "active" `
os_install_failed=`daisy host-list --cluster-id $cluster_id | awk -F "|" '{print $8}' | grep -c "install-failed" `
- if [ $os_install_active -eq 1 ]; then
+ if [ $os_install_active -eq $hosts_num ]; then
echo "os installing successful ..."
break
elif [ $os_install_failed -gt 0 ]; then
echo "os installing have failed..."
exit 1
else
- progress=`daisy host-list --cluster-id $cluster_id |grep DISCOVERY_SUCCESSFUL |awk -F "|" '{print $7}'|sed s/[[:space:]]//g`
- echo "os in installing, the progress is $progress%"
+ progress=`daisy host-list --cluster-id $cluster_id |grep DISCOVERY_SUCCESSFUL |awk -F "|" '{print $7}'|sed s/[[:space:]]//g|sed ':a;N;$ s/\n/ /g;ba'`
+ echo "os in installing, the progress of each node is $progress%"
sleep 10
fi
done
diff --git a/deploy/config/bm_environment/zte-baremetal1/deploy.yml b/deploy/config/bm_environment/zte-baremetal1/deploy.yml
new file mode 100644
index 00000000..eafff5fd
--- /dev/null
+++ b/deploy/config/bm_environment/zte-baremetal1/deploy.yml
@@ -0,0 +1,23 @@
+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.7.3'
+daisy_gateway: '10.20.7.1'
diff --git a/deploy/config/bm_environment/zte-baremetal1/network.yml b/deploy/config/bm_environment/zte-baremetal1/network.yml
new file mode 100644
index 00000000..53f21d90
--- /dev/null
+++ b/deploy/config/bm_environment/zte-baremetal1/network.yml
@@ -0,0 +1,59 @@
+##############################################################################
+# Copyright (c) 2017 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-bm-deploy network config'
+ version: '0.1'
+ created: 'Mon Oct 31 2016'
+ comment:
+networks:
+ - cidr: '10.20.7.0/24'
+ gateway: '10.20.7.1'
+ ip_ranges:
+ - 'start': '10.20.7.4'
+ 'end': '10.20.7.11'
+ name: 'MANAGEMENT'
+ - cidr: '10.20.7.0/24'
+ gateway: '10.20.7.1'
+ ip_ranges:
+ - start: '10.20.7.4'
+ end: '10.20.7.11'
+ name: 'STORAGE'
+ - cidr: '172.10.101.0/24'
+ gateway: '172.10.101.0'
+ ip_ranges:
+ - 'start': '172.10.101.1'
+ 'end': '172.10.101.10'
+ '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'
+ name: 'PUBLICAPI'
+ - cidr: '10.20.7.0/24'
+ gateway: '10.20.7.1'
+ ip_ranges:
+ - 'start': '10.20.7.4'
+ 'end': '10.20.7.11'
+ name: 'TENANT'
+interfaces:
+ - name: 'EXTERNAL'
+ interface: 'ens12f1'
+ - name: 'MANAGEMENT'
+ interface: 'ens4f0'
+ - name: 'PUBLICAPI'
+ interface: 'ens4f0'
+ - name: 'STORAGE'
+ interface: 'ens4f0'
+ - name: 'TENANT'
+ interface: 'ens4f0'
+internal_vip: '10.20.7.12'
+public_vip: '10.20.7.12'
diff --git a/deploy/config/vm_environment/zte-virtual1/deploy.yml b/deploy/config/vm_environment/zte-virtual1/deploy.yml
index b0949476..1bf254f5 100644
--- a/deploy/config/vm_environment/zte-virtual1/deploy.yml
+++ b/deploy/config/vm_environment/zte-virtual1/deploy.yml
@@ -1,12 +1,13 @@
-hosts:
-- name: 'all_in_one'
- roles:
- - 'CONTROLLER_LB'
- - 'COMPUTER'
-disks:
- daisy: 50
- controller: 50
- compute: 50
-daisy_passwd: 'r00tme'
-daisy_ip: '10.20.11.2'
-daisy_gateway: '10.20.11.1'
+hosts:
+- name: 'all_in_one'
+ roles:
+ - 'CONTROLLER_LB'
+ - 'COMPUTER'
+disks:
+ daisy: 50
+ controller: 50
+ compute: 50
+daisy_passwd: 'r00tme'
+daisy_ip: '10.20.11.2'
+daisy_gateway: '10.20.11.1'
+deploy_env: 'virtual' \ No newline at end of file
diff --git a/deploy/config/vm_environment/zte-virtual1/network.yml b/deploy/config/vm_environment/zte-virtual1/network.yml
index 36863882..7d746be6 100644
--- a/deploy/config/vm_environment/zte-virtual1/network.yml
+++ b/deploy/config/vm_environment/zte-virtual1/network.yml
@@ -1,59 +1,59 @@
-##############################################################################
-# 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-virtual1 network config'
- version: '0.1'
- created: 'Mon Oct 31 2016'
- 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.0'
- ip_ranges:
- - 'start': '172.10.101.1'
- 'end': '172.10.101.10'
- 'name': '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'
+##############################################################################
+# 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-virtual1 network config'
+ version: '0.1'
+ created: 'Mon Oct 31 2016'
+ 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.0'
+ ip_ranges:
+ - 'start': '172.10.101.1'
+ 'end': '172.10.101.10'
+ 'name': '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/deploy/get_para_from_deploy.py b/deploy/get_para_from_deploy.py
index d142af3a..c75ba07b 100755..100644
--- a/deploy/get_para_from_deploy.py
+++ b/deploy/get_para_from_deploy.py
@@ -32,19 +32,26 @@ def get_yml_para(dha_file):
daisy_passwd = data.get("daisy_passwd", "")
daisy_ip = data.get("daisy_ip", "")
daisy_gateway = data.get("daisy_gateway", "")
+ daisy_target_node = data.get("hosts", "")
+ hosts_num = len(daisy_target_node)
return daisyserver_size, controller_node_size,\
- compute_node_size, daisy_passwd, daisy_ip, daisy_gateway
+ compute_node_size, daisy_passwd, daisy_ip, daisy_gateway,\
+ hosts_num
def get_conf_from_deploy():
conf = cfg.ConfigOpts()
parse(conf, sys.argv[1:])
daisyserver_size, controller_node_size, compute_node_size,\
- daisy_passwd, daisy_ip, daisy_gateway = get_yml_para(conf['dha'])
- print "{ip} {passwd} -s {size} -g {gateway}".format(passwd=daisy_passwd,
- size=daisyserver_size,
- ip=daisy_ip,
- gateway=daisy_gateway)
+ daisy_passwd, daisy_ip, daisy_gateway,\
+ hosts_num = get_yml_para(conf['dha'])
+ print "{hosts_num} {ip} {passwd} -s {size} -g {gateway}".format(
+ hosts_num=hosts_num,
+ passwd=daisy_passwd,
+ size=daisyserver_size,
+ ip=daisy_ip,
+ gateway=daisy_gateway)
+
if __name__ == "__main__":
get_conf_from_deploy()
diff --git a/deploy/tempest.py b/deploy/tempest.py
index 3459cb07..34af9b5a 100755..100644
--- a/deploy/tempest.py
+++ b/deploy/tempest.py
@@ -31,6 +31,8 @@ _CLI_OPTS = [
help='Config cluster'),
cfg.StrOpt('host',
help='Config host'),
+ cfg.StrOpt('env',
+ help='deploy environment'),
]
@@ -82,9 +84,10 @@ def prepare_install():
hosts_info = get_hosts()
cluster_info = get_cluster()
cluster_id = cluster_info.id
- add_hosts_interface(cluster_id, hosts_info,
+ add_hosts_interface(cluster_id, hosts_info, hosts_name,
host_interface_map, vip)
- build_pxe_for_os(cluster_id)
+ if conf['env'] and conf['env'] == 0:
+ build_pxe_for_os(cluster_id)
except Exception:
print("Deploy failed!!!.%s." % traceback.format_exc())
else:
@@ -143,15 +146,16 @@ def get_cluster():
return cluster_info
-def add_hosts_interface(cluster_id, hosts_info, host_interface_map,
+def add_hosts_interface(cluster_id, hosts_info, hosts_name, host_interface_map,
vip):
- for host in hosts_info:
+ for host_name, host in zip(hosts_name, hosts_info):
host = host.to_dict()
host['cluster'] = cluster_id
for interface in host['interfaces']:
interface_name = interface['name']
- interface['assigned_networks'] = \
- host_interface_map[interface_name]
+ if interface_name in host_interface_map:
+ interface['assigned_networks'] = \
+ host_interface_map[interface_name]
pathlist = os.listdir(iso_path)
for filename in pathlist:
if filename.endswith('iso'):
@@ -160,10 +164,10 @@ def add_hosts_interface(cluster_id, hosts_info, host_interface_map,
print("do not have os iso file in /var/lib/daisy/kolla/.")
client.hosts.update(host['id'], **host)
print("update role...")
- add_host_role(cluster_id, host['id'], host['name'], vip)
+ add_host_role(cluster_id, host['id'], host_name, host['name'], vip)
-def add_host_role(cluster_id, host_id, host_name, vip):
+def add_host_role(cluster_id, host_id, host_exp_name, host_real_name, vip):
role_meta = {'filters': {'cluster_id': cluster_id}}
role_list_generator = client.roles.list(**role_meta)
role_list = [role for role in role_list_generator]
@@ -171,12 +175,21 @@ def add_host_role(cluster_id, host_id, host_name, vip):
role.name == "CONTROLLER_LB"][0]
computer_role_id = [role.id for role in role_list if
role.name == "COMPUTER"][0]
- role_lb_update_meta = {'nodes': [host_id],
- 'cluster_id': cluster_id, 'vip': vip}
- client.roles.update(lb_role_id, **role_lb_update_meta)
- role_computer_update_meta = {'nodes': [host_id],
- 'cluster_id': cluster_id}
- client.roles.update(computer_role_id, **role_computer_update_meta)
+ if host_exp_name in ['all_in_one']:
+ role_lb_update_meta = {'nodes': [host_id],
+ 'cluster_id': cluster_id, 'vip': vip}
+ client.roles.update(lb_role_id, **role_lb_update_meta)
+ role_computer_update_meta = {'nodes': [host_id],
+ 'cluster_id': cluster_id}
+ client.roles.update(computer_role_id, **role_computer_update_meta)
+ if host_exp_name in ['controller01', 'controller02', 'controller03']:
+ role_lb_update_meta = {'nodes': [host_id],
+ 'cluster_id': cluster_id, 'vip': vip}
+ client.roles.update(lb_role_id, **role_lb_update_meta)
+ if host_exp_name in ['computer01', 'computer02']:
+ role_computer_update_meta = {'nodes': [host_id],
+ 'cluster_id': cluster_id}
+ client.roles.update(computer_role_id, **role_computer_update_meta)
if __name__ == "__main__":
diff --git a/templates/physical_environment/networks/daisy.xml b/templates/physical_environment/networks/daisy.xml
new file mode 100644
index 00000000..884cb285
--- /dev/null
+++ b/templates/physical_environment/networks/daisy.xml
@@ -0,0 +1,12 @@
+<network connections='1'>
+ <name>daisy1</name>
+ <forward mode='nat'>
+ <nat>
+ <port start='1024' end='65535'/>
+ </nat>
+ </forward>
+ <bridge name='daisy1' stp='on' delay='0'/>
+ <domain name='daisy1'/>
+ <ip address='10.20.7.1' netmask='255.255.255.0'>
+ </ip>
+</network>
diff --git a/templates/physical_environment/vms/daisy.xml b/templates/physical_environment/vms/daisy.xml
new file mode 100644
index 00000000..e91acc46
--- /dev/null
+++ b/templates/physical_environment/vms/daisy.xml
@@ -0,0 +1,126 @@
+<domain type='kvm' id='72'>
+ <name>daisy</name>
+ <uuid>9bee58b0-dfa6-485f-a205-d72848893551</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <resource>
+ <partition>/machine</partition>
+ </resource>
+ <os>
+ <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ </features>
+ <cpu mode='custom' match='exact'>
+ <model fallback='allow'>IvyBridge</model>
+ </cpu>
+ <clock offset='utc'>
+ <timer name='rtc' tickpolicy='catchup'/>
+ <timer name='pit' tickpolicy='delay'/>
+ <timer name='hpet' present='no'/>
+ </clock>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <pm>
+ <suspend-to-mem enabled='no'/>
+ <suspend-to-disk enabled='no'/>
+ </pm>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='qcow2'/>
+ <source file='/tmp/workdir/daisy/centos7.qcow2'/>
+ <backingStore/>
+ <target dev='hda' bus='ide'/>
+ <alias name='ide0-0-0'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0' model='ich9-ehci1'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x7'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-uhci1'>
+ <alias name='usb'/>
+ <master startport='0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0' multifunction='on'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-uhci2'>
+ <alias name='usb'/>
+ <master startport='2'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x1'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-uhci3'>
+ <alias name='usb'/>
+ <master startport='4'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci.0'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
+ </controller>
+ <interface type='bridge'>
+ <mac address='52:54:00:73:8b:50'/>
+ <source bridge='daisy1'/>
+ <target dev='vnet1'/>
+ <model type='rtl8139'/>
+ <alias name='net0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ <serial type='pty'>
+ <source path='/dev/pts/9'/>
+ <target port='0'/>
+ <alias name='serial0'/>
+ </serial>
+ <console type='pty' tty='/dev/pts/9'>
+ <source path='/dev/pts/9'/>
+ <target type='serial' port='0'/>
+ <alias name='serial0'/>
+ </console>
+ <channel type='spicevmc'>
+ <target type='virtio' name='com.redhat.spice.0' state='disconnected'/>
+ <alias name='channel0'/>
+ <address type='virtio-serial' controller='0' bus='0' port='1'/>
+ </channel>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <graphics type='spice' port='5902' autoport='yes' listen='127.0.0.1'>
+ <listen type='address' address='127.0.0.1'/>
+ <image compression='off'/>
+ </graphics>
+ <sound model='ich6'>
+ <alias name='sound0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </sound>
+ <video>
+ <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/>
+ <alias name='video0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </video>
+ <redirdev bus='usb' type='spicevmc'>
+ <alias name='redir0'/>
+ </redirdev>
+ <redirdev bus='usb' type='spicevmc'>
+ <alias name='redir1'/>
+ </redirdev>
+ <memballoon model='virtio'>
+ <alias name='balloon0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
+ </memballoon>
+ </devices>
+ <seclabel type='dynamic' model='selinux' relabel='yes'>
+ <label>system_u:system_r:svirt_t:s0:c482,c747</label>
+ <imagelabel>system_u:object_r:svirt_image_t:s0:c482,c747</imagelabel>
+ </seclabel>
+</domain>