aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rwxr-xr-xcommand.sh65
-rwxr-xr-xconf/admin-openrc.sh8
-rw-r--r--conf/application.yml (renamed from conf/openo-vm.yml)11
-rw-r--r--conf/download.conf6
-rw-r--r--conf/juju.conf15
-rw-r--r--conf/network.yml60
-rw-r--r--conf/open-o.yml13
-rw-r--r--csar/clearwater/JUJU_clearwater.csarbin0 -> 1850996 bytes
-rw-r--r--csar/clearwater/pop_ns_juju.csarbin0 -> 58912 bytes
-rwxr-xr-xjuju/command.sh31
-rwxr-xr-xjuju/deploy_application.py26
-rwxr-xr-xjuju/juju_connect.sh136
-rwxr-xr-xjuju/juju_launch.sh131
-rwxr-xr-xjuju/juju_setup.sh38
-rwxr-xr-x[-rw-r--r--]juju/openo_connect.py154
-rwxr-xr-xjuju/vims_deploy.sh69
-rwxr-xr-xopen-o/openo_docker.sh189
-rwxr-xr-xopen-o/openo_vm.sh201
-rwxr-xr-xopera_launch.sh51
-rwxr-xr-xprepare.sh52
-rw-r--r--process_conf.py66
-rw-r--r--util/external-net.xml7
-rwxr-xr-x[-rw-r--r--]util/grant_mysql.sh0
-rw-r--r--util/isolinux.cfg120
-rw-r--r--util/ks.cfg228
-rw-r--r--util/libvirt.xml64
-rw-r--r--util/modify_file.sh8
28 files changed, 638 insertions, 1112 deletions
diff --git a/.gitignore b/.gitignore
index ccf6a49..5c972d6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
+*.pyc
/work
diff --git a/command.sh b/command.sh
deleted file mode 100755
index 513bc94..0000000
--- a/command.sh
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/bash
-##############################################################################
-# Copyright (c) 2016-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
-##############################################################################
-
-function exec_cmd_on_openo()
-{
- local rsa_file=${OPENO_VM_DIR}/boot.rsa
- local ssh_args="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i $rsa_file"
-
- if [ ! -f $rsa_file ]; then
- log_error "open-o vm boot.rsa not found"
- exit 1
- fi
-
- if [ ! $OPENO_VM_IP ]; then
- log_error "open-o vm ip not found"
- exit 1
- fi
- ssh $ssh_args root@$OPENO_VM_IP "$@"
-}
-
-function scp_to_openo()
-{
- local rsa_file=${OPENO_VM_DIR}/boot.rsa
- local ssh_args="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i $rsa_file"
-
- if [ ! -f $rsa_file ]; then
- log_error "open-o vm boot.rsa not found"
- exit 1
- fi
-
- if [ ! $OPENO_VM_IP ]; then
- log_error "open-o vm ip not found"
- exit 1
- fi
- scp $ssh_args $1 root@$OPENO_VM_IP:$2
-}
-
-function exec_cmd_on_client()
-{
- local ssh_args="-o StrictHostKeyChecking=no"
-
- if [ ! $floating_ip_client ]; then
- log_error "juju-client ip not found"
- exit 1
- fi
- ssh $ssh_args ubuntu@$floating_ip_client "$@"
-}
-
-function exec_cmd_on_metadata()
-{
- local ssh_args="-o StrictHostKeyChecking=no"
-
- if [ ! $floating_ip_metadata ]; then
- log_error "juju-metadata ip not found"
- exit 1
- fi
- ssh $ssh_args ubuntu@$floating_ip_metadata "$@"
-}
diff --git a/conf/admin-openrc.sh b/conf/admin-openrc.sh
new file mode 100755
index 0000000..1f3309f
--- /dev/null
+++ b/conf/admin-openrc.sh
@@ -0,0 +1,8 @@
+export OS_PROJECT_DOMAIN_NAME=default
+export OS_USER_DOMAIN_NAME=default
+export OS_USERNAME=admin
+export OS_PASSWORD=console
+export OS_PROJECT_NAME=admin
+export OS_AUTH_URL=http://192.168.104.222:5000/v3
+export OS_IDENTITY_API_VERSION=3
+export OS_REGION_NAME=RegionOne
diff --git a/conf/openo-vm.yml b/conf/application.yml
index 25badad..84f9eef 100644
--- a/conf/openo-vm.yml
+++ b/conf/application.yml
@@ -6,10 +6,7 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
----
-openo:
- tag: 1.0.0
- cpu: 4
- memory: 64
- disk: 100
- vnet: external
+application:
+ - name: clearwater
+ ns_pkg: pop_ns_juju.csar
+ vnf_pkg: JUJU_clearwater.csar
diff --git a/conf/download.conf b/conf/download.conf
deleted file mode 100644
index 76a7fc6..0000000
--- a/conf/download.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-# iso and img conifg
-OPENO_VM_ISO_URL=http://205.177.226.237:9999/CentOS-7-x86_64-Minimal-1511.iso
-JUJU_IMG_NAME=(xenial_x86_64 trusty_x86_64 precise_x86_64)
-JUJU_IMG_URL=(http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img \
- http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img \
- http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img)
diff --git a/conf/juju.conf b/conf/juju.conf
new file mode 100644
index 0000000..c62d4f8
--- /dev/null
+++ b/conf/juju.conf
@@ -0,0 +1,15 @@
+# juju conifg
+JUJU_NET_GW=12.1.1.1
+JUJU_NET_CIDR=12.1.1.0/24
+
+JUJU_VM_IMG=juju_image
+JUJU_VM_IMG_URL=http://artifacts.opnfv.org/opera/opera/juju_xenial_x86_64.img
+
+JUJU_IMG_NAME=(xenial_x86_64 trusty_x86_64 precise_x86_64)
+JUJU_IMG_URL=(http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img \
+ http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img \
+ http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img)
+
+CSAR_NAME=(JUJU_clearwater.csar pop_ns_juju.csar)
+CSAR_URL=(http://artifacts.opnfv.org/opera/opera/csar/JUJU_clearwater.csar \
+ http://artifacts.opnfv.org/opera/opera/csar/pop_ns_juju.csar)
diff --git a/conf/network.yml b/conf/network.yml
deleted file mode 100644
index bcf1e5a..0000000
--- a/conf/network.yml
+++ /dev/null
@@ -1,60 +0,0 @@
-##############################################################################
-# Copyright (c) 2016-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
-##############################################################################
----
-openo_net:
- openo_vm_ip: 192.168.104.50
- openo_vm_mask: 255.255.255.0
- openo_external_gw: 192.168.104.1
- openo_external_cidr: 192.168.104.0/24
-
-openo_docker_net:
- common_services_auth_ip: 192.168.104.51
- common_services_drivermanager_ip: 192.168.104.52
- common_services_extsys_ip: 192.168.104.53
- common_services_msb_ip: 192.168.104.54
- common_services_protocolstack_ip: 192.168.104.55
- common_services_wso2ext_ip: 192.168.104.56
- common_tosca_catalog_ip: 192.168.104.57
- common_tosca_inventory_ip: 192.168.104.58
- common_tosca_modeldesigner_ip: 192.168.104.59
- gso_service_gateway_ip: 192.168.104.60
- gso_service_manager_ip: 192.168.104.61
- nfvo_dac_ip: 192.168.104.62
- nfvo_driver_sdnc_zte_ip: 192.168.104.63
- nfvo_driver_vim_ip: 192.168.104.64
- nfvo_driver_vnfm_huawei_ip: 192.168.104.65
- nfvo_driver_vnfm_juju_ip: 192.168.104.66
- nfvo_driver_vnfm_zte_ip: 192.168.104.67
- nfvo_lcm_ip: 192.168.104.68
- nfvo_resmanagement_ip: 192.168.104.69
- nfvo_umc_ip: 192.168.104.70
- sdno_driver_huawei_l3vpn_ip: 192.168.104.71
- sdno_driver_huawei_openstack_ip: 192.168.104.72
- sdno_driver_huawei_overlay_ip: 192.168.104.73
- sdno_driver_huawei_servicechain_ip: 192.168.104.74
- sdno_driver_zte_sptn_ip: 192.168.104.75
- sdno_service_brs_ip: 192.168.104.76
- sdno_service_ipsec_ip: 192.168.104.77
- sdno_service_l2vpn_ip: 192.168.104.78
- sdno_service_l3vpn_ip: 192.168.104.79
- sdno_service_mss_ip: 192.168.104.80
- sdno_service_nslcm_ip: 192.168.104.81
- sdno_service_overlayvpn_ip: 192.168.104.82
- sdno_service_servicechain_ip: 192.168.104.83
- sdno_service_vpc_ip: 192.168.104.84
- sdno_service_vxlan_ip: 192.168.104.85
- common_tosca_aria_ip: 192.168.104.86
- sdno_driver_ct_te_ip: 192.168.104.87
- sdno_monitoring_ip: 192.168.104.88
- sdno_vsitemgr_ip: 192.168.104.89
- gso_gui_portal_ip: 192.168.104.90
-
-juju_net:
- juju_net_cidr: 12.1.1.0/24
- juju_net_gw: 12.1.1.1
diff --git a/conf/open-o.yml b/conf/open-o.yml
new file mode 100644
index 0000000..1281376
--- /dev/null
+++ b/conf/open-o.yml
@@ -0,0 +1,13 @@
+---
+openo_version: 1.0.0
+
+openo_net:
+ openo_ip:
+
+openo_docker_net:
+ common_services_msb_port: 80
+ common_tosca_aria_port: 8204
+ nfvo_driver_vnfm_juju_port: 8483
+ nfvo_driver_vnfm_juju_mysql_port: 3306
+
+application:
diff --git a/csar/clearwater/JUJU_clearwater.csar b/csar/clearwater/JUJU_clearwater.csar
new file mode 100644
index 0000000..7d11b9e
--- /dev/null
+++ b/csar/clearwater/JUJU_clearwater.csar
Binary files differ
diff --git a/csar/clearwater/pop_ns_juju.csar b/csar/clearwater/pop_ns_juju.csar
new file mode 100644
index 0000000..a94f3c2
--- /dev/null
+++ b/csar/clearwater/pop_ns_juju.csar
Binary files differ
diff --git a/juju/command.sh b/juju/command.sh
new file mode 100755
index 0000000..84643de
--- /dev/null
+++ b/juju/command.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2016-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
+##############################################################################
+
+function exec_cmd_on_client()
+{
+ local ssh_args="-o StrictHostKeyChecking=no"
+
+ if [ ! $juju_client_ip ]; then
+ log_error "juju-client ip not found"
+ exit 1
+ fi
+ ssh $ssh_args ubuntu@$juju_client_ip "$@"
+}
+
+function scp_to_client()
+{
+ local ssh_args="-o StrictHostKeyChecking=no"
+
+ if [ ! $juju_client_ip ]; then
+ log_error "juju-client ip not found"
+ exit 1
+ fi
+ scp $ssh_args $1 ubuntu@$juju_client_ip:$2
+}
diff --git a/juju/deploy_application.py b/juju/deploy_application.py
new file mode 100755
index 0000000..22c7d9d
--- /dev/null
+++ b/juju/deploy_application.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+##############################################################################
+# Copyright (c) 2016-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
+##############################################################################
+
+import argparse
+from openo_connect import create_service
+
+
+if __name__ == "__main__":
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--application", action='store', default='', help="app name")
+ parser.add_argument("--msb_ip", action='store', help="common_services_msb ip")
+
+ args = parser.parse_args()
+ application = args.application
+ msb_ip = args.msb_ip
+
+ if application == 'clearwater':
+ create_service(msb_ip, application, 'vIMS', 'ns_cw_2016')
diff --git a/juju/juju_connect.sh b/juju/juju_connect.sh
index 693918e..43314b5 100755
--- a/juju/juju_connect.sh
+++ b/juju/juju_connect.sh
@@ -10,85 +10,103 @@
function connect_prepare()
{
- local cmd1="yum install -y rsync"
- exec_cmd_on_openo $cmd1
-
- local cmd2="if [[ ! -f /root/.ssh/id_rsa.pub ]]; then \
- sudo ssh-keygen -q -t rsa -f /root/.ssh/id_rsa -N ''; \
- fi"
- exec_cmd_on_openo $cmd2
-
- local openo_key=`exec_cmd_on_openo cat /root/.ssh/id_rsa.pub`
- local cmd3="echo $openo_key >> /home/ubuntu/.ssh/authorized_keys"
- exec_cmd_on_client $cmd3
-
- local cmd4="sudo apt-get install -y default-jdk; \
- wget https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.9/bin/apache-tomcat-8.5.9.tar.gz; \
- tar -zxvf apache-tomcat-8.5.9.tar.gz; \
- rm -rf tomcat8; \
- mv apache-tomcat-8.5.9 tomcat8; \
- rm -rf tomcat8/webapps/*; \
- mkdir csar"
- exec_cmd_on_client $cmd4
+ apt-get install -y rsync
+
+ local cmd="tar -zxvf apache-tomcat-8.5.9.tar.gz; \
+ sudo rm -rf tomcat8 csar; \
+ mv apache-tomcat-8.5.9 tomcat8; \
+ rm -rf tomcat8/webapps/*; \
+ mkdir csar"
+ exec_cmd_on_client $cmd
}
function sync_juju_driver_file()
{
+ local TOMCAT_DIR=${WORK_DIR}/tomcat
+ rm -rf ${TOMCAT_DIR}
+ mkdir -p ${TOMCAT_DIR}
+
connect_prepare
- local cmd1="docker cp nfvo-driver-vnfm-juju:/service/webapps/ROOT /home/; \
- docker cp nfvo-driver-vnfm-juju:/service/etc /home/;"
- exec_cmd_on_openo $cmd1
-
- scp_to_openo ${UTIL_DIR}/modify_file.sh /home
- local cmd2="sed -i s/REPLACE_JUJU_DRIVER_IP/$NFVO_DRIVER_VNFM_JUJU_IP/ /home/modify_file.sh; \
- sed -i s/REPLACE_JUJU_METADATA_IP/$floating_ip_metadata/ /home/modify_file.sh; \
- chmod +x /home/modify_file.sh; \
- /home/modify_file.sh"
- exec_cmd_on_openo $cmd2
-
- local cmd3="rsync -e 'ssh -o StrictHostKeyChecking=no' --rsync-path='sudo rsync' \
- -av /home/etc ubuntu@$floating_ip_client:/home/ubuntu/tomcat8/; \
- rsync -e 'ssh -o StrictHostKeyChecking=no' --rsync-path='sudo rsync' \
- -av /home/ROOT ubuntu@$floating_ip_client:/home/ubuntu/tomcat8/webapps"
- exec_cmd_on_openo $cmd3
-
- local cmd4="docker cp /home/etc nfvo-driver-vnfm-juju:/service/; \
- docker cp /home/ROOT nfvo-driver-vnfm-juju:/service/webapps/"
- exec_cmd_on_openo $cmd4
+ docker cp nfvo-driver-vnfm-juju:/service/webapps/ROOT ${TOMCAT_DIR}
+ docker cp nfvo-driver-vnfm-juju:/service/etc ${TOMCAT_DIR}
+
+ file1=${TOMCAT_DIR}/etc/conf/juju_conf.json
+ sed -i "s/^\(.*\"image-metadata-url\":\).*/\1 \"http:\/\/$juju_client_ip\/images\"\,/g" $file1
+ sed -i "s/^\(.*\"network\":\).*/\1 \"juju-net\"\,/g" $file1
+ sed -i "s/^\(.*\"use-floating-ip\":\).*/\1 \"True\"\,/g" $file1
+
+ file2=${TOMCAT_DIR}/etc/csarInfo/csarinfo.json
+ sed -i "s/^\(.*\"csar_file_path\":\).*/\1 \"\/home\/ubuntu\/csar\/\"\,/g" $file2
+
+ file3=${TOMCAT_DIR}/ROOT/WEB-INF/classes/db.properties
+ sed -i "s/^\(.*jdbc.url=\).*/\1jdbc:mysql:\/\/$OPENO_IP:$NFVO_DRIVER_VNFM_JUJU_MYSQL_PORT\/jujuvnfmdb/g" $file3
+
+ file4=${TOMCAT_DIR}/ROOT/WEB-INF/classes/juju-config.properties
+ sed -i "s/^\(.*charmPath=\).*/\1\/home\/ubuntu\/csar\//g" $file4
+ sed -i "s/^\(.*grant_jujuvnfm_url=\).*/\1http:\/\/$OPENO_IP:$NFVO_DRIVER_VNFM_JUJU_PORT\//g" $file4
+
+ file5=${TOMCAT_DIR}/etc/conf/restclient.json
+ sed -i "s/^\(.*\"host\":\).*/\1\"$OPENO_IP\"\,/g" $file5
+ sed -i "s|^\(.*\"port\":\).*|\1\"$COMMON_SERVICES_MSB_PORT\"|g" $file5
+
+ file6=${TOMCAT_DIR}/etc/adapterInfo/jujuadapterinfo.json
+ sed -i "s/^\(.*\"ip\":\).*/\1 \"$OPENO_IP\"\,/g" $file6
+
+ rsync -e 'ssh -o StrictHostKeyChecking=no' --rsync-path='sudo rsync' \
+ -av ${TOMCAT_DIR}/etc ubuntu@$juju_client_ip:/home/ubuntu/tomcat8/
+ rsync -e 'ssh -o StrictHostKeyChecking=no' --rsync-path='sudo rsync' \
+ -av ${TOMCAT_DIR}/ROOT ubuntu@$juju_client_ip:/home/ubuntu/tomcat8/webapps
+
+ docker cp ${TOMCAT_DIR}/etc nfvo-driver-vnfm-juju:/service/
+ docker cp ${TOMCAT_DIR}/ROOT nfvo-driver-vnfm-juju:/service/webapps/
}
function start_tomcat()
{
- scp_to_openo ${UTIL_DIR}/grant_mysql.sh /home
- local cmd1="chmod +x /home/grant_mysql.sh; \
- docker cp /home/grant_mysql.sh nfvo-driver-vnfm-juju:/service; \
- docker exec -i nfvo-driver-vnfm-juju /service/grant_mysql.sh"
- exec_cmd_on_openo $cmd1
+ chmod +x ${UTIL_DIR}/grant_mysql.sh
+ docker cp ${UTIL_DIR}/grant_mysql.sh nfvo-driver-vnfm-juju:/service
+ docker exec -i nfvo-driver-vnfm-juju /service/grant_mysql.sh
- local cmd2='sed -i s/port=\"8080\"/port=\"8483\"/g /home/ubuntu/tomcat8/conf/server.xml'
- exec_cmd_on_client $cmd2
+ local cmd1='sed -i s/port=\"8080\"/port=\"8483\"/g /home/ubuntu/tomcat8/conf/server.xml'
+ exec_cmd_on_client $cmd1
- local cmd3="ps aux | grep java | awk '{print \"$2\"}' | xargs kill -9; \
+ local cmd2="pidof java | xargs kill -9; \
/home/ubuntu/tomcat8/bin/catalina.sh start"
- exec_cmd_on_client $cmd3
+
+ exec_cmd_on_client $cmd2
+
+ docker stop nfvo-driver-vnfm-juju
+ docker start nfvo-driver-vnfm-juju
}
-function add_vim_and_vnfm()
+function openo_connect()
{
- python ${JUJU_DIR}/openo_connect.py --msb_ip $COMMON_SERVICES_MSB_IP \
- --tosca_aria_ip $COMMON_TOSCA_ARIA_IP \
- --juju_client_ip $floating_ip_client \
- --auth_url $OS_AUTH_URL
-
- local cmd1="docker stop nfvo-driver-vnfm-juju; \
- docker start nfvo-driver-vnfm-juju"
- exec_cmd_on_openo $cmd1
+ python ${JUJU_DIR}/openo_connect.py --msb_ip $OPENO_IP:$COMMON_SERVICES_MSB_PORT \
+ --tosca_aria_ip $OPENO_IP \
+ --tosca_aria_port $COMMON_TOSCA_ARIA_PORT \
+ --juju_client_ip $juju_client_ip \
+ --auth_url $OS_AUTH_URL \
+ --ns_pkg "${CSAR_DIR}/${APP_NS_PKG}" \
+ --vnf_pkg "${CSAR_DIR}/${APP_VNF_PKG}"
+}
+
+function fix_openo_containers()
+{
+ docker exec gso-service-gateway sed -i "s|^\(.*\"port\":\).*|\1 \"$COMMON_SERVICES_MSB_PORT\"|g" /service/etc/conf/restclient.json
+ docker stop gso-service-gateway
+ docker start gso-service-gateway
+ docker exec nfvo-resmanagement sed -i "s|^\(.*\"port\":\).*|\1 \"$COMMON_SERVICES_MSB_PORT\"|g" /service/etc/conf/restclient.json
+ docker stop nfvo-resmanagement
+ docker start nfvo-resmanagement
}
function connect_juju_and_openo()
{
+ log_info "connect_juju_and_openo enter"
+
sync_juju_driver_file
start_tomcat
- add_vim_and_vnfm
+# fix_openo_containers
+ openo_connect
}
diff --git a/juju/juju_launch.sh b/juju/juju_launch.sh
index 1ad6e89..2aff57e 100755
--- a/juju/juju_launch.sh
+++ b/juju/juju_launch.sh
@@ -7,13 +7,20 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+function clear_juju_vm()
+{
+ servers=$(openstack server list | grep juju | awk '{print $2}')
+ if [[ -n $servers ]];then
+ openstack server delete $servers
+ fi
+}
function launch_juju_vm()
{
local NET_ID=$(neutron net-list | grep juju-net | awk '{print $2}')
if [[ ! $(nova list | grep juju-client-vm) ]]; then
- nova boot --flavor m1.small --image xenial_x86_64 --nic net-id=$NET_ID \
+ nova boot --flavor m1.small --image $JUJU_VM_IMG --nic net-id=$NET_ID \
--key-name jump-key --security-group default juju-client-vm
if [ $? -ne 0 ]; then
log_error "boot juju-client-vm fail"
@@ -21,42 +28,25 @@ function launch_juju_vm()
fi
fi
- if [[ ! $(nova list | grep juju-metadata-vm) ]]; then
- nova boot --flavor m1.small --image xenial_x86_64 --nic net-id=$NET_ID \
- --key-name jump-key --security-group default juju-metadata-vm
- if [ $? -ne 0 ]; then
- log_error "boot juju-metadata-vm fail"
- exit 1
- fi
- fi
-
local count=300
set +x
while
- local state1=$(nova list | grep juju-client-vm | awk '{print $6}')
- local state2=$(nova list | grep juju-metadata-vm | awk '{print $6}')
- if [[ $state1 == "ERROR" || $state2 == "ERROR" || $count == 0 ]]; then
+ local state=$(nova list | grep juju-client-vm | awk '{print $6}')
+ if [[ $state == "ERROR" || $count == 0 ]]; then
log_error "launch juju vm error"
exit 1
fi
let count-=1
sleep 2
- [[ $state1 != "ACTIVE" || $state2 != "ACTIVE" ]]
+ [[ $state != "ACTIVE" ]]
do :;done
set -x
if [ ! $(nova list | grep juju-client-vm | awk '{print $14}') ]; then
- floating_ip_client=$(neutron floatingip-create ext-net | grep floating_ip_address | awk '{print $4}')
- nova floating-ip-associate juju-client-vm $floating_ip_client
+ juju_client_ip=$(neutron floatingip-create ext-net | grep floating_ip_address | awk '{print $4}')
+ nova floating-ip-associate juju-client-vm $juju_client_ip
else
- floating_ip_client=$(nova list | grep juju-client-vm | awk '{print $13}')
- fi
-
- if [ ! $(nova list | grep juju-metadata-vm | awk '{print $14}') ]; then
- floating_ip_metadata=$(neutron floatingip-create ext-net | grep floating_ip_address | awk '{print $4}')
- nova floating-ip-associate juju-metadata-vm $floating_ip_metadata
- else
- floating_ip_metadata=$(nova list | grep juju-metadata-vm | awk '{print $13}')
+ juju_client_ip=$(nova list | grep juju-client-vm | awk '{print $13}')
fi
local wait=120
@@ -66,39 +56,20 @@ function launch_juju_vm()
log_error "launch juju vm can't access"
exit 1
fi
- exec_cmd_on_client exit
- local ready1=$?
- exec_cmd_on_metadata exit
- local ready2=$?
+ exec_cmd_on_client exit 2>/dev/null
+ local ready=$?
let wait-=1
sleep 2
- [[ $ready1 != 0 || $ready2 != 0 ]]
+ [[ $ready != 0 ]]
do :;done
set -x
- export floating_ip_client=$floating_ip_client
- export floating_ip_metadata=$floating_ip_metadata
-}
-
-function juju_metadata_prepare()
-{
- local cmd="sudo apt update -y; \
- sudo apt-get install nginx -y"
- exec_cmd_on_metadata $cmd
-
- if [[ ! $(exec_cmd_on_metadata sudo ps -aux | grep nginx) ]]; then
- log_error "juju-metadata nginx error"
- exit 1
- fi
+ export juju_client_ip=$juju_client_ip
+ log_info "juju client launched!"
}
function juju_client_prepare()
{
- local cmd1="sudo add-apt-repository ppa:juju/stable; \
- sudo apt update -y; \
- sudo apt install juju zfsutils-linux -y"
- exec_cmd_on_client $cmd1
-
exec_cmd_on_client "echo 'clouds:
openstack:
type: openstack
@@ -107,37 +78,29 @@ function juju_client_prepare()
$OS_REGION_NAME:
endpoint: $OS_AUTH_URL' > clouds.yaml"
- local cmd2="juju add-cloud openstack clouds.yaml --replace"
- exec_cmd_on_client $cmd2
+ local cmd1="juju add-cloud openstack clouds.yaml --replace"
+ exec_cmd_on_client $cmd1
if [[ ! $(exec_cmd_on_client "juju list-clouds | grep openstack") ]]; then
log_error "juju-client add cloud error"
exit 1
fi
- local cmd3='ssh-keygen -q -t rsa -f /home/ubuntu/.ssh/id_rsa -N ""'
- exec_cmd_on_client $cmd3
-
- local client_key=`exec_cmd_on_client sudo cat /home/ubuntu/.ssh/id_rsa.pub`
- local cmd4="echo $client_key >> /home/ubuntu/.ssh/authorized_keys"
- exec_cmd_on_metadata $cmd4
+ local cmd2="juju remove-credential openstack openstack"
+ exec_cmd_on_client $cmd2
- exec_cmd_on_client "echo 'credentials:
- openstack:
- openstack:
- auth-type: userpass
- password: $OS_PASSWORD
- tenant-name: $OS_PROJECT_NAME
- username: $OS_USERNAME' > os-creds.yaml"
-
- local cmd5="juju add-credential openstack -f os-creds.yaml --replace"
- exec_cmd_on_client $cmd5
+ scp_to_client ${CONF_DIR}/admin-openrc.sh /home/ubuntu
}
function juju_generate_metadata()
{
exec_cmd_on_client mkdir -p mt
+ if [[ ! $(exec_cmd_on_client sudo ps aux | grep nginx) ]]; then
+ log_error "juju-metadata nginx is not running"
+ exit 1
+ fi
+
for((i=0;i<${#JUJU_IMG_NAME[@]};i++))
do
IMAGE_ID=$(glance image-list | grep ${JUJU_IMG_NAME[i]} | awk '{print $2}')
@@ -149,15 +112,12 @@ function juju_generate_metadata()
local cmd1="juju metadata generate-tools -d mt"
exec_cmd_on_client $cmd1
- local cmd2="rsync -e 'ssh -o StrictHostKeyChecking=no' -av mt ubuntu@$floating_ip_metadata:~/"
- exec_cmd_on_client $cmd2
-
- local cmd3="sudo cp -a mt/tools/ /var/www/html; \
+ local cmd2="sudo cp -a mt/tools/ /var/www/html; \
sudo cp -a mt/images/ /var/www/html; \
sudo chmod a+rx /var/www/html/ -R"
- exec_cmd_on_metadata $cmd3
+ exec_cmd_on_client $cmd2
- wget -O - http://$floating_ip_metadata/images/streams/v1/index.json
+ wget -O - http://$juju_client_ip/images/streams/v1/index.json
if [ $? -ne 0 ]; then
log_error "juju metadata generate error"
exit 1
@@ -166,13 +126,25 @@ function juju_generate_metadata()
function bootstrap_juju_controller()
{
- local cmd="juju bootstrap openstack openstack \
- --config image-metadata-url=http://$floating_ip_metadata/images \
- --config network=juju-net --config use-floating-ip=True \
- --config use-default-secgroup=True \
- --constraints 'mem=4G root-disk=40G' \
- --verbose --debug"
- exec_cmd_on_client $cmd
+ local cmd1="juju controllers | grep openstack"
+ exec_cmd_on_client $cmd1
+ if [[ $? != 0 ]];then
+ local cmd2="source admin-openrc.sh; \
+ juju bootstrap openstack openstack \
+ --config image-metadata-url=http://$juju_client_ip/images \
+ --config network=juju-net --config use-floating-ip=True \
+ --config use-default-secgroup=True \
+ --constraints 'mem=4G root-disk=40G' \
+ --verbose --debug"
+ exec_cmd_on_client $cmd2
+ exec_cmd_on_client $cmd1
+ if [[ $? == 0 ]];then
+ log_info "juju controller launched!"
+ else
+ log_error "launch juju controller fail!"
+ exit 1
+ fi
+ fi
}
function launch_juju()
@@ -180,7 +152,6 @@ function launch_juju()
log_info "launch_juju enter"
launch_juju_vm
- juju_metadata_prepare
juju_client_prepare
juju_generate_metadata
bootstrap_juju_controller
diff --git a/juju/juju_setup.sh b/juju/juju_setup.sh
index 4fd5cbc..eb49360 100755
--- a/juju/juju_setup.sh
+++ b/juju/juju_setup.sh
@@ -9,6 +9,7 @@
##############################################################################
IMG_DIR=${WORK_DIR}/img
+CSAR_DIR=${WORK_DIR}/csar
function juju_env_prepare()
{
@@ -30,22 +31,42 @@ function juju_download_img()
fi
}
+function juju_download_csar()
+{
+ if [ ! -e ${CSAR_DIR}/${1##*/} ];then
+ wget -O ${CSAR_DIR}/${1##*/} $1
+ fi
+}
+
function juju_prepare()
{
log_info "juju_prepare enter"
mkdir -p $IMG_DIR
-
for((i=0;i<${#JUJU_IMG_NAME[@]};i++))
do
juju_download_img ${JUJU_IMG_URL[i]}
if [[ ! $(glance image-list | grep ${JUJU_IMG_NAME[i]}) ]]; then
glance image-create --name=${JUJU_IMG_NAME[i]} \
- --disk-format qcow2 --container-format=bare \
- --visibility=public --file ${IMG_DIR}/${JUJU_IMG_URL[i]##*/}
+ --disk-format qcow2 --container-format=bare \
+ --visibility=public --file ${IMG_DIR}/${JUJU_IMG_URL[i]##*/}
fi
done
+ wget -nc -O $IMG_DIR/$JUJU_VM_IMG $JUJU_VM_IMG_URL
+ if [[ $(glance image-list | grep $JUJU_VM_IMG) ]]; then
+ openstack image delete $JUJU_VM_IMG
+ fi
+ glance image-create --name=$JUJU_VM_IMG \
+ --disk-format qcow2 --container-format=bare \
+ --visibility=public --file $IMG_DIR/$JUJU_VM_IMG
+
+ mkdir -p $CSAR_DIR
+ for((i=0;i<${#CSAR_NAME[@]};i++))
+ do
+ juju_download_csar ${CSAR_URL[i]}
+ done
+
if [[ ! $(neutron net-list | grep juju-net) ]]; then
neutron net-create juju-net
fi
@@ -93,16 +114,17 @@ function juju_prepare()
--remote-ip-prefix 0.0.0.0/0 $default_secgroup_id
fi
- if [ ! -f /root/.ssh/id_rsa.pub ]; then
- ssh-keygen -q -t rsa -f /root/.ssh/id_rsa -N ""
- fi
+ echo -e 'n\n'|ssh-keygen -q -t rsa -N "" -f /root/.ssh/id_rsa 1>/dev/null
- openstack keypair list | grep jump-key || openstack keypair create --public-key \
- /root/.ssh/id_rsa.pub jump-key
+ openstack keypair delete jump-key | true
+ openstack keypair create --public-key /root/.ssh/id_rsa.pub jump-key
openstack flavor show m1.tiny || openstack flavor create --ram 512 --disk 5 --vcpus 1 --public m1.tiny
openstack flavor show m1.small || openstack flavor create --ram 1024 --disk 10 --vcpus 1 --public m1.small
openstack flavor show m1.medium || openstack flavor create --ram 2048 --disk 10 --vcpus 2 --public m1.medium
openstack flavor show m1.large || openstack flavor create --ram 3072 --disk 10 --vcpus 2 --public m1.large
openstack flavor show m1.xlarge || openstack flavor create --ram 8096 --disk 30 --vcpus 4 --public m1.xlarge
+
+ openstack quota set --instances 20 admin
+ openstack quota set --core 30 admin
}
diff --git a/juju/openo_connect.py b/juju/openo_connect.py
index caae216..387ae98 100644..100755
--- a/juju/openo_connect.py
+++ b/juju/openo_connect.py
@@ -11,8 +11,11 @@
import argparse
import sys
import os
+import time
import requests
import json
+from pprint import pprint
+
class RaiseError(Exception):
def __init__(self, msg):
@@ -21,33 +24,42 @@ class RaiseError(Exception):
def __str__(self):
return repr(self.msg)
+
def request_get(url):
try:
resp = requests.get(url)
if resp.status_code not in (200,201):
+ pprint (resp.json())
raise RaiseError('get url: %s fail %d' % (url, resp.status_code))
except Exception:
raise
return resp.json()
+
def request_post(url, data, headers):
try:
resp = requests.post(url, data=json.dumps(data), headers=headers)
- if resp.status_code not in (200,201):
+ if resp.status_code not in (200,201,202):
+ pprint (resp.json())
raise RaiseError('post url: %s fail %d' % (url, resp.status_code))
except Exception:
raise
+ return resp.json()
+
+
def request_delete(url):
try:
resp = requests.delete(url)
if resp.status_code not in (200,201,204):
+ pprint (resp.json())
raise RaiseError('delete url: %s fail %d' % (url, resp.status_code))
except Exception:
raise
-def add_common_tosca_aria(msb_ip, tosca_aria_ip):
+
+def add_common_tosca_aria(msb_ip, tosca_aria_ip, tosca_aria_port):
url = 'http://' + msb_ip + '/openoapi/microservices/v1/apiRoute'
headers = {'Content-Type': 'application/json'}
data = {"serviceName":"tosca",
@@ -58,11 +70,24 @@ def add_common_tosca_aria(msb_ip, tosca_aria_ip):
"apiJsonType":"1",
"control":"0",
"status":"1",
- "servers":[{"ip":tosca_aria_ip,"port":"8204","weight":0}]}
+ "servers":[{"ip":tosca_aria_ip,"port":tosca_aria_port,"weight":0}]}
request_post(url, data, headers)
+
+def get_vim_id(msb_ip, vim_type):
+ vim_url = 'http://' + msb_ip + '/openoapi/extsys/v1/vims/'
+ get_vim = request_get(vim_url)
+ vimId = []
+ for i in get_vim:
+ if i["type"] == vim_type:
+ vimId.append(i['vimId'])
+
+ return vimId
+
+
def add_openo_vim(msb_ip, auth_url):
- url = 'http://' + msb_ip + '/openoapi/extsys/v1/vims/'
+ vim_url = 'http://' + msb_ip + '/openoapi/extsys/v1/vims/'
+ vnfm_url = 'http://' + msb_ip + '/openoapi/extsys/v1/vnfms/'
headers = {'Content-Type': 'application/json'}
data = {"name":"openstack",
"url":auth_url,
@@ -74,34 +99,32 @@ def add_openo_vim(msb_ip, auth_url):
"version":"newton",
"description":"",
"type":"openstack"}
- get = request_get(url)
- for i in get:
- if i["type"] == "openstack":
- request_delete(url + i["vimId"])
+ vimId = get_vim_id(msb_ip, "openstack")
+ if len(vimId) != 0:
+ get_vnfm = request_get(vnfm_url)
+ for i in get_vnfm:
+ if i["vimId"] == vimId[0]:
+ request_delete(vnfm_url + i["vnfmId"])
+ request_delete(vim_url + vimId[0])
+
+ request_post(vim_url, data, headers)
- request_post(url, data, headers)
def add_openo_vnfm(msb_ip, juju_client_ip):
- vim_url = 'http://' + msb_ip + '/openoapi/extsys/v1/vims'
- vnfm_url = 'http://' + msb_ip + '/openoapi/extsys/v1/vnfms'
+ vim_url = 'http://' + msb_ip + '/openoapi/extsys/v1/vims/'
+ vnfm_url = 'http://' + msb_ip + '/openoapi/extsys/v1/vnfms/'
headers = {'Content-Type': 'application/json'}
- get_vim = request_get(vim_url)
- vimId = ''
- for i in get_vim:
- if i["type"] == "openstack":
- vimId = i['vimId']
- break
-
- if vimId is None:
+ vimId = get_vim_id(msb_ip, "openstack")
+ if len(vimId) == 0:
raise RaiseError("vim openstack not found")
get_vnfm = request_get(vnfm_url)
for i in get_vnfm:
- if i["vimId"] == vimId:
+ if i["vimId"] == vimId[0]:
request_delete(vnfm_url + i["vnfmId"])
data = {"name":"Juju-VNFM",
- "vimId":vimId,
+ "vimId":vimId[0],
"vendor":"jujuvnfm",
"version":"jujuvnfm",
"type":"jujuvnfm",
@@ -112,27 +135,100 @@ def add_openo_vnfm(msb_ip, juju_client_ip):
"password":""}
request_post(vnfm_url, data, headers)
+
+def upload_csar(msb_ip, package):
+ csar_url = 'http://' + msb_ip + '/openoapi/catalog/v1/csars'
+ files = {'file': open(package, 'rb')}
+ res = requests.post(csar_url, files=files)
+ if res.status_code != 200:
+ pprint(res.json())
+ raise Exception('Error with uploading csar package: %s' % package)
+
+
+def delete_csars(msb_ip):
+ csar_url = 'http://' + msb_ip + '/openoapi/catalog/v1/csars/'
+ csars = request_get(csar_url)
+ for csar in csars:
+ csarId = csar["csarId"]
+ request_delete(csar_url + csarId)
+ pprint("csar %s is deleted" % csarId)
+
+
+def package_onboard(msb_ip):
+ csar_url = 'http://' + msb_ip + '/openoapi/catalog/v1/csars'
+ vnf_url = 'http://' + msb_ip + '/openoapi/nslcm/v1/vnfpackage'
+ ns_url = 'http://' + msb_ip + '/openoapi/nslcm/v1/nspackage'
+ headers = {'Content-Type': 'application/json'}
+ get_csar = request_get(csar_url)
+ vnf_csarId = ''
+ ns_csarId = ''
+ for i in get_csar:
+ if i["type"] == "NFAR":
+ vnf_csarId = i["csarId"]
+ if i["type"] == "NSAR":
+ ns_csarId = i["csarId"]
+
+ if vnf_csarId is None:
+ raise RaiseError("vnf package not found")
+ if ns_csarId is None:
+ raise RaiseError("ns package not found")
+
+ vnf_data = {"csarId": vnf_csarId}
+ ns_data = {"csarId": ns_csarId}
+ request_post(vnf_url, vnf_data, headers)
+ time.sleep(5)
+ request_post(ns_url, ns_data, headers)
+ get_csar_after = request_get(csar_url)
+ for i in get_csar_after:
+ if i["onBoardState"] == "non-onBoarded":
+ raise RaiseError("csar onboard fail")
+
+
+def create_service(msb_ip, ns_name, description, nsdId):
+ service_url = 'http://' + msb_ip + '/openoapi/servicegateway/v1/services'
+ headers = {'Content-Type': 'application/json'}
+ data1 = {"nsdId": nsdId,
+ "nsName": ns_name,
+ "description": description,
+ "gatewayUri":"/openoapi/nslcm/v1/ns"}
+ vimId = get_vim_id(msb_ip, "openstack")
+ resp = request_post(service_url, data1, headers)
+ instance_id = resp["serviceId"]
+ data2 = {"gatewayUri":"/openoapi/nslcm/v1/ns/" + instance_id + "/instantiate",
+ "nsInstanceId":instance_id,
+ "additionalParamForNs":{
+ "location":vimId[0],
+ "sdncontroller":"select"}
+ }
+ request_post(service_url, data2, headers)
+
+
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--msb_ip", action='store', help="common_services_msb ip")
parser.add_argument("--tosca_aria_ip", action='store', help="common_tosca_aria ip")
+ parser.add_argument("--tosca_aria_port", action='store', help="common_tosca_aria port")
parser.add_argument("--juju_client_ip", action='store', help="juju client ip")
parser.add_argument("--auth_url", action='store', help="openstack auth url")
+ parser.add_argument("--ns_pkg", action='store', help="ns package")
+ parser.add_argument("--vnf_pkg", action='store', help="vnf package")
args = parser.parse_args()
msb_ip = args.msb_ip
tosca_aria_ip = args.tosca_aria_ip
+ tosca_aria_port = args.tosca_aria_port
juju_client_ip = args.juju_client_ip
auth_url = args.auth_url
+ ns_pkg = args.ns_pkg
+ vnf_pkg = args.vnf_pkg
- if None in (msb_ip, tosca_aria_ip, juju_client_ip, auth_url):
- missing = []
- for i in (msb_ip, tosca_aria_ip, juju_client_ip, auth_url):
- if i is None:
- missing.append(i)
- raise RaiseError('missing parameter: %s' % missing)
-
- add_common_tosca_aria(msb_ip, tosca_aria_ip)
+ add_common_tosca_aria(msb_ip, tosca_aria_ip, tosca_aria_port)
add_openo_vim(msb_ip, auth_url)
add_openo_vnfm(msb_ip, juju_client_ip)
+
+ delete_csars(msb_ip)
+ upload_csar(msb_ip, vnf_pkg)
+ upload_csar(msb_ip, ns_pkg)
+ package_onboard(msb_ip)
+
diff --git a/juju/vims_deploy.sh b/juju/vims_deploy.sh
new file mode 100755
index 0000000..763a4f7
--- /dev/null
+++ b/juju/vims_deploy.sh
@@ -0,0 +1,69 @@
+#!/bin/bash -ex
+##############################################################################
+# Copyright (c) 2016-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
+##############################################################################
+
+juju_client_ip=$(openstack server list | grep juju-client-vm | awk '{print $9}')
+
+function deploy_app() {
+ python ${JUJU_DIR}/deploy_application.py --msb_ip $OPENO_IP:$COMMON_SERVICES_MSB_PORT \
+ --application $APP_NAME
+}
+
+function check_clearwater() {
+ check_clearwater_cmd='juju status | grep clearwater &> /dev/null'
+ try=10
+ duration=120
+ clearwater_started=false
+ while [[ $try -ge 0 ]]; do
+ if [[ $try -eq 0 ]]; then
+ log_error "Clearwater does not start within the given time"
+ exit 1
+ fi
+ exec_cmd_on_client $check_clearwater_cmd
+ if [[ $? -eq 0 ]]; then
+ clearwater_started=true
+ break
+ else
+ let try-=1
+ sleep $duration
+ fi
+ done
+
+ try=10
+ duration=120
+ check_status_cmd='juju status | grep idle | wc -l'
+ while [[ $try -ge 0 ]]; do
+ if [[ $try -eq 0 ]]; then
+ log_error "Clearwater does not fully start within the given time"
+ exit 1
+ fi
+ exec_cmd_on_client $check_status_cmd
+ count=$(exec_cmd_on_client $check_status_cmd)
+ if [[ $count -eq 7 ]]; then
+ echo "Clearwater has fully started"
+ break
+ else
+ echo "$count out of 7 nodes have started"
+ let try-=1
+ sleep $duration
+ fi
+ done
+
+ get_ellis_cmd='juju status | grep clearwater-ellis | grep tcp | awk "{print \$5}"'
+ ellis_internal_ip=$(exec_cmd_on_client $get_ellis_cmd)
+ ellis_external_ip=$(openstack server list | grep $ellis_internal_ip | awk '{print $9}')
+
+ get_bono_cmd='juju status | grep clearwater-bono | grep tcp | awk "{print \$5}"'
+ bono_internal_ip=$(exec_cmd_on_client $get_bono_cmd)
+ bono_external_ip=$(openstack server list | grep $bono_internal_ip | awk '{print $9}')
+
+ echo "Ellis: $ellis_external_ip"
+ echo "Bono: $bono_external_ip"
+}
+
diff --git a/open-o/openo_docker.sh b/open-o/openo_docker.sh
index 2bee04b..8a4a382 100755
--- a/open-o/openo_docker.sh
+++ b/open-o/openo_docker.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -ex
##############################################################################
# Copyright (c) 2016-2017 HUAWEI TECHNOLOGIES CO.,LTD and others.
#
@@ -9,67 +9,67 @@
##############################################################################
function docker_pull()
{
- until docker pull openoint/sdno-driver-ct-te:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-driver-ct-te:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/common-services-auth:REPLACE_OPENO_TAG
+ until docker pull openoint/common-services-auth:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/common-services-drivermanager:REPLACE_OPENO_TAG
+ until docker pull openoint/common-services-drivermanager:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/common-services-extsys:REPLACE_OPENO_TAG
+ until docker pull openoint/common-services-extsys:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/common-services-msb:REPLACE_OPENO_TAG
+ until docker pull openoint/common-services-msb:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/common-services-protocolstack:REPLACE_OPENO_TAG
+ until docker pull openoint/common-services-protocolstack:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/common-services-wso2ext:REPLACE_OPENO_TAG
+ until docker pull openoint/common-services-wso2ext:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/common-tosca-catalog:REPLACE_OPENO_TAG
+ until docker pull openoint/common-tosca-catalog:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/common-tosca-inventory:REPLACE_OPENO_TAG
+ until docker pull openoint/common-tosca-inventory:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/common-tosca-modeldesigner:REPLACE_OPENO_TAG
+ until docker pull openoint/common-tosca-modeldesigner:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/gso-service-gateway:REPLACE_OPENO_TAG
+ until docker pull openoint/gso-service-gateway:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/gso-service-manager:REPLACE_OPENO_TAG
+ until docker pull openoint/gso-service-manager:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/nfvo-dac:REPLACE_OPENO_TAG
+ until docker pull openoint/nfvo-dac:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/nfvo-driver-sdnc-zte:REPLACE_OPENO_TAG
+ until docker pull openoint/nfvo-driver-sdnc-zte:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/nfvo-driver-vim:REPLACE_OPENO_TAG
+ until docker pull openoint/nfvo-driver-vim:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/nfvo-driver-vnfm-huawei:REPLACE_OPENO_TAG
+ until docker pull openoint/nfvo-driver-vnfm-huawei:$OPENO_VERSION
do
echo "Try again"
done
@@ -77,95 +77,95 @@ function docker_pull()
do
echo "Try again"
done
- until docker pull openoint/nfvo-driver-vnfm-zte:REPLACE_OPENO_TAG
+ until docker pull openoint/nfvo-driver-vnfm-zte:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/nfvo-lcm:REPLACE_OPENO_TAG
+ until docker pull openoint/nfvo-lcm:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/nfvo-resmanagement:REPLACE_OPENO_TAG
+ until docker pull openoint/nfvo-resmanagement:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/nfvo-umc:REPLACE_OPENO_TAG
+ until docker pull openoint/nfvo-umc:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-driver-huawei-l3vpn:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-driver-huawei-l3vpn:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-driver-huawei-openstack:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-driver-huawei-openstack:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-driver-huawei-overlay:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-driver-huawei-overlay:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-driver-huawei-servicechain:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-driver-huawei-servicechain:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-driver-zte-sptn:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-driver-zte-sptn:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-service-brs:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-service-brs:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-service-ipsec:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-service-ipsec:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-service-l2vpn:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-service-l2vpn:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-service-l3vpn:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-service-l3vpn:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-service-mss:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-service-mss:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-service-nslcm:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-service-nslcm:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-service-overlayvpn:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-service-overlayvpn:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-service-servicechain:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-service-servicechain:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-service-vpc:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-service-vpc:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-service-vxlan:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-service-vxlan:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/common-tosca-aria:REPLACE_OPENO_TAG
+ until docker pull openoint/common-tosca-aria:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-monitoring:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-monitoring:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/sdno-vsitemgr:REPLACE_OPENO_TAG
+ until docker pull openoint/sdno-vsitemgr:$OPENO_VERSION
do
echo "Try again"
done
- until docker pull openoint/gso-gui-portal:REPLACE_OPENO_TAG
+ until docker pull openoint/gso-gui-portal:$OPENO_VERSION
do
echo "Try again"
done
@@ -173,57 +173,66 @@ function docker_pull()
function docker_run()
{
- docker run -d -e MODEL_DESIGNER_IP=COMMON_TOSCA_MODELDESIGNER_IP --network lab_net --ip COMMON_SERVICES_MSB_IP --name common-services-msb openoint/common-services-msb:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --add-host controller:127.0.0.1 --network lab_net --ip COMMON_SERVICES_AUTH_IP --name common-services-auth openoint/common-services-auth:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip COMMON_SERVICES_DRIVERMANAGER_IP --name common-services-drivermanager openoint/common-services-drivermanager:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip COMMON_SERVICES_EXTSYS_IP --name common-services-extsys openoint/common-services-extsys:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip COMMON_SERVICES_PROTOCOLSTACK_IP --name common-services-protocolstack openoint/common-services-protocolstack:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip COMMON_SERVICES_WSO2EXT_IP --name common-services-wso2ext openoint/common-services-wso2ext:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip COMMON_TOSCA_CATALOG_IP --name common-tosca-catalog openoint/common-tosca-catalog:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip COMMON_TOSCA_INVENTORY_IP --name common-tosca-inventory openoint/common-tosca-inventory:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip COMMON_TOSCA_MODELDESIGNER_IP --name common-tosca-modeldesigner openoint/common-tosca-modeldesigner:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip GSO_SERVICE_GATEWAY_IP --name gso-service-gateway openoint/gso-service-gateway:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 -e MYSQL_ADDR=COMMON_TOSCA_INVENTORY_IP:3306 --network lab_net --ip GSO_SERVICE_MANAGER_IP --name gso-service-manager openoint/gso-service-manager:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip NFVO_DAC_IP --name nfvo-dac openoint/nfvo-dac:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip NFVO_DRIVER_SDNC_ZTE_IP --name nfvo-driver-sdnc-zte openoint/nfvo-driver-sdnc-zte:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip NFVO_DRIVER_VIM_IP --name nfvo-driver-vim openoint/nfvo-driver-vim:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip NFVO_DRIVER_VNFM_HUAWEI_IP --name nfvo-driver-vnfm-huawei openoint/nfvo-driver-vnfm-huawei:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip NFVO_DRIVER_VNFM_JUJU_IP --name nfvo-driver-vnfm-juju openoint/nfvo-driver-vnfm-juju
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip NFVO_DRIVER_VNFM_ZTE_IP --name nfvo-driver-vnfm-zte openoint/nfvo-driver-vnfm-zte:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 -e MYSQL_ADDR=COMMON_TOSCA_INVENTORY_IP:3306 --network lab_net --ip NFVO_LCM_IP --name nfvo-lcm openoint/nfvo-lcm:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip NFVO_RESMANAGEMENT_IP --name nfvo-resmanagement openoint/nfvo-resmanagement:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip NFVO_UMC_IP --name nfvo-umc openoint/nfvo-umc:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_DRIVER_HUAWEI_L3VPN_IP --name sdno-driver-huawei-l3vpn openoint/sdno-driver-huawei-l3vpn:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_DRIVER_HUAWEI_OPENSTACK_IP --name sdno-driver-huawei-openstack openoint/sdno-driver-huawei-openstack:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_DRIVER_HUAWEI_OVERLAY_IP --name sdno-driver-huawei-overlay openoint/sdno-driver-huawei-overlay:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_DRIVER_HUAWEI_SERVICECHAIN_IP --name sdno-driver-huawei-servicechain openoint/sdno-driver-huawei-servicechain:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_DRIVER_ZTE_SPTN_IP --name sdno-driver-zte-sptn openoint/sdno-driver-zte-sptn:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_SERVICE_BRS_IP --name sdno-service-brs openoint/sdno-service-brs:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_SERVICE_IPSEC_IP --name sdno-service-ipsec openoint/sdno-service-ipsec:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_SERVICE_L2VPN_IP --name sdno-service-l2vpn openoint/sdno-service-l2vpn:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_SERVICE_L3VPN_IP --name sdno-service-l3vpn openoint/sdno-service-l3vpn:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_SERVICE_MSS_IP --name sdno-service-mss openoint/sdno-service-mss:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 -e MYSQL_ADDR=COMMON_TOSCA_INVENTORY_IP:3306 --network lab_net --ip SDNO_SERVICE_NSLCM_IP --name sdno-service-nslcm openoint/sdno-service-nslcm:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_SERVICE_OVERLAYVPN_IP --name sdno-service-overlayvpn openoint/sdno-service-overlayvpn:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_SERVICE_SERVICECHAIN_IP --name sdno-service-servicechain openoint/sdno-service-servicechain:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_SERVICE_VPC_IP --name sdno-service-vpc openoint/sdno-service-vpc:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_SERVICE_VXLAN_IP --name sdno-service-vxlan openoint/sdno-service-vxlan:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip COMMON_TOSCA_ARIA_IP --name common-tosca-aria openoint/common-tosca-aria:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_DRIVER_CT_TE_IP --name sdno-driver-ct-te openoint/sdno-driver-ct-te:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_MONITORING_IP --name sdno-monitoring openoint/sdno-monitoring:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip SDNO_VSITEMGR_IP --name sdno-vsitemgr openoint/sdno-vsitemgr:REPLACE_OPENO_TAG
- docker run -d -e MSB_ADDR=COMMON_SERVICES_MSB_IP:80 --network lab_net --ip GSO_GUI_PORTAL_IP --name gso-gui-portal openoint/gso-gui-portal:REPLACE_OPENO_TAG
+ OPENO_VERSION=${OPENO_VERSION:-"1.0.0"}
+ msb_ip=$OPENO_IP:$COMMON_SERVICES_MSB_PORT
+
+ docker run -d --name common-services-msb -p $OPENO_IP:$COMMON_SERVICES_MSB_PORT:80 openoint/common-services-msb:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --add-host controller:127.0.0.1 --name common-services-auth openoint/common-services-auth:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name common-services-drivermanager openoint/common-services-drivermanager:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name common-services-extsys openoint/common-services-extsys:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name common-services-protocolstack openoint/common-services-protocolstack:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name common-services-wso2ext openoint/common-services-wso2ext:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name common-tosca-catalog openoint/common-tosca-catalog:$OPENO_VERSION
+ tosca_inventory_id=$(docker run -d -e MSB_ADDR=$msb_ip --name common-tosca-inventory openoint/common-tosca-inventory:$OPENO_VERSION)
+ tosca_inventory_ip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $tosca_inventory_id)
+ docker run -d -e MSB_ADDR=$msb_ip --name common-tosca-modeldesigner openoint/common-tosca-modeldesigner:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name gso-service-gateway openoint/gso-service-gateway:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip -e MYSQL_ADDR=$tosca_inventory_ip:3306 --name gso-service-manager openoint/gso-service-manager:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name nfvo-dac openoint/nfvo-dac:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name nfvo-driver-sdnc-zte openoint/nfvo-driver-sdnc-zte:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name nfvo-driver-vim openoint/nfvo-driver-vim:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name nfvo-driver-vnfm-huawei openoint/nfvo-driver-vnfm-huawei:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name nfvo-driver-vnfm-juju -p $OPENO_IP:$NFVO_DRIVER_VNFM_JUJU_PORT:8483 -p $OPENO_IP:$NFVO_DRIVER_VNFM_JUJU_MYSQL_PORT:3306 openoint/nfvo-driver-vnfm-juju
+ docker run -d -e MSB_ADDR=$msb_ip --name nfvo-driver-vnfm-zte openoint/nfvo-driver-vnfm-zte:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip -e MYSQL_ADDR=$tosca_inventory_ip:3306 --name nfvo-lcm -p $OPENO_IP:8403:8403 openoint/nfvo-lcm:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name nfvo-resmanagement openoint/nfvo-resmanagement:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name nfvo-umc openoint/nfvo-umc:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-driver-huawei-l3vpn openoint/sdno-driver-huawei-l3vpn:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-driver-huawei-openstack openoint/sdno-driver-huawei-openstack:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-driver-huawei-overlay openoint/sdno-driver-huawei-overlay:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-driver-huawei-servicechain openoint/sdno-driver-huawei-servicechain:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-driver-zte-sptn openoint/sdno-driver-zte-sptn:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-brs openoint/sdno-service-brs:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-ipsec openoint/sdno-service-ipsec:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-l2vpn openoint/sdno-service-l2vpn:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-l3vpn openoint/sdno-service-l3vpn:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-mss openoint/sdno-service-mss:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip -e MYSQL_ADDR=$tosca_inventory_ip:3306 --name sdno-service-nslcm openoint/sdno-service-nslcm:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-overlayvpn openoint/sdno-service-overlayvpn:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-servicechain openoint/sdno-service-servicechain:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-vpc openoint/sdno-service-vpc:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-service-vxlan openoint/sdno-service-vxlan:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name common-tosca-aria -p $OPENO_IP:$COMMON_TOSCA_ARIA_PORT:8204 openoint/common-tosca-aria:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-driver-ct-te openoint/sdno-driver-ct-te:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-monitoring openoint/sdno-monitoring:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name sdno-vsitemgr openoint/sdno-vsitemgr:$OPENO_VERSION
+ docker run -d -e MSB_ADDR=$msb_ip --name gso-gui-portal openoint/gso-gui-portal:$OPENO_VERSION
+}
+
+function clean() {
+ docker ps -a | grep openoint | awk '{print $1}' | xargs docker rm -f || true
}
-yum update -y
-yum install -y curl net-tools
-curl -sSL https://experimental.docker.com/ | sh
-service docker start
-docker network create -d macvlan --subnet=OPENO_EXTERNAL_CIDR --gateway=OPENO_EXTERNAL_GW -o parent=eth0 lab_net
-docker_pull
-docker_run
+function launch_openo() {
+ log_info "launch_openo enter"
+
+ docker_pull
+ clean
+ docker_run
+
+ if [[ $(docker ps -q | grep openoint | wc -l) == 40 ]];then
+ echo -e "\n\033[32mOpen-O launch success\033[0m\n"
+ fi
+}
-if [[ $(docker ps -aq | wc -l) == 40 ]];then
- echo -e "\n\033[32mOpen-O Installed!\033[0m\n"
-fi
diff --git a/open-o/openo_vm.sh b/open-o/openo_vm.sh
deleted file mode 100755
index fdce33a..0000000
--- a/open-o/openo_vm.sh
+++ /dev/null
@@ -1,201 +0,0 @@
-#!/bin/bash
-##############################################################################
-# Copyright (c) 2016-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
-##############################################################################
-set -ex
-OPENO_VM_ISO=${OPENO_VM_ISO_URL##*/}
-OPENO_VM_DIR=${WORK_DIR}/openo_vm
-
-function openo_download_iso()
-{
- local ISO_DIR=${WORK_DIR}/iso
- mkdir -p $ISO_DIR
- if [ ! -e ${ISO_DIR}/${OPENO_VM_ISO} ];then
- wget -O ${ISO_DIR}/${OPENO_VM_ISO} $OPENO_VM_ISO_URL
- fi
-}
-
-function openo_docker_prepare()
-{
- cp $OPENO_DIR/openo_docker.sh ${OPENO_VM_DIR}/
- sed -i -e "s#REPLACE_OPENO_TAG#$OPENO_TAG#g" \
- -e "s#OPENO_EXTERNAL_CIDR#$OPENO_EXTERNAL_CIDR#g" \
- -e "s/OPENO_EXTERNAL_GW/$OPENO_EXTERNAL_GW/g" \
- -e "s/COMMON_SERVICES_AUTH_IP/$COMMON_SERVICES_AUTH_IP/g" \
- -e "s/COMMON_SERVICES_DRIVERMANAGER_IP/$COMMON_SERVICES_DRIVERMANAGER_IP/g" \
- -e "s/COMMON_SERVICES_EXTSYS_IP/$COMMON_SERVICES_EXTSYS_IP/g" \
- -e "s/COMMON_SERVICES_MSB_IP/$COMMON_SERVICES_MSB_IP/g" \
- -e "s/COMMON_SERVICES_PROTOCOLSTACK_IP/$COMMON_SERVICES_PROTOCOLSTACK_IP/g" \
- -e "s/COMMON_SERVICES_WSO2EXT_IP/$COMMON_SERVICES_WSO2EXT_IP/g" \
- -e "s/COMMON_TOSCA_CATALOG_IP/$COMMON_TOSCA_CATALOG_IP/g" \
- -e "s/COMMON_TOSCA_INVENTORY_IP/$COMMON_TOSCA_INVENTORY_IP/g" \
- -e "s/COMMON_TOSCA_MODELDESIGNER_IP/$COMMON_TOSCA_MODELDESIGNER_IP/g" \
- -e "s/GSO_SERVICE_GATEWAY_IP/$GSO_SERVICE_GATEWAY_IP/g" \
- -e "s/GSO_SERVICE_MANAGER_IP/$GSO_SERVICE_MANAGER_IP/g" \
- -e "s/NFVO_DAC_IP/$NFVO_DAC_IP/g" \
- -e "s/NFVO_DRIVER_SDNC_ZTE_IP/$NFVO_DRIVER_SDNC_ZTE_IP/g" \
- -e "s/NFVO_DRIVER_VIM_IP/$NFVO_DRIVER_VIM_IP/g" \
- -e "s/NFVO_DRIVER_VNFM_HUAWEI_IP/$NFVO_DRIVER_VNFM_HUAWEI_IP/g" \
- -e "s/NFVO_DRIVER_VNFM_JUJU_IP/$NFVO_DRIVER_VNFM_JUJU_IP/g" \
- -e "s/NFVO_DRIVER_VNFM_ZTE_IP/$NFVO_DRIVER_VNFM_ZTE_IP/g" \
- -e "s/NFVO_LCM_IP/$NFVO_LCM_IP/g" \
- -e "s/NFVO_RESMANAGEMENT_IP/$NFVO_RESMANAGEMENT_IP/g" \
- -e "s/NFVO_UMC_IP/$NFVO_UMC_IP/g" \
- -e "s/SDNO_DRIVER_HUAWEI_L3VPN_IP/$SDNO_DRIVER_HUAWEI_L3VPN_IP/g" \
- -e "s/SDNO_DRIVER_HUAWEI_OPENSTACK_IP/$SDNO_DRIVER_HUAWEI_OPENSTACK_IP/g" \
- -e "s/SDNO_DRIVER_HUAWEI_OVERLAY_IP/$SDNO_DRIVER_HUAWEI_OVERLAY_IP/g" \
- -e "s/SDNO_DRIVER_HUAWEI_SERVICECHAIN_IP/$SDNO_DRIVER_HUAWEI_SERVICECHAIN_IP/g" \
- -e "s/SDNO_DRIVER_ZTE_SPTN_IP/$SDNO_DRIVER_ZTE_SPTN_IP/g" \
- -e "s/SDNO_SERVICE_BRS_IP/$SDNO_SERVICE_BRS_IP/g" \
- -e "s/SDNO_SERVICE_IPSEC_IP/$SDNO_SERVICE_IPSEC_IP/g" \
- -e "s/SDNO_SERVICE_L2VPN_IP/$SDNO_SERVICE_L2VPN_IP/g" \
- -e "s/SDNO_SERVICE_L3VPN_IP/$SDNO_SERVICE_L3VPN_IP/g" \
- -e "s/SDNO_SERVICE_MSS_IP/$SDNO_SERVICE_MSS_IP/g" \
- -e "s/SDNO_SERVICE_NSLCM_IP/$SDNO_SERVICE_NSLCM_IP/g" \
- -e "s/SDNO_SERVICE_OVERLAYVPN_IP/$SDNO_SERVICE_OVERLAYVPN_IP/g" \
- -e "s/SDNO_SERVICE_SERVICECHAIN_IP/$SDNO_SERVICE_SERVICECHAIN_IP/g" \
- -e "s/SDNO_SERVICE_VPC_IP/$SDNO_SERVICE_VPC_IP/g" \
- -e "s/SDNO_SERVICE_VXLAN_IP/$SDNO_SERVICE_VXLAN_IP/g" \
- -e "s/COMMON_TOSCA_ARIA_IP/$COMMON_TOSCA_ARIA_IP/g" \
- -e "s/SDNO_DRIVER_CT_TE_IP/$SDNO_DRIVER_CT_TE_IP/g" \
- -e "s/SDNO_MONITORING_IP/$SDNO_MONITORING_IP/g" \
- -e "s/SDNO_VSITEMGR_IP/$SDNO_VSITEMGR_IP/g" \
- -e "s/GSO_GUI_PORTAL_IP/$GSO_GUI_PORTAL_IP/g" \
- ${OPENO_VM_DIR}/openo_docker.sh
-
- scp_to_openo ${OPENO_VM_DIR}/openo_docker.sh /home
-}
-
-function launch_openo_docker()
-{
- openo_docker_prepare
- local cmd="/home/openo_docker.sh"
- exec_cmd_on_openo $cmd
-}
-
-function tear_down_openo()
-{
- sudo virsh destroy open-o > /dev/null 2>&1
- sudo virsh undefine open-o > /dev/null 2>&1
-
- sudo umount $OPENO_VM_DIR/old > /dev/null 2>&1
- sudo umount $OPENO_VM_DIR/new > /dev/null 2>&1
-
- sudo rm -rf $OPENO_VM_DIR
-
- log_info "tear_down_openo success!!!"
-}
-
-function wait_openo_ok()
-{
- set +x
- log_info "wait_openo_ok enter"
- ssh-keygen -f "/root/.ssh/known_hosts" -R $OPENO_VM_IP >/dev/null 2>&1
- local retry=0
- until timeout 1s exec_cmd_on_openo "exit" >/dev/null 2>&1
- do
- log_progress "os install time used: $((retry*100/$1))%"
- sleep 1
- let retry+=1
- if [[ $retry -ge $1 ]];then
- # first try
- exec_cmd_on_openo "exit"
- # second try
- exec_cmd_on_openo "exit"
- local exit_status=$?
- if [[ $exit_status == 0 ]]; then
- log_warn "final ssh login open-o success !!!"
- break
- fi
- log_error "final ssh retry failed with status: " $exit_status
- log_error "os install time out"
- exit 1
- fi
- done
- set -x
- log_warn "os install time used: 100%"
- log_info "wait_openo_ok exit"
-}
-
-function launch_openo_vm() {
- set -x
-
- local old_mnt=${OPENO_VM_DIR}/old
- local new_mnt=${OPENO_VM_DIR}/new
- local old_iso=${WORK_DIR}/iso/${OPENO_VM_ISO}
- local new_iso=${OPENO_VM_DIR}/centos.iso
- local rsa_file=${OPENO_VM_DIR}/boot.rsa
-
- sudo virsh net-destroy external
- sudo virsh net-undefine external
-
- if [[ ! $(virsh net-list | grep external) ]]; then
- sudo virsh net-define ${UTIL_DIR}/external-net.xml
- sudo virsh net-start external
- fi
-
- log_info "launch_openo enter"
-
- tear_down_openo
-
- mkdir -p $OPENO_VM_DIR $old_mnt
- sudo mount -o loop $old_iso $old_mnt
- cd $old_mnt;find .|cpio -pd $new_mnt;cd -
-
- sudo umount $old_mnt
-
- chmod 755 -R $new_mnt
-
- cp ${UTIL_DIR}/isolinux.cfg $new_mnt/isolinux/ -f
- cp ${UTIL_DIR}/ks.cfg $new_mnt/isolinux/ -f
-
- sed -i -e "s/REPLACE_EXTERNAL_IP/$OPENO_VM_IP/g" \
- -e "s/REPLACE_EXTERNAL_NETMASK/$OPENO_VM_MASK/g" \
- -e "s/REPLACE_EXTERNAL_GW/$OPENO_EXTERNAL_GW/g" \
- $new_mnt/isolinux/isolinux.cfg
-
- mkdir -p $new_mnt/bootstrap
- ssh-keygen -f $new_mnt/bootstrap/boot.rsa -t rsa -N ''
- cp $new_mnt/bootstrap/boot.rsa $rsa_file
-
- rm -rf $new_mnt/.rr_moved $new_mnt/rr_moved
- sudo mkisofs -quiet -r -J -R -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -hide-rr-moved -x "lost+found:" -o $new_iso $new_mnt
-
- rm -rf $old_mnt $new_mnt
-
- qemu-img create -f qcow2 ${OPENO_VM_DIR}/disk.img ${OPENO_VIRT_DISK}G
-
- let OPENO_VIRT_MEM*=1024
- # create vm xml
- sed -e "s/REPLACE_MEM/$OPENO_VIRT_MEM/g" \
- -e "s/REPLACE_CPU/$OPENO_VIRT_CPUS/g" \
- -e "s#REPLACE_IMAGE#$OPENO_VM_DIR/disk.img#g" \
- -e "s#REPLACE_ISO#$OPENO_VM_DIR/centos.iso#g" \
- -e "s/REPLACE_NET_EXTERNAL/$OPENO_VM_NET/g" \
- ${UTIL_DIR}/libvirt.xml \
- > ${OPENO_VM_DIR}/open-o.xml
-
- sudo virsh define ${OPENO_VM_DIR}/open-o.xml
- sudo virsh start open-o
-
- local exit_status=$?
- if [ $exit_status != 0 ];then
- log_error "virsh start open-o failed"
- exit 1
- fi
-
- if ! wait_openo_ok 300;then
- log_error "install os timeout"
- exit 1
- fi
-
- set +x
- log_info "launch_openo exit"
-}
-
-set +ex
diff --git a/opera_launch.sh b/opera_launch.sh
index c48fcb3..0af0718 100755
--- a/opera_launch.sh
+++ b/opera_launch.sh
@@ -8,6 +8,7 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
set -ex
+start=$(date +%s)
export OPERA_DIR=`cd ${BASH_SOURCE[0]%/*}/;pwd`
CONF_DIR=${OPERA_DIR}/conf
OPENO_DIR=${OPERA_DIR}/open-o
@@ -19,53 +20,37 @@ export DEPLOY_FIRST_TIME=${DEPLOY_FIRST_TIME:-"true"}
export DEPLOY_OPENO=${DEPLOY_OPENO:-"true"}
export DEPLOY_JUJU=${DEPLOY_JUJU:-"true"}
-source ${OPERA_DIR}/prepare.sh
-generate_conf
-source ${OPERA_DIR}/conf/download.conf
-source ${WORK_DIR}/scripts/openo-vm.conf
-source ${WORK_DIR}/scripts/network.conf
+source ${OPERA_DIR}/conf/admin-openrc.sh
+source ${OPERA_DIR}/prepare.sh
+source ${OPERA_DIR}/conf/juju.conf
+source ${OPENO_DIR}/openo_docker.sh
source ${UTIL_DIR}/log.sh
-source ${OPENO_DIR}/openo_vm.sh
-source ${OPERA_DIR}/command.sh
-source ${JUJU_DIR}/adapter.sh
+source ${JUJU_DIR}/command.sh
source ${JUJU_DIR}/juju_setup.sh
source ${JUJU_DIR}/juju_launch.sh
source ${JUJU_DIR}/juju_connect.sh
+source ${JUJU_DIR}/vims_deploy.sh
mkdir -p $WORK_DIR
if [[ "$DEPLOY_FIRST_TIME" == "true" ]]; then
- package_prepare
- network_prepare
- generate_compass_openrc
+ prepare_env
fi
-source $WORK_DIR/admin-openrc.sh
-
-sudo sync && sudo sysctl -w vm.drop_caches=3
+source ${WORK_DIR}/scripts/open-o.conf
+source ${WORK_DIR}/scripts/application.conf
if [[ "$DEPLOY_OPENO" == "true" ]]; then
- if ! openo_download_iso; then
- log_error "openo_download_iso failed"
- exit 1
- fi
-
- if ! launch_openo_vm; then
- log_error "launch_openo_vm failed"
- exit 1
- fi
-
- if ! launch_openo_docker; then
- log_error "launch_openo_docker failed"
+ if ! launch_openo;then
+ log_error "launch_openo failed"
exit 1
fi
fi
-sudo sync && sudo sysctl -w vm.drop_caches=3
-
if [[ "$DEPLOY_JUJU" == "true" ]]; then
juju_env_prepare
+ clear_juju_vm
if ! juju_prepare; then
log_error "juju_prepare failed"
@@ -76,9 +61,15 @@ if [[ "$DEPLOY_JUJU" == "true" ]]; then
log_error "launch_juju failed"
exit 1
fi
-
connect_juju_and_openo
fi
-figlet -ctf slant Open-O Installed!
+if [[ -n $APP_NAME ]]; then
+ deploy_app
+fi
+
+figlet -ctf slant Open-O Installed
+end=$(date +%s)
+runtime=$[(end-start) / 60]
+echo "Duration: $runtime mins"
set +ex
diff --git a/prepare.sh b/prepare.sh
index 1b07679..a503d7b 100755
--- a/prepare.sh
+++ b/prepare.sh
@@ -7,47 +7,53 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+SCRIPT_DIR=${WORK_DIR}/scripts
function generate_conf()
{
- rm -rf ${WORK_DIR}/scripts
- mkdir -p ${WORK_DIR}/scripts
- python ${OPERA_DIR}/process_conf.py ${CONF_DIR}/openo-vm.yml ${CONF_DIR}/network.yml
+ rm -rf ${SCRIPT_DIR}
+ mkdir -p ${SCRIPT_DIR}
+ python ${OPERA_DIR}/process_conf.py ${CONF_DIR}/open-o.yml \
+ ${CONF_DIR}/application.yml
}
function package_prepare()
{
if [[ $(grep Ubuntu /etc/issue) ]]; then
sudo apt-get update -y
- sudo apt-get install -y wget mkisofs qemu-utils qemu-kvm libvirt-bin openvswitch-switch python-pip sshpass figlet
+ sudo apt-get install -y wget python-pip sshpass figlet curl net-tools
else
# not test with redhat server yet
sudo yum update -y
- sudo yum install -y wget mkisofs qemu-kvm libvirt-bin openvswitch-switch python-pip sshpass figlet
+ sudo yum install -y wget python-pip sshpass figlet curl net-tools
+ fi
+ sudo pip install pyyaml
+ docker version &>/dev/null
+ if [[ $? != 0 ]];then
+ curl -sSL https://experimental.docker.com/ | sh
+ service docker start
fi
- service openvswitch-switch start
}
function network_prepare()
{
- sudo ovs-vsctl list-br |grep br-external
- br_exist=$?
- external_nic=`ip route |grep '^default'|awk '{print $5F}'`
- route_info=`ip route |grep -Eo '^default via [^ ]+'`
- ip_info=`ip addr show $external_nic|grep -Eo '[^ ]+ brd [^ ]+ '`
- if [ $br_exist -eq 0 ]; then
- if [ "$external_nic" != "br-external" ]; then
- sudo ovs-vsctl --may-exist add-port br-external $external_nic
- sudo ip addr flush $external_nic
- sudo ip addr add $ip_info dev br-external
- sudo ip route add $route_info dev br-external
+ local assigned_ip=`sed -n 's/OPENO_IP=//p' ${SCRIPT_DIR}/open-o.conf`
+ echo $assigned_ip
+ if [[ $assigned_ip != 'None' ]]; then
+ if [[ ! $(ifconfig -a | grep openo) ]]; then
+ sudo ip tuntap add dev openo mode tap
fi
+ sudo ifconfig openo $assigned_ip up
else
- sudo ovs-vsctl add-br br-external
- sudo ifconfig br-external up
- sudo ovs-vsctl add-port br-external $external_nic
- sudo ip addr flush $external_nic
- sudo ip addr add $ip_info dev br-external
- sudo ip route add $route_info dev br-external
+ external_nic=`ip route |grep '^default'|awk '{print $5F}'`
+ host_ip=`ifconfig $external_nic | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
+ sed -i "s/^\(.*OPENO_IP=\).*/\1$host_ip/g" ${SCRIPT_DIR}/open-o.conf
fi
}
+
+function prepare_env()
+{
+ generate_conf
+ package_prepare
+ network_prepare
+}
diff --git a/process_conf.py b/process_conf.py
index a28f809..c8f4e9d 100644
--- a/process_conf.py
+++ b/process_conf.py
@@ -14,31 +14,27 @@ def load_file(file):
return None
-def generate_vm_conf(vm_config, scripts_dir):
- """generate opera/work/scripts_dir/openo-vm.conf"""
- print vm_config["openo"]["cpu"]
- with open(scripts_dir + "/openo-vm.conf", "w") as fd:
- fd.write("OPENO_TAG=" + str(vm_config["openo"]["tag"]) + "\n")
- fd.write("OPENO_VIRT_CPUS=" + str(vm_config["openo"]["cpu"]) + "\n")
- fd.write("OPENO_VIRT_MEM=" + str(vm_config["openo"]["memory"]) + "\n")
- fd.write("OPENO_VIRT_DISK=" + str(vm_config["openo"]["disk"]) + "\n")
- fd.write("OPENO_VM_NET=" + vm_config["openo"]["vnet"] + "\n")
+def generate_openo_conf(openo_config, scripts_dir):
+ """generate opera/work/scripts_dir/open-o.conf"""
+ with open(scripts_dir + "/open-o.conf", "w") as fd:
+ for i in openo_config["openo_net"].keys():
+ fd.write('{0}={1}\n'.format(i.upper(), openo_config["openo_net"][i]))
+ for i in openo_config["openo_docker_net"]:
+ fd.write('{0}={1}\n'.format(i.upper(), openo_config["openo_docker_net"][i]))
-def generate_net_conf(net_config, scripts_dir):
- """generate opera/work/scripts_dir/network.conf"""
- with open(scripts_dir + "/network.conf", "w") as fd:
- for i in net_config["openo_net"].keys():
- fd.write(i.upper() + "=" + net_config["openo_net"][i])
- fd.write("\n")
+ fd.write('{0}={1}\n'.format('OPENO_VERSION', openo_config["openo_version"]))
- for i in net_config["openo_docker_net"].keys():
- fd.write(i.upper() + "=" + net_config["openo_docker_net"][i])
- fd.write("\n")
- for i in net_config["juju_net"].keys():
- fd.write(i.upper() + "=" + net_config["juju_net"][i])
- fd.write("\n")
+def generate_app_conf(openo_config, app_config, scripts_dir):
+ """generate opera/work/scripts_dir/application.conf"""
+ with open(scripts_dir + "/application.conf", "w") as fd:
+ for i in app_config["application"]:
+ if i["name"] == openo_config["application"]:
+ fd.write('{0}={1}\n'.format('APP_NAME', i["name"]))
+ fd.write('{0}={1}\n'.format('APP_NS_PKG', i["ns_pkg"]))
+ fd.write('{0}={1}'.format('APP_VNF_PKG', i["vnf_pkg"]))
+ break
if __name__ == "__main__":
@@ -46,22 +42,24 @@ if __name__ == "__main__":
print("parameter wrong%d %s" % (len(sys.argv), sys.argv))
sys.exit(1)
- _, vm_file, net_file = sys.argv
+ _, openo_file, app_file = sys.argv
- if not os.path.exists(vm_file):
- print("openo-vm.yml doesn't exit")
- sys.exit(1)
- if not os.path.exists(net_file):
+ if not os.path.exists(openo_file):
print("network.yml doesn't exit")
sys.exit(1)
- vm_config = load_file(vm_file)
- net_config = load_file(net_file)
- if not vm_config:
- print('format error in %s' % vm_file)
+ if not os.path.exists(app_file):
+ print("application.yml doesn't exit")
+ sys.exit(1)
+
+ openo_config = load_file(openo_file)
+ if not openo_config:
+ print('format error in %s' % openo_file)
sys.exit(1)
- if not net_config:
- print('format error in %s' % net_file)
+
+ app_config = load_file(app_file)
+ if not app_config:
+ print('format error in %s' % app_file)
sys.exit(1)
opera_dir = os.getenv('OPERA_DIR')
@@ -70,5 +68,5 @@ if __name__ == "__main__":
print("dir opera/work/scripts doesn't exit")
sys.exit(1)
- generate_vm_conf(vm_config, scripts_dir)
- generate_net_conf(net_config, scripts_dir)
+ generate_openo_conf(openo_config, scripts_dir)
+ generate_app_conf(openo_config, app_config, scripts_dir)
diff --git a/util/external-net.xml b/util/external-net.xml
deleted file mode 100644
index 40c2336..0000000
--- a/util/external-net.xml
+++ /dev/null
@@ -1,7 +0,0 @@
- <network ipv6='no'>
- <name>external</name>
- <bridge name='br-external'/>
- <forward mode='bridge'/>
- <virtualport type='openvswitch'/>
- </network>
-
diff --git a/util/grant_mysql.sh b/util/grant_mysql.sh
index 15c68ba..15c68ba 100644..100755
--- a/util/grant_mysql.sh
+++ b/util/grant_mysql.sh
diff --git a/util/isolinux.cfg b/util/isolinux.cfg
deleted file mode 100644
index f468818..0000000
--- a/util/isolinux.cfg
+++ /dev/null
@@ -1,120 +0,0 @@
-default vesamenu.c32
-timeout 1
-
-display boot.msg
-
-# Clear the screen when exiting the menu, instead of leaving the menu displayed.
-# For vesamenu, this means the graphical background is still displayed without
-# the menu itself for as long as the screen remains in graphics mode.
-menu clear
-menu background splash.png
-menu title CentOS 7
-menu vshift 8
-menu rows 18
-menu margin 8
-#menu hidden
-menu helpmsgrow 15
-menu tabmsgrow 13
-
-# Border Area
-menu color border * #00000000 #00000000 none
-
-# Selected item
-menu color sel 0 #ffffffff #00000000 none
-
-# Title bar
-menu color title 0 #ff7ba3d0 #00000000 none
-
-# Press [Tab] message
-menu color tabmsg 0 #ff3a6496 #00000000 none
-
-# Unselected menu item
-menu color unsel 0 #84b8ffff #00000000 none
-
-# Selected hotkey
-menu color hotsel 0 #84b8ffff #00000000 none
-
-# Unselected hotkey
-menu color hotkey 0 #ffffffff #00000000 none
-
-# Help text
-menu color help 0 #ffffffff #00000000 none
-
-# A scrollbar of some type? Not sure.
-menu color scrollbar 0 #ffffffff #ff355594 none
-
-# Timeout msg
-menu color timeout 0 #ffffffff #00000000 none
-menu color timeout_msg 0 #ffffffff #00000000 none
-
-# Command prompt text
-menu color cmdmark 0 #84b8ffff #00000000 none
-menu color cmdline 0 #ffffffff #00000000 none
-
-# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.
-
-menu tabmsg Press Tab for full configuration options on menu items.
-
-menu separator # insert an empty line
-menu separator # insert an empty line
-
-label linux
- menu label ^Install CentOS 7
- menu default
- kernel vmlinuz
- append ks=cdrom:/isolinux/ks.cfg initrd=initrd.img external_ip=REPLACE_EXTERNAL_IP external_netmask=REPLACE_EXTERNAL_NETMASK external_gw=REPLACE_EXTERNAL_GW dns1=8.8.8.8
-
-label check
- menu label Test this ^media & install CentOS 7
- kernel vmlinuz
- append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rd.live.check quiet
-
-menu separator # insert an empty line
-
-# utilities submenu
-menu begin ^Troubleshooting
- menu title Troubleshooting
-
-label vesa
- menu indent count 5
- menu label Install CentOS 7 in ^basic graphics mode
- text help
- Try this option out if you're having trouble installing
- CentOS 7.
- endtext
- kernel vmlinuz
- append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 xdriver=vesa nomodeset quiet
-
-label rescue
- menu indent count 5
- menu label ^Rescue a CentOS system
- text help
- If the system will not boot, this lets you access files
- and edit config files to try to get it booting again.
- endtext
- kernel vmlinuz
- append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rescue quiet
-
-label memtest
- menu label Run a ^memory test
- text help
- If your system is having issues, a problem with your
- system's memory may be the cause. Use this utility to
- see if the memory is working correctly.
- endtext
- kernel memtest
-
-menu separator # insert an empty line
-
-label local
- menu label Boot from ^local drive
- localboot 0xffff
-
-menu separator # insert an empty line
-menu separator # insert an empty line
-
-label returntomain
- menu label Return to ^main menu
- menu exit
-
-menu end
diff --git a/util/ks.cfg b/util/ks.cfg
deleted file mode 100644
index 8955e0c..0000000
--- a/util/ks.cfg
+++ /dev/null
@@ -1,228 +0,0 @@
-##############################################################################
-# Copyright (c) 2016-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
-##############################################################################
-#version=DEVEL
-# System authorization information
-auth --useshadow --enablemd5
-# Install OS instead of upgrade
-install
-# License agreement
-eula --agreed
-# Use text mode install
-text
-# Firewall configuration
-firewall --disabled
-firstboot --disable
-# Keyboard layouts
-# old format: keyboard us
-# new format:
-keyboard --vckeymap=us --xlayouts='us'
-network --onboot no --device eth0 --bootproto dhcp --noipv6
-network --onboot no --device eth1 --bootproto dhcp --noipv6
-network --onboot no --device eth2 --bootproto dhcp --noipv6
-# System language
-lang en_US.UTF-8
-# Installation logging level
-logging --level=info
-# Reboot after installation
-reboot
-# Root password
-rootpw root
-# SELinux configuration
-selinux --disabled
-# System services
-services --enabled="NetworkManager,sshd"
-# Do not configure the X Window System
-skipx
-# System timezone
-timezone America/Los_Angeles --isUtc
-
-# System bootloader configuration
-%include /tmp/bootloader.ks
-
-# Clear the Master Boot Record
-zerombr
-# Partition clearing information
-clearpart --all --initlabel
-
-# Disk partitioning information
-%include /tmp/partition.ks
-
-%pre
-#!/bin/sh
-
-set -x -v
-exec 1>/tmp/ks-pre.log 2>&1
-# Once root's homedir is there, copy over the log.
-while : ; do
- sleep 10
- if [ -d /mnt/sysimage/root ]; then
- cp /tmp/ks-pre.log /mnt/sysimage/root/
- logger "Copied %pre section log to system"
- break
- fi
-done &
-
-# hard drivedd
-drives=(`ls -1 /sys/block | grep "sd\|hd\|vd\|cciss"`)
-default_drive=${drives[0]}
-
-for I in `cat /proc/cmdline`; do case "$I" in *=*) eval $I;; esac ; done
-
-tgtdrive=$default_drive
-format_confirmed="no"
-
-if [ ${#drives[@]} -lt 1 ]; then
- exec < /dev/tty3 > /dev/tty3 2>&1
- chvt 3
- clear
- echo
- echo '********************************************************************'
- echo '* E R R O R *'
- echo '* *'
- echo '* There is no suitable media available for installation. *'
- echo '* Please attach a drive and try again. *'
- echo '* *'
- echo '********************************************************************'
- echo
- read -p "Press Enter to shut down the system: " _
- poweroff
-fi
-
-# verify tgtdrive is at least 30GB
-tgtdrivesize=$(( $(cat "/sys/class/block/${tgtdrive}/size") / 2 / 1024 ))
-if [ $tgtdrivesize -lt 30720 ]; then
- exec < /dev/tty3 > /dev/tty3 2>&1
- chvt 3
- clear
- echo
- echo '********************************************************************'
- echo '* E R R O R *'
- echo '* *'
- echo '* Your disk is under 30GB in size. Installation cannot continue. *'
- echo '* Restart installation with a larger disk. *'
- echo '* *'
- echo '********************************************************************'
- echo
- read -p "Press Enter to restart: " _
- reboot
-fi
-
-vgremove -ff os
-dd if=/dev/zero of=/dev/${tgtdrive} bs=10M count=10
-sleep 3
-
-hdparm -z /dev/${tgtdrive}
-parted -s /dev/${tgtdrive} mklabel gpt
-parted -a none -s /dev/${tgtdrive} unit MiB mkpart primary 0 24
-parted -s /dev/${tgtdrive} set 1 bios_grub on
-parted -a none -s /dev/${tgtdrive} unit MiB mkpart primary fat16 24 224
-parted -s /dev/${tgtdrive} set 2 boot on
-parted -a none -s /dev/${tgtdrive} unit MiB mkpart primary 224 424
-sleep 3
-hdparm -z /dev/${tgtdrive}
-
-# partition
-cat << EOF > /tmp/partition.ks
-part swap --asprimary --fstype="swap" --ondisk=sda --size=4096
-part /boot --asprimary --fstype="ext3" --ondisk=sda --size=500
-part pv.64 --fstype="lvmpv" --ondisk=sda --grow
-volgroup os --pesize=4096 pv.64
-logvol /var --fstype="ext3" --grow --percent=40 --name=varvol --vgname=os
-logvol /tmp --fstype="ext3" --grow --percent=5 --name=tmpvol --vgname=os
-logvol / --fstype="ext3" --grow --percent=50 --name=rootvol --vgname=os
-logvol /home --fstype="ext3" --grow --percent=5 --name=homevol --vgname=os
-EOF
-
-# bootloader setting
-echo "bootloader --location=mbr --driveorder=${tgtdrive} --append=' biosdevname=0 crashkernel=none'" > /tmp/bootloader.ks
-%end
-
-%post
-echo -e "modprobe nf_conntrack_ipv4\nmodprobe nf_conntrack_ipv6\nmodprobe nf_conntrack_tftp\nmodprobe nf_nat_tftp" >> /etc/rc.modules
-chmod +x /etc/rc.modules
-echo -e "net.nf_conntrack_max=1048576" >> /etc/sysctl.conf
-mkdir -p /var/log/coredump
-echo -e "kernel.core_pattern=/var/log/coredump/core.%e.%p.%h.%t" >> /etc/sysctl.conf
-
-chmod 777 /var/log/coredump
-echo -e "* soft core unlimited\n* hard core unlimited" >> /etc/security/limits.conf
-%end
-
-%post --nochroot --log=/root/anaconda-post-before-chroot.log
-#!/bin/sh
-set -x
-SOURCE="/mnt/sysimage/tmp/source"
-for I in `cat /proc/cmdline`; do case "$I" in *=*) eval $I;; esac ; done
-
-mkdir -p "${SOURCE}"
-mount -o bind "/mnt/install/source" "${SOURCE}"
-%end
-
-%post --logfile /var/log/post_install.log
-set -x -v
-exec 1>/root/ks-post.log 2>&1
-
-function save_nic_cfg() {
- scrFile="/etc/sysconfig/network-scripts/ifcfg-$1"
- sed -i -e 's#^\(HOSTNAME=\).*$#\1'"$hostname"'#' /etc/sysconfig/network
- grep -q "^\s*$2\s+$hostname" /etc/hosts || echo "$2 $hostname" >> /etc/hosts
-
- echo DEVICE=$1> $scrFile
- echo ONBOOT=yes >> $scrFile
- echo NM_CONTROLLED=no >> $scrFile
- echo HWADDR=$4 >> $scrFile
- echo USERCTL=no >> $scrFile
- echo PEERDNS=no >> $scrFile
- echo BOOTPROTO=static >> $scrFile
- echo IPADDR=$2 >> $scrFile
- echo NETMASK=$3 >> $scrFile
-}
-
-function save_gateway() {
- echo GATEWAY=$external_gw >> /etc/sysconfig/network
- search="domain $domain\nsearch $domain"
- echo -e "${search}\nnameserver 127.0.0.1" > /etc/resolv.conf
- [ $dns1 ] && echo -e "${search}\nnameserver $dns1" > /etc/resolv.conf
- [ $dns1 ] && echo -e "${search}\nnameserver $dns1" > /etc/dnsmasq.upstream
- [ $dns2 ] && echo "nameserver $dns2" >> /etc/resolv.conf
- [ $dns2 ] && echo "nameserver $dns2" >> /etc/dnsmasq.upstream
-
- if [[ -z "$dns1" && -z "$dns2" ]]; then
- if [[ -z $external_gw ]]; then
- echo "nameserver $gw" >> /etc/resolv.conf
- else
- echo "nameserver $external_gw" >> /etc/resolv.conf
- fi
- fi
-}
-# Default FQDN
-hostname="open-o"
-
-for I in `cat /proc/cmdline`; do case "$I" in *=*) eval $I;; esac ; done
-domain=$hostname
-
-external_ip=$external_ip
-external_netmask=$external_mask
-external_intf="eth0"
-#external_hwaddr=`ifconfig $external_intf | grep -i hwaddr | sed -e 's#^.*hwaddr[[:space:]]*##I'`
-
-save_nic_cfg $external_intf $external_ip $external_netmask $external_hwaddr
-
-save_gateway
-
-SOURCE=/tmp/source
-mkdir -p /root/.ssh
-chmod 700 /root/.ssh
-cat ${SOURCE}/bootstrap/boot.rsa.pub >> /root/.ssh/authorized_keys
-
-%end
-
-%packages --nobase
-@core
-%end
diff --git a/util/libvirt.xml b/util/libvirt.xml
deleted file mode 100644
index e208223..0000000
--- a/util/libvirt.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<domain type='kvm'>
- <name>open-o</name>
- <memory unit='MiB'>REPLACE_MEM</memory>
- <currentMemory unit='MiB'>REPLACE_MEM</currentMemory>
- <vcpu placement='static'>REPLACE_CPU</vcpu>
- <os>
- <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
- <boot dev='hd'/>
- <boot dev='cdrom'/>
- </os>
- <features>
- <acpi/>
- <apic/>
- <pae/>
- </features>
- <cpu mode='host-model'>
- <model fallback='allow'/>
- <feature policy='optional' name='vmx'/>
- <feature policy='optional' name='svm'/>
- </cpu>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
- <devices>
- <emulator>/usr/bin/kvm-spice</emulator>
- <disk type='file' device='disk'>
- <driver name='qemu' type='qcow2'/>
- <source file='REPLACE_IMAGE'/>
- <target dev='vda' bus='ide'/>
- </disk>
- <disk type='file' device='cdrom'>
- <driver name='qemu' type='raw'/>
- <source file='REPLACE_ISO'/>
- <target dev='hdc' bus='ide'/>
- <readonly/>
- </disk>
- <controller type='pci' index='0' model='pci-root'/>
- <interface type='network'>
- <source network='REPLACE_NET_EXTERNAL'/>
- <model type='virtio'/>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
- </interface>
- <interface type='network'>
- <source network='default'/>
- <model type='virtio'/>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
- </interface>
- <serial type='pty'>
- <target port='0'/>
- </serial>
- <console type='pty'>
- <target type='serial' port='0'/>
- </console>
- <input type='mouse' bus='ps2'/>
- <input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='en-us'>
- <listen type='address' address='0.0.0.0'/>
- </graphics>
- <video>
- <model type='cirrus' vram='9216' heads='1'/>
- </video>
- </devices>
-</domain>
diff --git a/util/modify_file.sh b/util/modify_file.sh
index 607c6cd..b03ae2a 100644
--- a/util/modify_file.sh
+++ b/util/modify_file.sh
@@ -10,7 +10,7 @@
file1=/home/etc/conf/juju_conf.json
sed -i 's/^\(.*"image-metadata-url":\).*/\1 "http:\/\/REPLACE_JUJU_METADATA_IP\/images"\,/g' $file1
sed -i 's/^\(.*"network":\).*/\1 "juju-net"\,/g' $file1
-sed -i 's/^\(.*"use-floating-ip":\).*/\1 "True"\,/g' $file
+sed -i 's/^\(.*"use-floating-ip":\).*/\1 "True"\,/g' $file1
file2=/home/etc/csarInfo/csarinfo.json
sed -i 's/^\(.*"csar_file_path":\).*/\1 "\/home\/ubuntu\/csar\/"\,/g' $file2
@@ -21,3 +21,9 @@ sed -i 's/^\(.*jdbc.url=\).*/\1jdbc:mysql:\/\/REPLACE_JUJU_DRIVER_IP:3306\/jujuv
file4=/home/ROOT/WEB-INF/classes/juju-config.properties
sed -i 's/^\(.*charmPath=\).*/\1\/home\/ubuntu\/csar\//g' $file4
sed -i 's/^\(.*grant_jujuvnfm_url=\).*/\1http:\/\/REPLACE_JUJU_DRIVER_IP:8483\//g' $file4
+
+#file5=/home/etc/conf/restclient.json
+#sed -i 's/^\(.*"host":\).*/\1"REPLACE_"\,/g' $file5
+#
+#file6=/home/etc/adapterInfo/jujuadapterinfo.json
+#sed -i 's/^\(.*"ip":\).*/\1 "192.168.136.2"\,/g' $file6