Initial support for devstack backend
diff --git a/xos/configurations/common/Makefile.devstack b/xos/configurations/common/Makefile.devstack
new file mode 100644
index 0000000..9d745a0
--- /dev/null
+++ b/xos/configurations/common/Makefile.devstack
@@ -0,0 +1,30 @@
+# This shouldn't be hardcoded
+DEVSTACK_ROOT:=~/devstack
+
+all: prereqs admin-openrc nodes_yaml public_key private_key ceilometer_url node_key
+
+prereqs:
+ make -f Makefile.prereqs
+
+admin-openrc:
+ bash ./devstack-creds.sh $(DEVSTACK_ROOT) > admin-openrc.sh
+ touch controller_settings
+
+nodes_yaml:
+ bash ./make-cloudlab-nodes-yaml.sh
+
+ceilometer_url:
+ echo http://`hostname -i`/xosmetering/ > ceilometer_url
+
+public_key: ~/.ssh/id_rsa.pub
+ cp ~/.ssh/id_rsa.pub .
+
+private_key: ~/.ssh/id_rsa
+ cp ~/.ssh/id_rsa .
+
+~/.ssh/id_rsa.pub:
+ cat /dev/zero | ssh-keygen -q -N ""
+
+node_key:
+ sudo cat ~/.ssh/id_rsa > node_key
+ sudo cat ~/.ssh/id_rsa.pub > node_key.pub
diff --git a/xos/configurations/common/devstack-creds.sh b/xos/configurations/common/devstack-creds.sh
new file mode 100644
index 0000000..b90e6ec
--- /dev/null
+++ b/xos/configurations/common/devstack-creds.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+DEVSTACK_ROOT=$1
+
+source $DEVSTACK_ROOT/openrc admin admin
+echo export OS_TENANT_NAME=$OS_TENANT_NAME
+echo export OS_USERNAME=$OS_USERNAME
+echo export OS_PASSWORD=$OS_PASSWORD
+echo export OS_AUTH_URL=$OS_AUTH_URL
diff --git a/xos/configurations/common/devstack.yaml b/xos/configurations/common/devstack.yaml
new file mode 100644
index 0000000..cd17b1c
--- /dev/null
+++ b/xos/configurations/common/devstack.yaml
@@ -0,0 +1,87 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+# Note:
+# assumes the following have been created and filled with appropriate data:
+# /root/setup/admin_openrc
+# /root/setup/flat_net_name
+# /root/setup/padmin_public_key
+
+description: >
+ * Adds OpenCloud Sites, Deployments, and Controllers.
+
+imports:
+ - custom_types/xos.yaml
+
+topology_template:
+ node_templates:
+ cirros-0.3.4-x86_64-uec:
+ type: tosca.nodes.Image
+ properties:
+ disk_format: RAW
+ container_format: BARE
+
+ MyDeployment:
+ type: tosca.nodes.Deployment
+ properties:
+ flavors: m1.large, m1.medium, m1.small
+ requirements:
+ - image:
+ node: cirros-0.3.4-x86_64-uec
+ relationship: tosca.relationships.SupportsImage
+
+ CloudLab:
+ type: tosca.nodes.Controller
+ requirements:
+ - deployment:
+ node: MyDeployment
+ relationship: tosca.relationships.ControllerDeployment
+ properties:
+ backend_type: OpenStack
+ version: Kilo
+ auth_url: { get_script_env: [ SELF, adminrc, OS_AUTH_URL, LOCAL_FILE] }
+ admin_user: { get_script_env: [ SELF, adminrc, OS_USERNAME, LOCAL_FILE] }
+ admin_password: { get_script_env: [ SELF, adminrc, OS_PASSWORD, LOCAL_FILE] }
+ admin_tenant: { get_script_env: [ SELF, adminrc, OS_TENANT_NAME, LOCAL_FILE] }
+ rabbit_user: { get_script_env: [ SELF, controller_settings, RABBIT_USER, LOCAL_FILE] }
+ rabbit_password: { get_script_env: [ SELF, controller_settings, RABBIT_PASS, LOCAL_FILE] }
+ rabbit_host: { get_script_env: [ SELF, controller_settings, CONTROLLER_IP, LOCAL_FILE] }
+ domain: Default
+ artifacts:
+ adminrc: /root/setup/admin-openrc.sh
+ controller_settings: /root/setup/controller_settings
+
+ mysite:
+ type: tosca.nodes.Site
+ properties:
+ display_name: MySite
+ site_url: http://opencloud.us/
+ requirements:
+ - deployment:
+ node: MyDeployment
+ relationship: tosca.relationships.SiteDeployment
+ requirements:
+ - controller:
+ node: CloudLab
+ relationship: tosca.relationships.UsesController
+
+ Public shared IPv4:
+ type: tosca.nodes.NetworkTemplate
+ properties:
+ visibility: private
+ translation: NAT
+ shared_network_name: private
+
+ padmin@vicci.org:
+ type: tosca.nodes.User
+ requirements:
+ - site:
+ node: mysite
+ relationship: tosca.relationships.MemberOfSite
+ properties:
+ public_key: { get_artifact: [ SELF, pubkey, LOCAL_FILE ] }
+ is_admin: true
+ is_active: true
+ firstname: XOS
+ lastname: admin
+ artifacts:
+ pubkey: /root/setup/padmin_public_key
diff --git a/xos/configurations/common/make-cloudlab-nodes-yaml.sh b/xos/configurations/common/make-cloudlab-nodes-yaml.sh
index e68adf1..f2555a4 100644
--- a/xos/configurations/common/make-cloudlab-nodes-yaml.sh
+++ b/xos/configurations/common/make-cloudlab-nodes-yaml.sh
@@ -19,7 +19,7 @@
type: tosca.nodes.Site
EOF
-NODES=$( sudo bash -c "source /root/setup/admin-openrc.sh ; nova hypervisor-list" |grep cloudlab|awk '{print $4}' )
+NODES=$( bash -c "source ./admin-openrc.sh ; nova hypervisor-list" |grep enabled|awk '{print $4}' )
I=0
for NODE in $NODES; do
echo $NODE
diff --git a/xos/configurations/devel/Makefile b/xos/configurations/devel/Makefile
index 3ce188b..24b7be7 100644
--- a/xos/configurations/devel/Makefile
+++ b/xos/configurations/devel/Makefile
@@ -2,16 +2,23 @@
RUNNING_CONTAINER:=$(shell sudo docker ps|grep "xos"|awk '{print $$NF}')
LAST_CONTAINER=$(shell sudo docker ps -l -q)
-test: common_cloudlab
+cloudlab: common_cloudlab xos
+
+devstack: common_devstack xos
+
+xos:
echo "# Autogenerated -- do not edit" > Dockerfile
cat ../common/Dockerfile.common Dockerfile.devel >> Dockerfile
- cd ../../..; sudo docker build -t xos -f xos/configurations/devel/Dockerfile .
- sudo docker run -d --add-host="ctl:$(MYIP)" -p 9999:8000 xos
+ cd ../../..; sudo docker build -t xosproject/xos-devel -f xos/configurations/devel/Dockerfile .
+ sudo docker run -d --add-host="ctl:$(MYIP)" -p 9999:8000 xosproject/xos-devel
bash ../common/wait_for_xos.sh
common_cloudlab:
make -C ../common -f Makefile.cloudlab
+common_devstack:
+ make -C ../common -f Makefile.devstack
+
stop:
sudo docker stop $(RUNNING_CONTAINER)
diff --git a/xos/configurations/devstack/local.conf b/xos/configurations/devstack/local.conf
new file mode 100644
index 0000000..946d16e
--- /dev/null
+++ b/xos/configurations/devstack/local.conf
@@ -0,0 +1,17 @@
+# A single node devstack configuration for use with XOS
+[[local|localrc]]
+
+DOWNLOAD_DEFAULT_IMAGES=false
+IMAGE_URLS="http://www.planet-lab.org/cord/trusty-server-multi-nic.img"
+
+disable_service n-net
+enable_service q-svc
+enable_service q-agt
+enable_service q-dhcp
+enable_service q-l3
+enable_service q-meta
+# Optional, to enable tempest configuration as part of devstack
+enable_service tempest
+
+## Neutron options
+Q_USE_SECGROUP=False