Add vcloud support for Stratos Installer
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/4873a43c Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/4873a43c Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/4873a43c Branch: refs/heads/master Commit: 4873a43c3c89579a3b39e87d294326471e994c0b Parents: b10c2be Author: M. Isuru Tharanga Chrishantha Perera <[email protected]> Authored: Wed Mar 19 12:17:21 2014 +0530 Committer: M. Isuru Tharanga Chrishantha Perera <[email protected]> Committed: Wed Mar 19 12:17:21 2014 +0530 ---------------------------------------------------------------------- tools/stratos-installer/clean.sh | 0 tools/stratos-installer/conf/setup.conf | 5 ++ .../cc/repository/conf/cloud-controller.xml | 12 ++++ tools/stratos-installer/ec2.sh | 6 ++ tools/stratos-installer/openstack.sh | 6 ++ tools/stratos-installer/setup.sh | 12 +++- tools/stratos-installer/vcloud.sh | 69 ++++++++++++++++++++ 7 files changed, 109 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4873a43c/tools/stratos-installer/clean.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/clean.sh b/tools/stratos-installer/clean.sh old mode 100644 new mode 100755 http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4873a43c/tools/stratos-installer/conf/setup.conf ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/conf/setup.conf b/tools/stratos-installer/conf/setup.conf index 5b5bb0a..c77c98b 100644 --- a/tools/stratos-installer/conf/setup.conf +++ b/tools/stratos-installer/conf/setup.conf @@ -123,6 +123,11 @@ export openstack_jclouds_endpoint="http://hostname:5000/v2.0" export openstack_keypair_name="" export openstack_security_groups="security-groups" +# vCloud +export vcloud_provider_enabled=false +export vcloud_identity="stratos" # vCloud login user +export vcloud_credential="password" # vCloud login password +export vcloud_jclouds_endpoint="https://vcloud/api" # ---------------------------------------------------------------------------- # Auto Scalar configuration http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4873a43c/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml b/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml index d41df59..19798a2 100644 --- a/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml +++ b/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml @@ -73,5 +73,17 @@ <property name="X" value="x" /> <property name="Y" value="y" /> </iaasProviderOPENSTACK_PROVIDER_END> + <VCLOUD_PROVIDER_STARTiaasProvider type="vcloud" name="VMware vCloud specific details"> + <className>org.apache.stratos.cloud.controller.iaases.VCloudIaas</className> + <provider>vcloud</provider> + <identity svns:secretAlias="cloud.controller.vcloud.identity">VCLOUD_IDENTITY</identity> + <credential svns:secretAlias="cloud.controller.vcloud.credential">VCLOUD_CREDENTIAL</credential> + <property name="jclouds.endpoint" value="VCLOUD_ENDPOINT" /> + <property name="jclouds.vcloud.version.schema" value="1.5" /> + <property name="jclouds.api-version" value="1.5" /> + <property name="autoAssignIp" value="true" /> + <property name="X" value="x" /> + <property name="Y" value="y" /> + </iaasProviderVCLOUD_PROVIDER_END> </iaasProviders> </cloudController> http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4873a43c/tools/stratos-installer/ec2.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/ec2.sh b/tools/stratos-installer/ec2.sh index cbb7db3..12aae8e 100755 --- a/tools/stratos-installer/ec2.sh +++ b/tools/stratos-installer/ec2.sh @@ -69,5 +69,11 @@ cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_STA cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml +cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig +cat repository/conf/cloud-controller.xml.orig | sed -e "s@VCLOUD_PROVIDER_START@!--@g" > repository/conf/cloud-controller.xml + +cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig +cat repository/conf/cloud-controller.xml.orig | sed -e "s@VCLOUD_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml + popd http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4873a43c/tools/stratos-installer/openstack.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/openstack.sh b/tools/stratos-installer/openstack.sh index 1228b88..dd893da 100755 --- a/tools/stratos-installer/openstack.sh +++ b/tools/stratos-installer/openstack.sh @@ -60,4 +60,10 @@ cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_START@!-- cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml +cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig +cat repository/conf/cloud-controller.xml.orig | sed -e "s@VCLOUD_PROVIDER_START@!--@g" > repository/conf/cloud-controller.xml + +cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig +cat repository/conf/cloud-controller.xml.orig | sed -e "s@VCLOUD_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml + popd http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4873a43c/tools/stratos-installer/setup.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/setup.sh b/tools/stratos-installer/setup.sh index 6810df9..c6c8fcc 100755 --- a/tools/stratos-installer/setup.sh +++ b/tools/stratos-installer/setup.sh @@ -214,7 +214,7 @@ function cc_conf_validate { exit 1 fi - if [[ $ec2_provider_enabled = "false" && $openstack_provider_enabled = "false" ]]; then + if [[ $ec2_provider_enabled = "false" && $openstack_provider_enabled = "false" && $vcloud_provider_enabled = "false" ]]; then echo "Please enable at least one of the IaaS providers in conf/setup.conf file" exit 1 fi @@ -232,6 +232,13 @@ function cc_conf_validate { exit 1 fi fi + + if [[ $vcloud_provider_enabled = "true" ]]; then + if [[ ( -z $vcloud_identity || -z $vcloud_credential || -z $vcloud_jclouds_endpoint ) ]]; then + echo "Please set vcloud configuration information in conf/setup.conf file" + exit 1 + fi + fi } function as_conf_validate { @@ -452,6 +459,9 @@ function cc_setup { if [[ $openstack_provider_enabled = true ]]; then ./openstack.sh fi + if [[ $vcloud_provider_enabled = true ]]; then + ./vcloud.sh + fi pushd $cc_path http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4873a43c/tools/stratos-installer/vcloud.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/vcloud.sh b/tools/stratos-installer/vcloud.sh new file mode 100755 index 0000000..2fbf22a --- /dev/null +++ b/tools/stratos-installer/vcloud.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# ---------------------------------------------------------------------------- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# ---------------------------------------------------------------------------- +# +# This script is invoked by setup.sh for configuring OpenStack IaaS information. +# ---------------------------------------------------------------------------- + +# Die on any error: +set -e + +SLEEP=60 +export LOG=$log_path/stratos-vcloud.log + +source "./conf/setup.conf" + +if [[ ! -d $log_path ]]; then + mkdir -p $log_path +fi + +pushd $cc_path + +echo "Set vCloud provider specific info in repository/conf/cloud-controller.xml" >> $LOG + +cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig +cat repository/conf/cloud-controller.xml.orig | sed -e "s@VCLOUD_PROVIDER_START@@g" > repository/conf/cloud-controller.xml + +cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig +cat repository/conf/cloud-controller.xml.orig | sed -e "s@VCLOUD_IDENTITY@$vcloud_identity@g" > repository/conf/cloud-controller.xml + +cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig +cat repository/conf/cloud-controller.xml.orig | sed -e "s@VCLOUD_CREDENTIAL@$vcloud_credential@g" > repository/conf/cloud-controller.xml + +cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig +cat repository/conf/cloud-controller.xml.orig | sed -e "s@VCLOUD_ENDPOINT@$vcloud_jclouds_endpoint@g" > repository/conf/cloud-controller.xml + +cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig +cat repository/conf/cloud-controller.xml.orig | sed -e "s@VCLOUD_PROVIDER_END@@g" > repository/conf/cloud-controller.xml + +cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig +cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_START@!--@g" > repository/conf/cloud-controller.xml + +cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig +cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml + +cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig +cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_START@!--@g" > repository/conf/cloud-controller.xml + +cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig +cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml + +popd
