Merge branch 'master' of github.com:open-cloud/xos
diff --git a/xos/configurations/cord-pod/admin-openrc.sh b/xos/configurations/cord-pod/admin-openrc.sh
index f27fdac..bfc9eab 100644
--- a/xos/configurations/cord-pod/admin-openrc.sh
+++ b/xos/configurations/cord-pod/admin-openrc.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
# Replace with the OpenStack admin credentials for your cluster
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
diff --git a/xos/configurations/cord-pod/cdn/cmi-logicalinterfaces.yaml b/xos/configurations/cord-pod/cdn/cmi-logicalinterfaces.yaml
new file mode 100644
index 0000000..d45b63a
--- /dev/null
+++ b/xos/configurations/cord-pod/cdn/cmi-logicalinterfaces.yaml
@@ -0,0 +1,11 @@
+---
+- hosts: cmi
+ connection: ssh
+ user: root
+ tasks:
+ - name: copy over cmi logical interface template
+ template: src=templates/setup_cmi_logicalinterfaces.sh dest=/vservers/coplc/root/setup_cmi_logicalinterfaces.sh
+
+ - name: run logical interface script
+ command: vserver coplc exec onevsh /root/setup_cmi_logicalinterfaces.sh
+
diff --git a/xos/configurations/cord-pod/cdn/cmi-settings.sh b/xos/configurations/cord-pod/cdn/cmi-settings.sh
index 283d7e6..db6c5f3 100644
--- a/xos/configurations/cord-pod/cdn/cmi-settings.sh
+++ b/xos/configurations/cord-pod/cdn/cmi-settings.sh
@@ -1,7 +1,12 @@
# This holds the connection information necessary to talk to your CMI.
# It will be used by setup-cmi.sh and ssh-cmi.sh
-COMPUTE_NODE=cp-2.smbaker-xos-vtn.xos-pg0.clemson.cloudlab.us
-MGMT_IP=172.27.0.22
-NODE_KEY=/root/setup/id_rsa
+#COMPUTE_NODE=cp-2.smbaker-xos-vtn.xos-pg0.clemson.cloudlab.us
+#MGMT_IP=172.27.0.22
+#NODE_KEY=/root/setup/id_rsa
+#VM_KEY=cmi_id_rsa
+
+COMPUTE_NODE=10.90.0.65
+MGMT_IP=172.27.0.17
+NODE_KEY=cord_pod_node_key
VM_KEY=cmi_id_rsa
diff --git a/xos/configurations/cord-pod/cdn/cmi.yaml b/xos/configurations/cord-pod/cdn/cmi.yaml
index a2edd9e..62abe01 100644
--- a/xos/configurations/cord-pod/cdn/cmi.yaml
+++ b/xos/configurations/cord-pod/cdn/cmi.yaml
@@ -56,12 +56,6 @@
- name: retrieve node takeover script
fetch: src=/vservers/coplc/root/takeover-{{ node_hostname }} dest=takeovers/takeover-{{ node_hostname }}
- - name: copy over cmi logical interface template
- template: src=templates/setup_cmi_logicalinterfaces.sh dest=/vservers/coplc/root/setup_cmi_logicalinterfaces.sh
-
- - name: run logical interface script
- command: vserver coplc exec onevsh /root/setup_cmi_logicalinterfaces.sh
-
- name: update all keys script
copy: src=private/allkeys.template dest=/vservers/coplc/etc/onevantage/services/HPC/templates/usr/local/CoBlitz/var/allkeys.template
diff --git a/xos/configurations/cord-pod/cdn/setup-cmi-logicalinterfaces.sh b/xos/configurations/cord-pod/cdn/setup-cmi-logicalinterfaces.sh
new file mode 100644
index 0000000..b1acd65
--- /dev/null
+++ b/xos/configurations/cord-pod/cdn/setup-cmi-logicalinterfaces.sh
@@ -0,0 +1,18 @@
+#! /bin/bash
+
+source cmi-settings.sh
+
+echo "[ssh_connection]" > cmi.conf
+echo "ssh_args = -o \"ProxyCommand ssh -q -i $NODE_KEY -o StrictHostKeyChecking=no root@$COMPUTE_NODE nc $MGMT_IP 22\"" >> cmi.conf
+echo "scp_if_ssh = True" >> cmi.conf
+echo "pipelining = True" >> cmi.conf
+echo >> cmi.conf
+echo "[defaults]" >> cmi.conf
+echo "host_key_checking = False" >> cmi.conf
+
+echo "cmi ansible_ssh_private_key_file=$VM_KEY" > cmi.hosts
+
+export ANSIBLE_CONFIG=cmi.conf
+export ANSIBLE_HOSTS=cmi.hosts
+
+ansible-playbook -v --step cmi-logicalinterfaces.yaml
diff --git a/xos/configurations/cord-pod/cdn/templates/setup_cmi_onevsh.sh b/xos/configurations/cord-pod/cdn/templates/setup_cmi_onevsh.sh
index 996093d..c517780 100644
--- a/xos/configurations/cord-pod/cdn/templates/setup_cmi_onevsh.sh
+++ b/xos/configurations/cord-pod/cdn/templates/setup_cmi_onevsh.sh
@@ -14,3 +14,6 @@
cp=CreateOrFind("ContentProvider", {"account": "test", "name": "test", "enabled": True, "service_provider_id": sp})
ors=CreateOrFind("OriginServer", {"url": "http://www.cs.arizona.edu", "content_provider_id": cp, "service_type": "HyperCache"})
pre=CreateOrFind("CDNPrefix", {"service": "HyperCache", "enabled": True, "content_provider_id": cp, "cdn_prefix": "test.vicci.org", "default_origin_server": "http://www.cs.arizona.edu"})
+cp=CreateOrFind("ContentProvider", {"account": "onlab", "name": "onlab", "enabled": True, "service_provider_id": sp})
+ors=CreateOrFind("OriginServer", {"url": "http://onlab.vicci.org", "content_provider_id": cp, "service_type": "HyperCache"})
+pre=CreateOrFind("CDNPrefix", {"service": "HyperCache", "enabled": True, "content_provider_id": cp, "cdn_prefix": "onlab.vicci.org", "default_origin_server": "http://onlab.vicci.org"})
diff --git a/xos/core/xoslib/methods/ceilometerview.py b/xos/core/xoslib/methods/ceilometerview.py
index 0fb94c4..16b32d4 100644
--- a/xos/core/xoslib/methods/ceilometerview.py
+++ b/xos/core/xoslib/methods/ceilometerview.py
@@ -64,9 +64,10 @@
else:
logger.warn("SRIKANTH: Slice %(slice)s is not associated with any service" % {'slice':cs.slice.name})
tenantmap[cs.tenant_id]["service"] = "Other"
- #TEMPORARY WORK AROUND: There are some resource in network like whitebox switches does not belong to a specific tenant.
- #They are all associated with "default_admin_tenant" tenant
- tenantmap["default_admin_tenant"] = {"slice": "default_admin_tenant", "service": "Other"}
+ if not slice:
+ #TEMPORARY WORK AROUND: There are some resource in network like whitebox switches does not belong to a specific tenant.
+ #They are all associated with "default_admin_tenant" tenant
+ tenantmap["default_admin_tenant"] = {"slice": "default_admin_tenant", "service": "Other"}
return tenantmap
def build_url(path, q, params=None):