diff options
author | Lusheng Ji <lji@research.att.com> | 2017-10-15 20:16:44 -0400 |
---|---|---|
committer | Lusheng Ji <lji@research.att.com> | 2017-10-16 02:41:49 +0000 |
commit | f79590758d6cce11b10d9257af798c8f8bc10f1e (patch) | |
tree | 708127efce9e1da738d8d3d0d867be85bedcabb9 /boot | |
parent | 2c932329f5477040bc2c37b83d4e7d9f7e080137 (diff) |
Update dcae2 vm_init and intsall scripts
Issue-Id: DCAEGEN2-127
Change-Id: I4e8221972144495d9f121e4f5cfc775d141b15cb
Signed-off-by: Lusheng Ji <lji@research.att.com>
Diffstat (limited to 'boot')
-rw-r--r-- | boot/dcae2_install.sh | 61 | ||||
-rw-r--r-- | boot/dcae2_serv.sh | 5 | ||||
-rw-r--r-- | boot/dcae2_vm_init.sh | 3 |
3 files changed, 29 insertions, 40 deletions
diff --git a/boot/dcae2_install.sh b/boot/dcae2_install.sh index f6041728..5868607b 100644 --- a/boot/dcae2_install.sh +++ b/boot/dcae2_install.sh @@ -92,44 +92,29 @@ service docker restart echo "nameserver "$DNS_IP_ADDR >> /etc/resolvconf/resolv.conf.d/head resolvconf -u -# Build a configuration file for the DCAE Controller. -chmod 777 /opt/config/priv_key -mkdir /opt/app - -UBUNTU_1604_IMAGE=$(cat /opt/config/ubuntu_1604_image.txt) -CENTOS_7_IMAGE=$(cat /opt/config/centos_7_image.txt) -FLAVOR_MEDIUM=$(cat /opt/config/flavor_medium.txt) -SECURITY_GROUP=$(cat /opt/config/security_group.txt) -PUBLIC_NET_ID=$(cat /opt/config/public_net_id.txt) -OPENSTACK_PRIVATE_NETWORK=$(cat /opt/config/openstack_private_network_name.txt) -OPENSTACK_USER=$(cat /opt/config/openstack_user.txt) -OPENSTACK_PASSWORD=$(cat /opt/config/openstack_password.txt) -OPENSTACK_TENANT_ID=$(cat /opt/config/tenant_id.txt) -KEYSTONE_URL=$(cat /opt/config/keystone_url.txt)"/v2.0" -OPENSTACK_REGION=$(cat /opt/config/openstack_region.txt) -OPENSTACK_KEYNAME=$(cat /opt/config/key_name.txt)"_"$(cat /opt/config/rand_str.txt) -ZONE=$(cat /opt/config/dcae_zone.txt) - -cat > /opt/app/inputs.yaml << EOF_CONFIG -centos7image_id: '$CENTOS_7_IMAGE' -ubuntu1604image_id: '$UBUNTU_1604_IMAGE' -flavor_id: '$FLAVOR_MEDIUM' -security_group: '$SECURITY_GROUP' -public_net: '$PUBLIC_NET_ID' -private_net: '$OPENSTACK_PRIVATE_NETWORK' -openstack: - username: '$OPENSTACK_USER' - password: '$OPENSTACK_PASSWORD' - tenant_name: '$OPENSTACK_TENANT_ID' - auth_url: '$KEYSTONE_URL' - region: '$OPENSTACK_REGION' -keypair: '$OPENSTACK_KEYNAME' -key_filename: '/opt/dcae/key' -location_prefix: '$ZONE' -location_domain: 'dcae.onapdevlab.onap.org' -codesource_url: 'https://nexus.onap.org/service/local/repositories/raw/content' -codesource_version: 'org.onap.dcaegen2.deployments/releases/scripts' -EOF_CONFIG +# prepare the configurations needed by DCAEGEN2 installer +rm -rf /opt/app/config +mkdir -p /opt/app/config + +# private key +cp /opt/config/priv_key /opt/app/config/key +chmod 777 /opt/app/config/key + + +# download blueprint input template files +rm -rf /opt/app/inputs-templates +mkdir -p /opt/app/inputs-templates +#wget --no-parent -nH -r -l2 -P /opt/app/inputs-templates https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/releases/input-templates/ +wget -P /opt/app/inputs-templates https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/releases/input-templates/inputs.yaml +wget -P /opt/app/inputs-templates https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/releases/input-templates/phinputs.yaml +wget -P /opt/app/inputs-templates https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/releases/input-templates/dhinputs.yaml +wget -P /opt/app/inputs-templates https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/releases/input-templates/invinputs.yaml + + +# generate blueprint input files +pip install jinja2 +wget https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.deployments/releases/scripts/detemplate-bpinputs.py && (python detemplate-bpinputs.py /opt/config /opt/app/inputs-templates /opt/app/config; rm detemplate-bpinputs.py) + # Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes if [[ $CLOUD_ENV != "rackspace" ]] diff --git a/boot/dcae2_serv.sh b/boot/dcae2_serv.sh index bfd2ad18..b81c57a4 100644 --- a/boot/dcae2_serv.sh +++ b/boot/dcae2_serv.sh @@ -41,7 +41,8 @@ get_pid() { } is_running() { - [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1 + #[ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1 + [ ! -z $(docker ps | grep 'org.onap.dcaegen2.deployments.bootstrap') ] } case "$1" in @@ -67,6 +68,8 @@ case "$1" in if is_running; then echo -n "Stopping $name.." kill `get_pid` + CID=$(docker ps | grep 'org.onap.dcaegen2.deployments.bootstrap' | awk '{ print $1 }') + docker exec -it $CID ./teardown.sh for i in {1..10} do if ! is_running; then diff --git a/boot/dcae2_vm_init.sh b/boot/dcae2_vm_init.sh index b9da6844..e27ba589 100644 --- a/boot/dcae2_vm_init.sh +++ b/boot/dcae2_vm_init.sh @@ -8,4 +8,5 @@ ZONE=$(cat /opt/config/dcae_zone.txt) docker login -u $NEXUS_USER -p $NEXUS_PASSWORD $NEXUS_DOCKER_REPO docker pull $NEXUS_DOCKER_REPO/onap/org.onap.dcaegen2.deployments.bootstrap:$DOCKER_VERSION -docker run -v /opt/config/priv_key:/opt/app/installer/config/key -v /opt/app/inputs.yaml:/opt/app/installer/config/inputs.yaml -e "LOCATION=$ZONE" $NEXUS_DOCKER_REPO/onap/org.onap.dcaegen2.deployments.bootstrap:$DOCKER_VERSION
\ No newline at end of file +#docker run -v /opt/config/priv_key:/opt/app/installer/config/key -v /opt/app/inputs.yaml:/opt/app/installer/config/inputs.yaml -e "LOCATION=$ZONE" $NEXUS_DOCKER_REPO/onap/org.onap.dcaegen2.deployments.bootstrap:$DOCKER_VERSION +docker run -d --name boot -v /opt/app/config:/opt/app/installer/config -e "LOCATION=$ZONE" $NEXUS_DOCKER_REPO/onap/org.onap.dcaegen2.deployments.bootstrap:$DOCKER_VERSION |