diff --git a/.gitignore b/.gitignore
index a0d550c..3c86d00 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,9 @@
 setup/*
 setup/id_rsa/*
 xos/configurations/frontend/Dockerfile
+xos/configurations/mcord/admin-openrc.sh
+xos/configurations/setup/*
+xos/configurations/common/*
 xos/core/xoslib/karma-*
 xos/core/xoslib/docs
 xos/core/xoslib/coverage
diff --git a/containers/Makefile b/containers/Makefile
index a6aa744..92685e7 100644
--- a/containers/Makefile
+++ b/containers/Makefile
@@ -5,7 +5,6 @@
 	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/setup.yaml
 	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/nodes.yaml
 	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/images.yaml
-	sudo docker exec containers_xos_1 cp /opt/xos/configurations/frontend/mocks/xos_mcord_config /opt/xos/xos_configuration/
 
 nodes.yaml:
 	export SETUPDIR=.; bash ../xos/configurations/common/make-nodes-yaml.sh
@@ -15,29 +14,5 @@
 
 .PHONY: local_containers
 local_containers:
-	cd xos; make devel
-	cd synchronizer; make
-enter-xos:
-	sudo docker exec -it containers_xos_1 bash
-
-enter-os:
-	sudo docker exec -it containers_xos_synchronizer_openstack_1 bash
-
-enter-mc:
-	sudo docker exec -it containers_xos_synchronizer_mcordservice1 bash
-
-upgrade_pkgs:
-	sudo pip install httpie --upgrade
-
-rebuild_xos:
-	make -C xos devel
-
-rebuild_synchronizer:
-	make -C synchronizer
-
-stop:
-	docker-compose stop
-
-rm:
-	docker-compose stop; docker-compose rm
-
+	cd containers/xos; make devel
+	cd containers/synchronizer; make
diff --git a/containers/admin-openrc.sh b/containers/admin-openrc.sh
index 24cd509..f27fdac 100644
--- a/containers/admin-openrc.sh
+++ b/containers/admin-openrc.sh
@@ -1,8 +1,6 @@
 # Replace with the OpenStack admin credentials for your cluster
-export OS_PROJECT_DOMAIN_ID=default
-export OS_USER_DOMAIN_ID=default
 export OS_TENANT_NAME=admin
 export OS_USERNAME=admin
-export OS_PASSWORD=mcord
-export OS_AUTH_URL=http://10.102.81.3:35357/v2.0
+export OS_PASSWORD=admin
+export OS_AUTH_URL=http://localhost:35357/v2.0
 
diff --git a/containers/docker-compose.yml b/containers/docker-compose.yml
index 15d28a6..24596a3 100644
--- a/containers/docker-compose.yml
+++ b/containers/docker-compose.yml
@@ -14,18 +14,6 @@
     volumes:
         - .:/root/setup:ro
 
-xos_synchronizer_mcordservice:
-    image: xosproject/xos-synchronizer-openstack
-    command: bash -c "sleep 120; python /opt/xos/synchronizers/mcordservice/mcordservice-synchronizer.py -C /opt/xos/synchronizers/mcordservice/mcordservice_vtnconfig"
-    labels:
-        org.xosproject.kind: synchronizer
-        org.xosproject.target: mcordservice
-    links:
-        - xos_db
-    volumes:
-        - ../setup/id_rsa/id_rsa:/opt/xos/synchronizers/mcordservice/mcordservice_private_key:ro  # private key
-        - ../setup:/root/setup:ro
-
 # FUTURE
 #xos_swarm_synchronizer:
 #    image: xosproject/xos-swarm-synchronizer
@@ -42,4 +30,3 @@
         - "8000:8000"
     volumes:
         - .:/root/setup:ro
-        - ../setup/id_rsa/id_rsa:/opt/xos/synchronizers/mcordservice/mcordservice_private_key:ro  # private key
diff --git a/containers/images.yaml b/containers/images.yaml
deleted file mode 100644
index 90cbbb6..0000000
--- a/containers/images.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-imports:
-   - custom_types/xos.yaml
-
-description: autogenerated nodes file
-
-topology_template:
-  node_templates:
-    mysite:
-        type: tosca.nodes.Site
-
-    MyDeployment:
-      type: tosca.nodes.Deployment
-      properties:
-          flavors: m1.large, m1.medium, m1.small
-      requirements:
diff --git a/containers/nodes.yaml b/containers/nodes.yaml
deleted file mode 100644
index 1f6ff45..0000000
--- a/containers/nodes.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-imports:
-   - custom_types/xos.yaml
-
-description: autogenerated nodes file
-
-topology_template:
-  node_templates:
-    MyDeployment:
-        type: tosca.nodes.Deployment
-    mysite:
-        type: tosca.nodes.Site
diff --git a/containers/xos/Dockerfile.devel b/containers/xos/Dockerfile.devel
index 1e2532f..5dc62a6 100644
--- a/containers/xos/Dockerfile.devel
+++ b/containers/xos/Dockerfile.devel
@@ -91,6 +91,5 @@
 # Define working directory.
 WORKDIR /opt/xos
 
-# RUN python /opt/xos/manage.py makemigrations mcordservice 
 # Define default command.
 CMD update-ca-certificates && python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure --makemigrations
diff --git a/xos/configurations/common/mydeployment.yaml b/xos/configurations/common/mydeployment.yaml
index 6d64da6..66bb75d 100644
--- a/xos/configurations/common/mydeployment.yaml
+++ b/xos/configurations/common/mydeployment.yaml
@@ -16,15 +16,9 @@
     m1.small:
       type: tosca.nodes.Flavor
 
-    m1.xlarge:
-      type: tosca.nodes.Flavor
-
     MyDeployment:
       type: tosca.nodes.Deployment
       requirements:
-          - m1.xlarge:
-             node: m1.xlarge
-             relationship: tosca.relationships.SupportsFlavor
           - m1.large:
              node: m1.large
              relationship: tosca.relationships.SupportsFlavor
diff --git a/xos/configurations/common/xos_common_config b/xos/configurations/common/xos_common_config
old mode 100755
new mode 100644
index f7f5784..76ba747
--- a/xos/configurations/common/xos_common_config
+++ b/xos/configurations/common/xos_common_config
@@ -6,7 +6,7 @@
 name=xos
 user=postgres
 password=password
-host=66.201.46.26
+host=localhost
 port=5432
 
 [api]
@@ -37,9 +37,7 @@
 images_directory=/opt/xos/images
 dependency_graph=/opt/xos/model-deps
 logfile=/var/log/xos_backend.log
-proxy_ssh=True
-proxy_ssh_key=/root/setup/node_key
-proxy_ssh_user=root
+save_ansible_output=True
 
 [gui]
 disable_minidashboard=True
@@ -47,7 +45,3 @@
 branding_icon=/static/logo.png
 branding_favicon=/static/favicon.png
 branding_bg=/static/bg.jpg
-
-[networking]
-use_vtn=True
-
diff --git a/xos/configurations/devel/docker-compose.yml b/xos/configurations/devel/docker-compose.yml
index ce4dc19..9ef6fc7 100644
--- a/xos/configurations/devel/docker-compose.yml
+++ b/xos/configurations/devel/docker-compose.yml
@@ -17,33 +17,6 @@
         - ../common/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro
         - ./images:/opt/xos/images:ro
 
-xos_synchronizer_helloworldservice_complete:
-    image: xosproject/xos-synchronizer-openstack
-    command: bash -c "sleep 120; python /opt/xos/synchronizers/helloworldservice_complete/helloworldservice-synchronizer.py -C /opt/xos/synchronizers/helloworldservice_complete/helloworldservice_config"
-    labels:
-        org.xosproject.kind: synchronizer
-        org.xosproject.target: helloworldservice_complete
-    links:
-        - xos_db
-    extra_hosts:
-        - ctl:${MYIP}
-    volumes:
-        - ../setup/id_rsa:/opt/xos/synchronizers/helloworldservice_complete/helloworldservice_complete_private_key:ro  # private key
-        - ../setup:/root/setup:ro
-
-xos_synchronizer_mcordservice:
-    image: xosproject/xos-synchronizer-openstack
-    command: bash -c "sleep 120; python /opt/xos/synchronizers/mcordservice/mcordservice-synchronizer.py -C /opt/xos/synchronizers/mcordservice/mcordservice_config"
-    labels:
-        org.xosproject.kind: synchronizer
-        org.xosproject.target: mcordservice
-    links:
-        - xos_db
-    extra_hosts:
-        - ctl:${MYIP}
-    volumes:
-        - ../setup/id_rsa:/opt/xos/synchronizers/mcordservice/mcordservice_private_key:ro  # private key
-        - ../setup:/root/setup:ro
 # FUTURE
 #xos_swarm_synchronizer:
 #    image: xosproject/xos-swarm-synchronizer
diff --git a/xos/configurations/frontend/Makefile b/xos/configurations/frontend/Makefile
index 8a28faf..ede7608 100644
--- a/xos/configurations/frontend/Makefile
+++ b/xos/configurations/frontend/Makefile
@@ -4,13 +4,9 @@
 	sudo make -f ../common/Makefile.prereqs
 	sudo docker-compose up -d
 	bash ../common/wait_for_xos.sh
-	# bash ../mcord/xos/initdb
 	sudo docker-compose run xos python /opt/xos/tosca/run.py none /opt/xos/configurations/common/fixtures.yaml
 	sudo docker-compose run xos python /opt/xos/tosca/run.py none /opt/xos/configurations/common/mydeployment.yaml
 	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/frontend/sample.yaml
-	# sudo docker-compose run xos python manage.py makemigrations mcordservice
-	# sudo docker-compose run xos python manage.py syncdb
-	# sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/tosca/MCORDServiceN.yaml
 
 containers:
 	cd ../../../containers/xos; make devel
diff --git a/xos/configurations/mcord/admin-openrc.sh b/xos/configurations/mcord/admin-openrc.sh
deleted file mode 100644
index 24cd509..0000000
--- a/xos/configurations/mcord/admin-openrc.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Replace with the OpenStack admin credentials for your cluster
-export OS_PROJECT_DOMAIN_ID=default
-export OS_USER_DOMAIN_ID=default
-export OS_TENANT_NAME=admin
-export OS_USERNAME=admin
-export OS_PASSWORD=mcord
-export OS_AUTH_URL=http://10.102.81.3:35357/v2.0
-
diff --git a/xos/configurations/setup/admin-openrc.sh b/xos/configurations/setup/admin-openrc.sh
deleted file mode 100644
index 24cd509..0000000
--- a/xos/configurations/setup/admin-openrc.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Replace with the OpenStack admin credentials for your cluster
-export OS_PROJECT_DOMAIN_ID=default
-export OS_USER_DOMAIN_ID=default
-export OS_TENANT_NAME=admin
-export OS_USERNAME=admin
-export OS_PASSWORD=mcord
-export OS_AUTH_URL=http://10.102.81.3:35357/v2.0
-
diff --git a/xos/configurations/setup/ceilometer_url b/xos/configurations/setup/ceilometer_url
deleted file mode 100644
index 9b52a64..0000000
--- a/xos/configurations/setup/ceilometer_url
+++ /dev/null
@@ -1 +0,0 @@
-http://127.0.0.1/xosmetering/
diff --git a/xos/configurations/setup/controller_settings b/xos/configurations/setup/controller_settings
deleted file mode 100644
index e69de29..0000000
--- a/xos/configurations/setup/controller_settings
+++ /dev/null
diff --git a/xos/configurations/setup/flat_net_name b/xos/configurations/setup/flat_net_name
deleted file mode 100644
index c8c6761..0000000
--- a/xos/configurations/setup/flat_net_name
+++ /dev/null
@@ -1 +0,0 @@
-private
\ No newline at end of file
diff --git a/xos/configurations/setup/id_rsa b/xos/configurations/setup/id_rsa
deleted file mode 100644
index c688622..0000000
--- a/xos/configurations/setup/id_rsa
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEpQIBAAKCAQEAwiKN1fSQ8DiFJmTWAWq1FhFfgOv05VGkkBUqnFYG2MUP3FEs
-ByAcByhY+NM2a/x0bfZy0vfvf+YC5hz4/kXkpOX8q8MQPJsa2ADnUYqNI6cNuCzD
-I0XSJbRdA1QubGBuVe0p/iZ4MnCEGQMJ+2VWhNBD+f2ndQWuDM1JDYoiz3cO61E9
-iVqlpjeMEPE3Vgz+nXtq/13h+v/j8HUtYQzO5YWg2kgh47GK8zA/F910izkFldff
-W92uBNQIgIKc3q8AqY7KMVaT3kP+CtFgbb7CNmRdNvLzkC2j6yx+KOZS20nM4A3W
-6mNm2OFgrRgXX1lFz84SiVyyP4N1aTo1+6X6BwIDAQABAoIBAQCg4lH5Bf03lx+B
-ef+AnRYFe9BR3znM8aQXY/M0LHbwHh/OzdZW8V1I8T8Ktr9bLpSurJbsD10D+XJd
-kZUn5HRf09lZ3wYNs9zDNbx97vyYl1DfWPk+uhY1+Qs8Pv9aAXBu9WTforHp2yUe
-NU6IcKsK1i3/dx7X9CURpu7rsZa3ptlLt+PlQe/XG8xmtgZ5D25wWy9iJqTEe7QP
-iWYI6+14Jsz7QIvVNn77fJAjBobNzmFVuquJzvMBAXqAPdMVSqkPwAU8HmPpCE7P
-AqaFxv2gMY0iJqa9VVB3Y0MUDJQ+XngcejLJl1tDDRAT66/O3rBReXL6NqOsE8dG
-QSv6mDxBAoGBAOrtDPDhkO/TYmhWEeOpbDh2C7/d2P2GHZ6IMqn80bIc+iLqqFxq
-9Nk0tFjJUfvZGzq5PKB+9Y3IQUwfsHb0Jn+4140iNcFdN/2J231Ggh0GapLbf7F0
-Eg/LOl56qlM+Eq8GnTdXe3Kifd0fXPVRsrQEeFElG6CZqbpZN8MFLYlFAoGBANOM
-wow+oWBVn+q9w7M7GVQ9L6Q0iIR5jrUe96LxNksbe4Rpghl1Qciy7bkibsRa/IAR
-Ol4aDrde53MHJkv8kXxnamdZGCY3/IrbmpHtl86rjIZtdPNumAaL7JGs4OT6dFyU
-6duzSYUAAx4J9hdBu4n86anE5G4iBpZmlc031hzbAoGAOfL7bDfX7rCv55jDlOrn
-3Q2RXGS27+KzT7W8+Z15hHwNX6uOmC1x9FpB2lzeskcdpmCnCdgHbk/le4edmdoj
-3QGVeiTkKax68TmeQMqxscMxasRmPTmqcubooQGVHi+DoFT7VvlnZCGc9nyUC5d5
-g1pO64VByV3eNi9nx91xHBkCgYEA0XH6J4nWkh8UDf/FIs0vPaS6Z1OPmcET1iSL
-vqocO+5Asw8WvIfIEqF8FSCPFB6VAWKNLB+WVFxEwDDi7LZpgAaPZTTjYOtrQDs9
-5J6b/wT/QxRZhq4HG+wq0uubWXjR/dt9UYRHFMO3UmVAXTQ6LdrVqLyEALn1VbDJ
-PX27oaMCgYEAkG9qrZgIan9T39E3Be5Tt8Myvy25vVESAb8ctODzmzyGtAsgr26r
-cO0U7f/naEGLkZVGpalqorVvGiZDYOPAoLTMm+/KI47GLz0T0eLjq5xOpWsixNrK
-F4CgrA0JozqQ9dILok88rScmzj4g5aUymfcm0HMTwgg2jh/a06OWL0w=
------END RSA PRIVATE KEY-----
diff --git a/xos/configurations/setup/id_rsa.pub b/xos/configurations/setup/id_rsa.pub
deleted file mode 100644
index 167f69e..0000000
--- a/xos/configurations/setup/id_rsa.pub
+++ /dev/null
@@ -1 +0,0 @@
-ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCIo3V9JDwOIUmZNYBarUWEV+A6/TlUaSQFSqcVgbYxQ/cUSwHIBwHKFj40zZr/HRt9nLS9+9/5gLmHPj+ReSk5fyrwxA8mxrYAOdRio0jpw24LMMjRdIltF0DVC5sYG5V7Sn+JngycIQZAwn7ZVaE0EP5/ad1Ba4MzUkNiiLPdw7rUT2JWqWmN4wQ8TdWDP6de2r/XeH6/+PwdS1hDM7lhaDaSCHjsYrzMD8X3XSLOQWV199b3a4E1AiAgpzerwCpjsoxVpPeQ/4K0WBtvsI2ZF028vOQLaPrLH4o5lLbSczgDdbqY2bY4WCtGBdfWUXPzhKJXLI/g3VpOjX7pfoH root@controller
diff --git a/xos/configurations/setup/node_key b/xos/configurations/setup/node_key
deleted file mode 100644
index c688622..0000000
--- a/xos/configurations/setup/node_key
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEpQIBAAKCAQEAwiKN1fSQ8DiFJmTWAWq1FhFfgOv05VGkkBUqnFYG2MUP3FEs
-ByAcByhY+NM2a/x0bfZy0vfvf+YC5hz4/kXkpOX8q8MQPJsa2ADnUYqNI6cNuCzD
-I0XSJbRdA1QubGBuVe0p/iZ4MnCEGQMJ+2VWhNBD+f2ndQWuDM1JDYoiz3cO61E9
-iVqlpjeMEPE3Vgz+nXtq/13h+v/j8HUtYQzO5YWg2kgh47GK8zA/F910izkFldff
-W92uBNQIgIKc3q8AqY7KMVaT3kP+CtFgbb7CNmRdNvLzkC2j6yx+KOZS20nM4A3W
-6mNm2OFgrRgXX1lFz84SiVyyP4N1aTo1+6X6BwIDAQABAoIBAQCg4lH5Bf03lx+B
-ef+AnRYFe9BR3znM8aQXY/M0LHbwHh/OzdZW8V1I8T8Ktr9bLpSurJbsD10D+XJd
-kZUn5HRf09lZ3wYNs9zDNbx97vyYl1DfWPk+uhY1+Qs8Pv9aAXBu9WTforHp2yUe
-NU6IcKsK1i3/dx7X9CURpu7rsZa3ptlLt+PlQe/XG8xmtgZ5D25wWy9iJqTEe7QP
-iWYI6+14Jsz7QIvVNn77fJAjBobNzmFVuquJzvMBAXqAPdMVSqkPwAU8HmPpCE7P
-AqaFxv2gMY0iJqa9VVB3Y0MUDJQ+XngcejLJl1tDDRAT66/O3rBReXL6NqOsE8dG
-QSv6mDxBAoGBAOrtDPDhkO/TYmhWEeOpbDh2C7/d2P2GHZ6IMqn80bIc+iLqqFxq
-9Nk0tFjJUfvZGzq5PKB+9Y3IQUwfsHb0Jn+4140iNcFdN/2J231Ggh0GapLbf7F0
-Eg/LOl56qlM+Eq8GnTdXe3Kifd0fXPVRsrQEeFElG6CZqbpZN8MFLYlFAoGBANOM
-wow+oWBVn+q9w7M7GVQ9L6Q0iIR5jrUe96LxNksbe4Rpghl1Qciy7bkibsRa/IAR
-Ol4aDrde53MHJkv8kXxnamdZGCY3/IrbmpHtl86rjIZtdPNumAaL7JGs4OT6dFyU
-6duzSYUAAx4J9hdBu4n86anE5G4iBpZmlc031hzbAoGAOfL7bDfX7rCv55jDlOrn
-3Q2RXGS27+KzT7W8+Z15hHwNX6uOmC1x9FpB2lzeskcdpmCnCdgHbk/le4edmdoj
-3QGVeiTkKax68TmeQMqxscMxasRmPTmqcubooQGVHi+DoFT7VvlnZCGc9nyUC5d5
-g1pO64VByV3eNi9nx91xHBkCgYEA0XH6J4nWkh8UDf/FIs0vPaS6Z1OPmcET1iSL
-vqocO+5Asw8WvIfIEqF8FSCPFB6VAWKNLB+WVFxEwDDi7LZpgAaPZTTjYOtrQDs9
-5J6b/wT/QxRZhq4HG+wq0uubWXjR/dt9UYRHFMO3UmVAXTQ6LdrVqLyEALn1VbDJ
-PX27oaMCgYEAkG9qrZgIan9T39E3Be5Tt8Myvy25vVESAb8ctODzmzyGtAsgr26r
-cO0U7f/naEGLkZVGpalqorVvGiZDYOPAoLTMm+/KI47GLz0T0eLjq5xOpWsixNrK
-F4CgrA0JozqQ9dILok88rScmzj4g5aUymfcm0HMTwgg2jh/a06OWL0w=
------END RSA PRIVATE KEY-----
diff --git a/xos/configurations/setup/node_key.pub b/xos/configurations/setup/node_key.pub
deleted file mode 100644
index 167f69e..0000000
--- a/xos/configurations/setup/node_key.pub
+++ /dev/null
@@ -1 +0,0 @@
-ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCIo3V9JDwOIUmZNYBarUWEV+A6/TlUaSQFSqcVgbYxQ/cUSwHIBwHKFj40zZr/HRt9nLS9+9/5gLmHPj+ReSk5fyrwxA8mxrYAOdRio0jpw24LMMjRdIltF0DVC5sYG5V7Sn+JngycIQZAwn7ZVaE0EP5/ad1Ba4MzUkNiiLPdw7rUT2JWqWmN4wQ8TdWDP6de2r/XeH6/+PwdS1hDM7lhaDaSCHjsYrzMD8X3XSLOQWV199b3a4E1AiAgpzerwCpjsoxVpPeQ/4K0WBtvsI2ZF028vOQLaPrLH4o5lLbSczgDdbqY2bY4WCtGBdfWUXPzhKJXLI/g3VpOjX7pfoH root@controller
diff --git a/xos/configurations/setup/nodes.yaml b/xos/configurations/setup/nodes.yaml
deleted file mode 100644
index 0b56159..0000000
--- a/xos/configurations/setup/nodes.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-imports:
-   - custom_types/xos.yaml
-
-description: autogenerated nodes file
-
-topology_template:
-  node_templates:
-    MyDeployment:
-        type: tosca.nodes.Deployment
-    mysite:
-        type: tosca.nodes.Site
-    computeBBU2:
-      type: tosca.nodes.Node
-      requirements:
-        - site:
-            node: mysite
-            relationship: tosca.relationships.MemberOfSite
-        - deployment:
-            node: MyDeployment
-            relationship: tosca.relationships.MemberOfDeployment
diff --git a/xos/configurations/setup/padmin_public_key b/xos/configurations/setup/padmin_public_key
deleted file mode 100644
index 167f69e..0000000
--- a/xos/configurations/setup/padmin_public_key
+++ /dev/null
@@ -1 +0,0 @@
-ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCIo3V9JDwOIUmZNYBarUWEV+A6/TlUaSQFSqcVgbYxQ/cUSwHIBwHKFj40zZr/HRt9nLS9+9/5gLmHPj+ReSk5fyrwxA8mxrYAOdRio0jpw24LMMjRdIltF0DVC5sYG5V7Sn+JngycIQZAwn7ZVaE0EP5/ad1Ba4MzUkNiiLPdw7rUT2JWqWmN4wQ8TdWDP6de2r/XeH6/+PwdS1hDM7lhaDaSCHjsYrzMD8X3XSLOQWV199b3a4E1AiAgpzerwCpjsoxVpPeQ/4K0WBtvsI2ZF028vOQLaPrLH4o5lLbSczgDdbqY2bY4WCtGBdfWUXPzhKJXLI/g3VpOjX7pfoH root@controller
diff --git a/xos/core/models/node.py b/xos/core/models/node.py
index 0977b81..f3ea303 100644
--- a/xos/core/models/node.py
+++ b/xos/core/models/node.py
@@ -13,7 +13,6 @@
     site_deployment = models.ForeignKey(SiteDeployment, related_name='nodes')
     site = models.ForeignKey(Site, null=True, blank=True, related_name='nodes')
     tags = generic.GenericRelation(Tag)
-#    default = models.BooleanField(default=False, help_text="make this a default node to use when creating new instances")
 
     def __unicode__(self):  return u'%s' % (self.name)
 
diff --git a/xos/core/models/service.py b/xos/core/models/service.py
index cece4a1..5854f4d 100644
--- a/xos/core/models/service.py
+++ b/xos/core/models/service.py
@@ -510,16 +510,12 @@
 
     def pick(self):
         from core.models import Node
-#        nodes = list(Node.objects.all())
-#        nodes = Node.objects.all()
-#MCORD        
         if not self.slice.default_node:
             nodes = list(Node.objects.all())
             nodes = sorted(nodes, key=lambda node: node.instances.all().count())
         else:
             nodes = list(Node.objects.filter(name = self.slice.default_node))
 
-#MCORD
         if self.label:
             nodes = nodes.filter(nodelabels__name=self.label)
 
diff --git a/xos/core/models/service.py.new b/xos/core/models/service.py.new
deleted file mode 100644
index d3b6a7d..0000000
--- a/xos/core/models/service.py.new
+++ /dev/null
@@ -1,791 +0,0 @@
-from django.db import models
-from core.models import PlCoreBase,SingletonModel,PlCoreBaseManager
-from core.models.plcorebase import StrippedCharField
-from xos.exceptions import *
-from operator import attrgetter
-import json
-
-COARSE_KIND="coarse"
-
-class AttributeMixin(object):
-    # helper for extracting things from a json-encoded service_specific_attribute
-    def get_attribute(self, name, default=None):
-        if self.service_specific_attribute:
-            attributes = json.loads(self.service_specific_attribute)
-        else:
-            attributes = {}
-        return attributes.get(name, default)
-
-    def set_attribute(self, name, value):
-        if self.service_specific_attribute:
-            attributes = json.loads(self.service_specific_attribute)
-        else:
-            attributes = {}
-        attributes[name]=value
-        self.service_specific_attribute = json.dumps(attributes)
-
-    def get_initial_attribute(self, name, default=None):
-        if self._initial["service_specific_attribute"]:
-            attributes = json.loads(self._initial["service_specific_attribute"])
-        else:
-            attributes = {}
-        return attributes.get(name, default)
-
-    @classmethod
-    def setup_simple_attributes(cls):
-        for (attrname, default) in cls.simple_attributes:
-            setattr(cls, attrname, property(lambda self, attrname=attrname, default=default: self.get_attribute(attrname, default),
-                                            lambda self, value, attrname=attrname: self.set_attribute(attrname, value),
-                                            None,
-                                            attrname))
-
-class Service(PlCoreBase, AttributeMixin):
-    # when subclassing a service, redefine KIND to describe the new service
-    KIND = "generic"
-
-    description = models.TextField(max_length=254,null=True, blank=True,help_text="Description of Service")
-    enabled = models.BooleanField(default=True)
-    kind = StrippedCharField(max_length=30, help_text="Kind of service", default=KIND)
-    name = StrippedCharField(max_length=30, help_text="Service Name")
-    versionNumber = StrippedCharField(max_length=30, help_text="Version of Service Definition")
-    published = models.BooleanField(default=True)
-    view_url = StrippedCharField(blank=True, null=True, max_length=1024)
-    icon_url = StrippedCharField(blank=True, null=True, max_length=1024)
-    public_key = models.TextField(null=True, blank=True, max_length=1024, help_text="Public key string")
-    private_key_fn = StrippedCharField(blank=True, null=True, max_length=1024)
-
-    # Service_specific_attribute and service_specific_id are opaque to XOS
-    service_specific_id = StrippedCharField(max_length=30, blank=True, null=True)
-    service_specific_attribute = models.TextField(blank=True, null=True)
-
-    def __init__(self, *args, **kwargs):
-        # for subclasses, set the default kind appropriately
-        self._meta.get_field("kind").default = self.KIND
-        super(Service, self).__init__(*args, **kwargs)
-
-    @classmethod
-    def get_service_objects(cls):
-        return cls.objects.filter(kind = cls.KIND)
-
-    @classmethod
-    def get_deleted_service_objects(cls):
-        return cls.deleted_objects.filter(kind = cls.KIND)
-
-    @classmethod
-    def get_service_objects_by_user(cls, user):
-        return cls.select_by_user(user).filter(kind = cls.KIND)
-
-    @classmethod
-    def select_by_user(cls, user):
-        if user.is_admin:
-            return cls.objects.all()
-        else:
-            service_ids = [sp.slice.id for sp in ServicePrivilege.objects.filter(user=user)]
-            return cls.objects.filter(id__in=service_ids)
-
-    @property
-    def serviceattribute_dict(self):
-        attrs = {}
-        for attr in self.serviceattributes.all():
-            attrs[attr.name] = attr.value
-        return attrs
-
-    def __unicode__(self): return u'%s' % (self.name)
-
-    def can_update(self, user):
-        return user.can_update_service(self, allow=['admin'])
-
-    def get_scalable_nodes(self, slice, max_per_node=None, exclusive_slices=[]):
-        """
-             Get a list of nodes that can be used to scale up a slice.
-
-                slice - slice to scale up
-                max_per_node - maximum numbers of instances that 'slice' can have on a single node
-                exclusive_slices - list of slices that must have no nodes in common with 'slice'.
-        """
-
-        from core.models import Node, Instance # late import to get around order-of-imports constraint in __init__.py
-
-        nodes = list(Node.objects.all())
-
-        conflicting_instances = Instance.objects.filter(slice__in = exclusive_slices)
-        conflicting_nodes = Node.objects.filter(instances__in = conflicting_instances)
-
-        nodes = [x for x in nodes if x not in conflicting_nodes]
-
-        # If max_per_node is set, then limit the number of instances this slice
-        # can have on a single node.
-        if max_per_node:
-            acceptable_nodes = []
-            for node in nodes:
-                existing_count = node.instances.filter(slice=slice).count()
-                if existing_count < max_per_node:
-                    acceptable_nodes.append(node)
-            nodes = acceptable_nodes
-
-        return nodes
-
-    def pick_node(self, slice, max_per_node=None, exclusive_slices=[]):
-        # Pick the best node to scale up a slice.
-
-        nodes = self.get_scalable_nodes(slice, max_per_node, exclusive_slices)
-        nodes = sorted(nodes, key=lambda node: node.instances.all().count())
-        if not nodes:
-            return None
-        return nodes[0]
-
-    def adjust_scale(self, slice_hint, scale, max_per_node=None, exclusive_slices=[]):
-        from core.models import Instance # late import to get around order-of-imports constraint in __init__.py
-
-        slices = [x for x in self.slices.all() if slice_hint in x.name]
-        for slice in slices:
-            while slice.instances.all().count() > scale:
-                s = slice.instances.all()[0]
-                # print "drop instance", s
-                s.delete()
-
-            while slice.instances.all().count() < scale:
-                node = self.pick_node(slice, max_per_node, exclusive_slices)
-                if not node:
-                    # no more available nodes
-                    break
-
-                image = slice.default_image
-                if not image:
-                    raise XOSConfigurationError("No default_image for slice %s" % slice.name)
-
-                flavor = slice.default_flavor
-                if not flavor:
-                    raise XOSConfigurationError("No default_flavor for slice %s" % slice.name)
-
-                s = Instance(slice=slice,
-                           node=node,
-                           creator=slice.creator,
-                           image=image,
-                           flavor=flavor,
-                           deployment=node.site_deployment.deployment)
-                s.save()
-
-                # print "add instance", s
-
-    def get_vtn_src_nets(self):
-        nets=[]
-        for slice in self.slices.all():
-            for ns in slice.networkslices.all():
-                if not ns.network:
-                    continue
-#                if ns.network.template.access in ["direct", "indirect"]:
-#                    # skip access networks; we want to use the private network
-#                    continue
-                if ns.network.name in ["wan_network", "lan_network"]:
-                    # we don't want to attach to the vCPE's lan or wan network
-                    # we only want to attach to its private network
-                    # TODO: fix hard-coding of network name
-                    continue
-                for cn in ns.network.controllernetworks.all():
-                    if cn.net_id:
-                        net = {"name": ns.network.name, "net_id": cn.net_id}
-                        nets.append(net)
-        return nets
-
-    def get_vtn_nets(self):
-        nets=[]
-        for slice in self.slices.all():
-            for ns in slice.networkslices.all():
-                if not ns.network:
-                    continue
-                if ns.network.template.access not in ["direct", "indirect"]:
-                    # skip anything that's not an access network
-                    continue
-                for cn in ns.network.controllernetworks.all():
-                    if cn.net_id:
-                        net = {"name": ns.network.name, "net_id": cn.net_id}
-                        nets.append(net)
-        return nets
-
-    def get_vtn_dependencies_nets(self):
-        provider_nets = []
-        for tenant in self.subscribed_tenants.all():
-            if tenant.provider_service:
-                for net in tenant.provider_service.get_vtn_nets():
-                    if not net in provider_nets:
-                        provider_nets.append(net)
-        return provider_nets
-
-    def get_vtn_dependencies_ids(self):
-        return [x["net_id"] for x in self.get_vtn_dependencies_nets()]
-
-    def get_vtn_dependencies_names(self):
-        return [x["name"]+"_"+x["net_id"] for x in self.get_vtn_dependencies_nets()]
-
-    def get_vtn_src_ids(self):
-        return [x["net_id"] for x in self.get_vtn_src_nets()]
-
-    def get_vtn_src_names(self):
-        return [x["name"]+"_"+x["net_id"] for x in self.get_vtn_src_nets()]
-
-
-class ServiceAttribute(PlCoreBase):
-    name = models.CharField(help_text="Attribute Name", max_length=128)
-    value = StrippedCharField(help_text="Attribute Value", max_length=1024)
-    service = models.ForeignKey(Service, related_name='serviceattributes', help_text="The Service this attribute is associated with")
-
-class ServiceRole(PlCoreBase):
-    ROLE_CHOICES = (('admin','Admin'),)
-    role = StrippedCharField(choices=ROLE_CHOICES, unique=True, max_length=30)
-
-    def __unicode__(self):  return u'%s' % (self.role)
-
-class ServicePrivilege(PlCoreBase):
-    user = models.ForeignKey('User', related_name='serviceprivileges')
-    service = models.ForeignKey('Service', related_name='serviceprivileges')
-    role = models.ForeignKey('ServiceRole',related_name='serviceprivileges')
-
-    class Meta:
-        unique_together =  ('user', 'service', 'role')
-
-    def __unicode__(self):  return u'%s %s %s' % (self.service, self.user, self.role)
-
-    def can_update(self, user):
-        if not self.service.enabled:
-            raise PermissionDenied, "Cannot modify permission(s) of a disabled service"
-        return self.service.can_update(user)
-
-    def save(self, *args, **kwds):
-        if not self.service.enabled:
-            raise PermissionDenied, "Cannot modify permission(s) of a disabled service"
-        super(ServicePrivilege, self).save(*args, **kwds)
-
-    def delete(self, *args, **kwds):
-        if not self.service.enabled:
-            raise PermissionDenied, "Cannot modify permission(s) of a disabled service"
-        super(ServicePrivilege, self).delete(*args, **kwds)
-
-    @classmethod
-    def select_by_user(cls, user):
-        if user.is_admin:
-            qs = cls.objects.all()
-        else:
-            qs = cls.objects.filter(user=user)
-        return qs
-
-class TenantRoot(PlCoreBase, AttributeMixin):
-    """ A tenantRoot is one of the things that can sit at the root of a chain
-        of tenancy. This object represents a node.
-    """
-
-    KIND= "generic"
-    kind = StrippedCharField(max_length=30, default=KIND)
-    name = StrippedCharField(max_length=255, help_text="name", blank=True, null=True)
-
-    service_specific_attribute = models.TextField(blank=True, null=True)
-    service_specific_id = StrippedCharField(max_length=30, blank=True, null=True)
-
-    def __init__(self, *args, **kwargs):
-        # for subclasses, set the default kind appropriately
-        self._meta.get_field("kind").default = self.KIND
-        super(TenantRoot, self).__init__(*args, **kwargs)
-
-    def __unicode__(self):
-        if not self.name:
-            return u"%s-tenant_root-#%s" % (str(self.kind), str(self.id))
-        else:
-            return self.name
-
-    def can_update(self, user):
-        return user.can_update_tenant_root(self, allow=['admin'])
-
-    def get_subscribed_tenants(self, tenant_class):
-        ids = self.subscribed_tenants.filter(kind=tenant_class.KIND)
-        return tenant_class.objects.filter(id__in = ids)
-
-    def get_newest_subscribed_tenant(self, kind):
-        st = list(self.get_subscribed_tenants(kind))
-        if not st:
-            return None
-        return sorted(st, key=attrgetter('id'))[0]
-
-    @classmethod
-    def get_tenant_objects(cls):
-        return cls.objects.filter(kind = cls.KIND)
-
-    @classmethod
-    def get_tenant_objects_by_user(cls, user):
-        return cls.select_by_user(user).filter(kind = cls.KIND)
-
-    @classmethod
-    def select_by_user(cls, user):
-        if user.is_admin:
-            return cls.objects.all()
-        else:
-            tr_ids = [trp.tenant_root.id for trp in TenantRootPrivilege.objects.filter(user=user)]
-            return cls.objects.filter(id__in=tr_ids)
-
-class Tenant(PlCoreBase, AttributeMixin):
-    """ A tenant is a relationship between two entities, a subscriber and a
-        provider. This object represents an edge.
-
-        The subscriber can be a User, a Service, or a Tenant.
-
-        The provider is always a Service.
-
-        TODO: rename "Tenant" to "Tenancy"
-    """
-
-    CONNECTIVITY_CHOICES = (('public', 'Public'), ('private', 'Private'), ('na', 'Not Applicable'))
-
-    # when subclassing a service, redefine KIND to describe the new service
-    KIND = "generic"
-
-    kind = StrippedCharField(max_length=30, default=KIND)
-    provider_service = models.ForeignKey(Service, related_name='provided_tenants')
-
-    # The next four things are the various type of objects that can be subscribers of this Tenancy
-    # relationship. One and only one can be used at a time.
-    subscriber_service = models.ForeignKey(Service, related_name='subscribed_tenants', blank=True, null=True)
-    subscriber_tenant = models.ForeignKey("Tenant", related_name='subscribed_tenants', blank=True, null=True)
-    subscriber_user = models.ForeignKey("User", related_name='subscribed_tenants', blank=True, null=True)
-    subscriber_root = models.ForeignKey("TenantRoot", related_name="subscribed_tenants", blank=True, null=True)
-
-    # Service_specific_attribute and service_specific_id are opaque to XOS
-    service_specific_id = StrippedCharField(max_length=30, blank=True, null=True)
-    service_specific_attribute = models.TextField(blank=True, null=True)
-
-    # Connect_method is only used by Coarse tenants
-    connect_method = models.CharField(null=False, blank=False, max_length=30, choices=CONNECTIVITY_CHOICES, default="na")
-
-    def __init__(self, *args, **kwargs):
-        # for subclasses, set the default kind appropriately
-        self._meta.get_field("kind").default = self.KIND
-        super(Tenant, self).__init__(*args, **kwargs)
-
-    def __unicode__(self):
-        return u"%s-tenant-%s" % (str(self.kind), str(self.id))
-
-    @classmethod
-    def get_tenant_objects(cls):
-        return cls.objects.filter(kind = cls.KIND)
-
-    @classmethod
-    def get_tenant_objects_by_user(cls, user):
-        return cls.select_by_user(user).filter(kind = cls.KIND)
-
-    @classmethod
-    def get_deleted_tenant_objects(cls):
-        return cls.deleted_objects.filter(kind = cls.KIND)
-
-    @property
-    def tenantattribute_dict(self):
-        attrs = {}
-        for attr in self.tenantattributes.all():
-            attrs[attr.name] = attr.value
-        return attrs
-
-    # helper function to be used in subclasses that want to ensure service_specific_id is unique
-    def validate_unique_service_specific_id(self):
-        if self.pk is None:
-            if self.service_specific_id is None:
-                raise XOSMissingField("subscriber_specific_id is None, and it's a required field", fields={"service_specific_id": "cannot be none"})
-
-            conflicts = self.get_tenant_objects().filter(service_specific_id=self.service_specific_id)
-            if conflicts:
-                raise XOSDuplicateKey("service_specific_id %s already exists" % self.service_specific_id, fields={"service_specific_id": "duplicate key"})
-
-    def save(self, *args, **kwargs):
-        subCount = sum( [1 for e in [self.subscriber_service, self.subscriber_tenant, self.subscriber_user, self.subscriber_root] if e is not None])
-        if (subCount > 1):
-            raise XOSConflictingField("Only one of subscriber_service, subscriber_tenant, subscriber_user, subscriber_root should be set")
-
-        super(Tenant, self).save(*args, **kwargs)
-
-    def get_subscribed_tenants(self, tenant_class):
-        ids = self.subscribed_tenants.filter(kind=tenant_class.KIND)
-        return tenant_class.objects.filter(id__in = ids)
-
-    def get_newest_subscribed_tenant(self, kind):
-        st = list(self.get_subscribed_tenants(kind))
-        if not st:
-            return None
-        return sorted(st, key=attrgetter('id'))[0]
-
-class Scheduler(object):
-    # XOS Scheduler Abstract Base Class
-    # Used to implement schedulers that pick which node to put instances on
-
-    def __init__(self, slice):
-        self.slice = slice
-
-    def pick(self):
-        # this method should return a tuple (node, parent)
-        #    node is the node to instantiate on
-        #    parent is for container_vm instances only, and is the VM that will
-        #      hold the container
-
-        raise Exception("Abstract Base")
-
-class LeastLoadedNodeScheduler(Scheduler):
-    # This scheduler always return the node with the fewest number of instances.
-
-    def __init__(self, slice):
-        super(LeastLoadedNodeScheduler, self).__init__(slice)
-
-    def pick(self):
-        from core.models import Node
-#        nodes = list(Node.objects.all())
-        if not self.slice.default_node:
-            nodes = list(Node.objects.all())
-            nodes = sorted(nodes, key=lambda node: node.instances.all().count())
-        else:
-            nodes = list(Node.objects.filter(name = self.slice.default_node))
-        # TODO: logic to filter nodes by which nodes are up, and which
-        #   nodes the slice can instantiate on.
-#        nodes = sorted(nodes, key=lambda node: node.instances.all().count())
-        return [nodes[0], None]
-
-class ContainerVmScheduler(Scheduler):
-    # This scheduler picks a VM in the slice with the fewest containers inside
-    # of it. If no VMs are suitable, then it creates a VM.
-
-    # this is a hack and should be replaced by something smarter...
-    LOOK_FOR_IMAGES=["ubuntu-vcpe4",        # ONOS demo machine -- preferred vcpe image
-                     "Ubuntu 14.04 LTS",    # portal
-                     "Ubuntu-14.04-LTS",    # ONOS demo machine
-                     "trusty-server-multi-nic", # CloudLab
-                    ]
-
-    MAX_VM_PER_CONTAINER = 10
-
-    def __init__(self, slice):
-        super(ContainerVmScheduler, self).__init__(slice)
-
-    @property
-    def image(self):
-        from core.models import Image
-
-        look_for_images = self.LOOK_FOR_IMAGES
-        for image_name in look_for_images:
-            images = Image.objects.filter(name = image_name)
-            if images:
-                return images[0]
-
-        raise XOSProgrammingError("No ContainerVM image (looked for %s)" % str(look_for_images))
-
-    def make_new_instance(self):
-        from core.models import Instance, Flavor
-
-        flavors = Flavor.objects.filter(name="m1.small")
-        if not flavors:
-            raise XOSConfigurationError("No m1.small flavor")
-
-        (node,parent) = LeastLoadedNodeScheduler(self.slice).pick()
-
-        instance = Instance(slice = self.slice,
-                        node = node,
-                        image = self.image,
-                        creator = self.slice.creator,
-                        deployment = node.site_deployment.deployment,
-                        flavor = flavors[0],
-                        isolation = "vm",
-                        parent = parent)
-        instance.save()
-        # We rely on a special naming convention to identify the VMs that will
-        # hole containers.
-        instance.name = "%s-outer-%s" % (instance.slice.name, instance.id)
-        instance.save()
-        return instance
-
-    def pick(self):
-        from core.models import Instance, Flavor
-
-        for vm in self.slice.instances.filter(isolation="vm"):
-            avail_vms = []
-            if (vm.name.startswith("%s-outer-" % self.slice.name)):
-                container_count = Instance.objects.filter(parent=vm).count()
-                if (container_count < self.MAX_VM_PER_CONTAINER):
-                    avail_vms.append( (vm, container_count) )
-            # sort by least containers-per-vm
-            avail_vms = sorted(avail_vms, key = lambda x: x[1])
-            print "XXX", avail_vms
-            if avail_vms:
-                instance = avail_vms[0][0]
-                return (instance.node, instance)
-
-        instance = self.make_new_instance()
-        return (instance.node, instance)
-
-class TenantWithContainer(Tenant):
-    """ A tenant that manages a container """
-
-    # this is a hack and should be replaced by something smarter...
-    LOOK_FOR_IMAGES=["ubuntu-vcpe4",        # ONOS demo machine -- preferred vcpe image
-                     "Ubuntu 14.04 LTS",    # portal
-                     "Ubuntu-14.04-LTS",    # ONOS demo machine
-                     "trusty-server-multi-nic", # CloudLab
-                    ]
-
-    LOOK_FOR_CONTAINER_IMAGES=["docker-vcpe"]
-
-    class Meta:
-        proxy = True
-
-    def __init__(self, *args, **kwargs):
-        super(TenantWithContainer, self).__init__(*args, **kwargs)
-        self.cached_instance=None
-        self.orig_instance_id = self.get_initial_attribute("instance_id")
-
-    @property
-    def instance(self):
-        from core.models import Instance
-        if getattr(self, "cached_instance", None):
-            return self.cached_instance
-        instance_id=self.get_attribute("instance_id")
-        if not instance_id:
-            return None
-        instances=Instance.objects.filter(id=instance_id)
-        if not instances:
-            return None
-        instance=instances[0]
-        instance.caller = self.creator
-        self.cached_instance = instance
-        return instance
-
-    @instance.setter
-    def instance(self, value):
-        if value:
-            value = value.id
-        if (value != self.get_attribute("instance_id", None)):
-            self.cached_instance=None
-        self.set_attribute("instance_id", value)
-
-    @property
-    def external_hostname(self):
-        return self.get_attribute("external_hostname", "")
-
-    @external_hostname.setter
-    def external_hostname(self, value):
-        self.set_attribute("external_hostname", value)
-
-    @property
-    def external_container(self):
-        return self.get_attribute("external_container", "")
-
-    @external_container.setter
-    def external_container(self, value):
-        self.set_attribute("external_container", value)
-
-    @property
-    def creator(self):
-        from core.models import User
-        if getattr(self, "cached_creator", None):
-            return self.cached_creator
-        creator_id=self.get_attribute("creator_id")
-        if not creator_id:
-            return None
-        users=User.objects.filter(id=creator_id)
-        if not users:
-            return None
-        user=users[0]
-        self.cached_creator = users[0]
-        return user
-
-    @creator.setter
-    def creator(self, value):
-        if value:
-            value = value.id
-        if (value != self.get_attribute("creator_id", None)):
-            self.cached_creator=None
-        self.set_attribute("creator_id", value)
-
-    @property
-    def image(self):
-        from core.models import Image
-        # Implement the logic here to pick the image that should be used when
-        # instantiating the VM that will hold the container.
-
-        slice = self.provider_service.slices.all()
-        if not slice:
-            raise XOSProgrammingError("provider service has no slice")
-        slice = slice[0]
-
-        if slice.default_isolation in ["container", "container_vm"]:
-            look_for_images = self.LOOK_FOR_CONTAINER_IMAGES
-        else:
-            look_for_images = self.LOOK_FOR_IMAGES
-
-        for image_name in look_for_images:
-            images = Image.objects.filter(name = image_name)
-            if images:
-                return images[0]
-
-        raise XOSProgrammingError("No VPCE image (looked for %s)" % str(look_for_images))
-
-    def save_instance(self, instance):
-        # Override this function to do custom pre-save or post-save processing,
-        # such as creating ports for containers.
-        instance.save()
-
-    def pick_least_loaded_instance_in_slice(self, slices):
-        for slice in slices:
-            if slice.instances.all().count() > 0:
-                for instance in slice.instances.all():
-                     #Pick the first instance that has lesser than 5 tenants 
-                     if self.count_of_tenants_of_an_instance(instance) < 5:
-                         return instance
-        return None
-
-    #TODO: Ideally the tenant count for an instance should be maintained using a 
-    #many-to-one relationship attribute, however this model being proxy, it does 
-    #not permit any new attributes to be defined. Find if any better solutions 
-    def count_of_tenants_of_an_instance(self, instance):
-        tenant_count = 0
-        for tenant in self.get_tenant_objects().all():
-            if tenant.get_attribute("instance_id", None) == instance.id:
-                tenant_count += 1
-        return tenant_count
-
-    def manage_container(self):
-        from core.models import Instance, Flavor
-
-        if self.deleted:
-            return
-
-        if (self.instance is not None): #  and (self.instance.image != self.image):
-            self.instance.delete()
-            self.instance = None
-
-        if self.instance is None:
-            if not self.provider_service.slices.count():
-                raise XOSConfigurationError("The service has no slices")
-
-            new_instance_created = False
-            instance = None
-            if self.get_attribute("use_same_instance_for_multiple_tenants", default=False):
-                #Find if any existing instances can be used for this tenant
-                slices = self.provider_service.slices.all()
-                instance = self.pick_least_loaded_instance_in_slice(slices)
-
-            if not instance:
-                flavors = Flavor.objects.filter(name="m1.small")
-                if not flavors:
-                    raise XOSConfigurationError("No m1.small flavor")
-
-                slice = self.provider_service.slices.all()[0]
-
-                if slice.default_isolation == "container_vm":
-                    (node, parent) = ContainerVmScheduler(slice).pick()
-                else:
-                    (node, parent) = LeastLoadedNodeScheduler(slice).pick()
-
-                instance = Instance(slice = slice,
-                                node = node,
-#                                image = slice.default_image,
-                                image = self.image,
-                                creator = self.creator,
-                                deployment = node.site_deployment.deployment,
-#                                flavor = flavors[0],
-                                flavor = slice.default_flavor,
-                                isolation = slice.default_isolation,
-                                parent = parent)
-                self.save_instance(instance)
-                new_instance_created = True
-
-            try:
-                self.instance = instance
-                super(TenantWithContainer, self).save()
-            except:
-                if new_instance_created:
-                    instance.delete()
-                raise
-
-    def cleanup_container(self):
-        if self.instance:
-            if self.get_attribute("use_same_instance_for_multiple_tenants", default=False):
-                #Delete the instance only if this is last tenant in that instance
-                tenant_count = self.count_of_tenants_of_an_instance(self.instance)
-                if tenant_count == 0:
-                    self.instance.delete()
-            else:
-                self.instance.delete()
-            self.instance = None
-
-    def save(self, *args, **kwargs):
-        if (not self.creator) and (hasattr(self, "caller")) and (self.caller):
-            self.creator = self.caller
-        super(TenantWithContainer, self).save(*args, **kwargs)
-
-class CoarseTenant(Tenant):
-    """ TODO: rename "CoarseTenant" --> "StaticTenant" """
-    class Meta:
-        proxy = True
-
-    KIND = COARSE_KIND
-
-    def save(self, *args, **kwargs):
-        if (not self.subscriber_service):
-            raise XOSValidationError("subscriber_service cannot be null")
-        if (self.subscriber_tenant or self.subscriber_user):
-            raise XOSValidationError("subscriber_tenant and subscriber_user must be null")
-
-        super(CoarseTenant,self).save()
-
-class Subscriber(TenantRoot):
-    """ Intermediate class for TenantRoots that are to be Subscribers """
-
-    class Meta:
-        proxy = True
-
-    KIND = "Subscriber"
-
-class Provider(TenantRoot):
-    """ Intermediate class for TenantRoots that are to be Providers """
-
-    class Meta:
-        proxy = True
-
-    KIND = "Provider"
-
-class TenantAttribute(PlCoreBase):
-    name = models.CharField(help_text="Attribute Name", max_length=128)
-    value = models.TextField(help_text="Attribute Value")
-    tenant = models.ForeignKey(Tenant, related_name='tenantattributes', help_text="The Tenant this attribute is associated with")
-
-class TenantRootRole(PlCoreBase):
-    ROLE_CHOICES = (('admin','Admin'), ('access','Access'))
-
-    role = StrippedCharField(choices=ROLE_CHOICES, unique=True, max_length=30)
-
-    def __unicode__(self):  return u'%s' % (self.role)
-
-class TenantRootPrivilege(PlCoreBase):
-    user = models.ForeignKey('User', related_name="tenant_root_privileges")
-    tenant_root = models.ForeignKey('TenantRoot', related_name="tenant_root_privileges")
-    role = models.ForeignKey('TenantRootRole', related_name="tenant_root_privileges")
-
-    class Meta:
-        unique_together = ('user', 'tenant_root', 'role')
-
-    def __unicode__(self):  return u'%s %s %s' % (self.tenant_root, self.user, self.role)
-
-    def save(self, *args, **kwds):
-        if not self.user.is_active:
-            raise PermissionDenied, "Cannot modify role(s) of a disabled user"
-        super(TenantRootPrivilege, self).save(*args, **kwds)
-
-    def can_update(self, user):
-        return user.can_update_tenant_root_privilege(self)
-
-    @classmethod
-    def select_by_user(cls, user):
-        if user.is_admin:
-            return cls.objects.all()
-        else:
-            # User can see his own privilege
-            trp_ids = [trp.id for trp in cls.objects.filter(user=user)]
-
-            # A slice admin can see the SlicePrivileges for his Slice
-            for priv in cls.objects.filter(user=user, role__role="admin"):
-                trp_ids.extend( [trp.id for trp in cls.objects.filter(tenant_root=priv.tenant_root)] )
-
-            return cls.objects.filter(id__in=trp_ids)
-
-
diff --git a/xos/core/models/service.py.old b/xos/core/models/service.py.old
deleted file mode 100644
index 1a1b6ef..0000000
--- a/xos/core/models/service.py.old
+++ /dev/null
@@ -1,785 +0,0 @@
-from django.db import models
-from core.models import PlCoreBase,SingletonModel,PlCoreBaseManager
-from core.models.plcorebase import StrippedCharField
-from xos.exceptions import *
-from operator import attrgetter
-import json
-
-COARSE_KIND="coarse"
-
-class AttributeMixin(object):
-    # helper for extracting things from a json-encoded service_specific_attribute
-    def get_attribute(self, name, default=None):
-        if self.service_specific_attribute:
-            attributes = json.loads(self.service_specific_attribute)
-        else:
-            attributes = {}
-        return attributes.get(name, default)
-
-    def set_attribute(self, name, value):
-        if self.service_specific_attribute:
-            attributes = json.loads(self.service_specific_attribute)
-        else:
-            attributes = {}
-        attributes[name]=value
-        self.service_specific_attribute = json.dumps(attributes)
-
-    def get_initial_attribute(self, name, default=None):
-        if self._initial["service_specific_attribute"]:
-            attributes = json.loads(self._initial["service_specific_attribute"])
-        else:
-            attributes = {}
-        return attributes.get(name, default)
-
-    @classmethod
-    def setup_simple_attributes(cls):
-        for (attrname, default) in cls.simple_attributes:
-            setattr(cls, attrname, property(lambda self, attrname=attrname, default=default: self.get_attribute(attrname, default),
-                                            lambda self, value, attrname=attrname: self.set_attribute(attrname, value),
-                                            None,
-                                            attrname))
-
-class Service(PlCoreBase, AttributeMixin):
-    # when subclassing a service, redefine KIND to describe the new service
-    KIND = "generic"
-
-    description = models.TextField(max_length=254,null=True, blank=True,help_text="Description of Service")
-    enabled = models.BooleanField(default=True)
-    kind = StrippedCharField(max_length=30, help_text="Kind of service", default=KIND)
-    name = StrippedCharField(max_length=30, help_text="Service Name")
-    versionNumber = StrippedCharField(max_length=30, help_text="Version of Service Definition")
-    published = models.BooleanField(default=True)
-    view_url = StrippedCharField(blank=True, null=True, max_length=1024)
-    icon_url = StrippedCharField(blank=True, null=True, max_length=1024)
-    public_key = models.TextField(null=True, blank=True, max_length=1024, help_text="Public key string")
-    private_key_fn = StrippedCharField(blank=True, null=True, max_length=1024)
-
-    # Service_specific_attribute and service_specific_id are opaque to XOS
-    service_specific_id = StrippedCharField(max_length=30, blank=True, null=True)
-    service_specific_attribute = models.TextField(blank=True, null=True)
-
-    def __init__(self, *args, **kwargs):
-        # for subclasses, set the default kind appropriately
-        self._meta.get_field("kind").default = self.KIND
-        super(Service, self).__init__(*args, **kwargs)
-
-    @classmethod
-    def get_service_objects(cls):
-        return cls.objects.filter(kind = cls.KIND)
-
-    @classmethod
-    def get_deleted_service_objects(cls):
-        return cls.deleted_objects.filter(kind = cls.KIND)
-
-    @classmethod
-    def get_service_objects_by_user(cls, user):
-        return cls.select_by_user(user).filter(kind = cls.KIND)
-
-    @classmethod
-    def select_by_user(cls, user):
-        if user.is_admin:
-            return cls.objects.all()
-        else:
-            service_ids = [sp.slice.id for sp in ServicePrivilege.objects.filter(user=user)]
-            return cls.objects.filter(id__in=service_ids)
-
-    @property
-    def serviceattribute_dict(self):
-        attrs = {}
-        for attr in self.serviceattributes.all():
-            attrs[attr.name] = attr.value
-        return attrs
-
-    def __unicode__(self): return u'%s' % (self.name)
-
-    def can_update(self, user):
-        return user.can_update_service(self, allow=['admin'])
-
-    def get_scalable_nodes(self, slice, max_per_node=None, exclusive_slices=[]):
-        """
-             Get a list of nodes that can be used to scale up a slice.
-
-                slice - slice to scale up
-                max_per_node - maximum numbers of instances that 'slice' can have on a single node
-                exclusive_slices - list of slices that must have no nodes in common with 'slice'.
-        """
-
-        from core.models import Node, Instance # late import to get around order-of-imports constraint in __init__.py
-
-        nodes = list(Node.objects.all())
-
-        conflicting_instances = Instance.objects.filter(slice__in = exclusive_slices)
-        conflicting_nodes = Node.objects.filter(instances__in = conflicting_instances)
-
-        nodes = [x for x in nodes if x not in conflicting_nodes]
-
-        # If max_per_node is set, then limit the number of instances this slice
-        # can have on a single node.
-        if max_per_node:
-            acceptable_nodes = []
-            for node in nodes:
-                existing_count = node.instances.filter(slice=slice).count()
-                if existing_count < max_per_node:
-                    acceptable_nodes.append(node)
-            nodes = acceptable_nodes
-
-        return nodes
-
-    def pick_node(self, slice, max_per_node=None, exclusive_slices=[]):
-        # Pick the best node to scale up a slice.
-
-        nodes = self.get_scalable_nodes(slice, max_per_node, exclusive_slices)
-        nodes = sorted(nodes, key=lambda node: node.instances.all().count())
-        if not nodes:
-            return None
-        return nodes[0]
-
-    def adjust_scale(self, slice_hint, scale, max_per_node=None, exclusive_slices=[]):
-        from core.models import Instance # late import to get around order-of-imports constraint in __init__.py
-
-        slices = [x for x in self.slices.all() if slice_hint in x.name]
-        for slice in slices:
-            while slice.instances.all().count() > scale:
-                s = slice.instances.all()[0]
-                # print "drop instance", s
-                s.delete()
-
-            while slice.instances.all().count() < scale:
-                node = self.pick_node(slice, max_per_node, exclusive_slices)
-                if not node:
-                    # no more available nodes
-                    break
-
-                image = slice.default_image
-                if not image:
-                    raise XOSConfigurationError("No default_image for slice %s" % slice.name)
-
-                flavor = slice.default_flavor
-                if not flavor:
-                    raise XOSConfigurationError("No default_flavor for slice %s" % slice.name)
-
-                s = Instance(slice=slice,
-                           node=node,
-                           creator=slice.creator,
-                           image=image,
-                           flavor=flavor,
-                           deployment=node.site_deployment.deployment)
-                s.save()
-
-                # print "add instance", s
-
-    def get_vtn_src_nets(self):
-        nets=[]
-        for slice in self.slices.all():
-            for ns in slice.networkslices.all():
-                if not ns.network:
-                    continue
-#                if ns.network.template.access in ["direct", "indirect"]:
-#                    # skip access networks; we want to use the private network
-#                    continue
-                if ns.network.name in ["wan_network", "lan_network"]:
-                    # we don't want to attach to the vCPE's lan or wan network
-                    # we only want to attach to its private network
-                    # TODO: fix hard-coding of network name
-                    continue
-                for cn in ns.network.controllernetworks.all():
-                    if cn.net_id:
-                        net = {"name": ns.network.name, "net_id": cn.net_id}
-                        nets.append(net)
-        return nets
-
-    def get_vtn_nets(self):
-        nets=[]
-        for slice in self.slices.all():
-            for ns in slice.networkslices.all():
-                if not ns.network:
-                    continue
-                if ns.network.template.access not in ["direct", "indirect"]:
-                    # skip anything that's not an access network
-                    continue
-                for cn in ns.network.controllernetworks.all():
-                    if cn.net_id:
-                        net = {"name": ns.network.name, "net_id": cn.net_id}
-                        nets.append(net)
-        return nets
-
-    def get_vtn_dependencies_nets(self):
-        provider_nets = []
-        for tenant in self.subscribed_tenants.all():
-            if tenant.provider_service:
-                for net in tenant.provider_service.get_vtn_nets():
-                    if not net in provider_nets:
-                        provider_nets.append(net)
-        return provider_nets
-
-    def get_vtn_dependencies_ids(self):
-        return [x["net_id"] for x in self.get_vtn_dependencies_nets()]
-
-    def get_vtn_dependencies_names(self):
-        return [x["name"]+"_"+x["net_id"] for x in self.get_vtn_dependencies_nets()]
-
-    def get_vtn_src_ids(self):
-        return [x["net_id"] for x in self.get_vtn_src_nets()]
-
-    def get_vtn_src_names(self):
-        return [x["name"]+"_"+x["net_id"] for x in self.get_vtn_src_nets()]
-
-
-class ServiceAttribute(PlCoreBase):
-    name = models.CharField(help_text="Attribute Name", max_length=128)
-    value = StrippedCharField(help_text="Attribute Value", max_length=1024)
-    service = models.ForeignKey(Service, related_name='serviceattributes', help_text="The Service this attribute is associated with")
-
-class ServiceRole(PlCoreBase):
-    ROLE_CHOICES = (('admin','Admin'),)
-    role = StrippedCharField(choices=ROLE_CHOICES, unique=True, max_length=30)
-
-    def __unicode__(self):  return u'%s' % (self.role)
-
-class ServicePrivilege(PlCoreBase):
-    user = models.ForeignKey('User', related_name='serviceprivileges')
-    service = models.ForeignKey('Service', related_name='serviceprivileges')
-    role = models.ForeignKey('ServiceRole',related_name='serviceprivileges')
-
-    class Meta:
-        unique_together =  ('user', 'service', 'role')
-
-    def __unicode__(self):  return u'%s %s %s' % (self.service, self.user, self.role)
-
-    def can_update(self, user):
-        if not self.service.enabled:
-            raise PermissionDenied, "Cannot modify permission(s) of a disabled service"
-        return self.service.can_update(user)
-
-    def save(self, *args, **kwds):
-        if not self.service.enabled:
-            raise PermissionDenied, "Cannot modify permission(s) of a disabled service"
-        super(ServicePrivilege, self).save(*args, **kwds)
-
-    def delete(self, *args, **kwds):
-        if not self.service.enabled:
-            raise PermissionDenied, "Cannot modify permission(s) of a disabled service"
-        super(ServicePrivilege, self).delete(*args, **kwds)
-
-    @classmethod
-    def select_by_user(cls, user):
-        if user.is_admin:
-            qs = cls.objects.all()
-        else:
-            qs = cls.objects.filter(user=user)
-        return qs
-
-class TenantRoot(PlCoreBase, AttributeMixin):
-    """ A tenantRoot is one of the things that can sit at the root of a chain
-        of tenancy. This object represents a node.
-    """
-
-    KIND= "generic"
-    kind = StrippedCharField(max_length=30, default=KIND)
-    name = StrippedCharField(max_length=255, help_text="name", blank=True, null=True)
-
-    service_specific_attribute = models.TextField(blank=True, null=True)
-    service_specific_id = StrippedCharField(max_length=30, blank=True, null=True)
-
-    def __init__(self, *args, **kwargs):
-        # for subclasses, set the default kind appropriately
-        self._meta.get_field("kind").default = self.KIND
-        super(TenantRoot, self).__init__(*args, **kwargs)
-
-    def __unicode__(self):
-        if not self.name:
-            return u"%s-tenant_root-#%s" % (str(self.kind), str(self.id))
-        else:
-            return self.name
-
-    def can_update(self, user):
-        return user.can_update_tenant_root(self, allow=['admin'])
-
-    def get_subscribed_tenants(self, tenant_class):
-        ids = self.subscribed_tenants.filter(kind=tenant_class.KIND)
-        return tenant_class.objects.filter(id__in = ids)
-
-    def get_newest_subscribed_tenant(self, kind):
-        st = list(self.get_subscribed_tenants(kind))
-        if not st:
-            return None
-        return sorted(st, key=attrgetter('id'))[0]
-
-    @classmethod
-    def get_tenant_objects(cls):
-        return cls.objects.filter(kind = cls.KIND)
-
-    @classmethod
-    def get_tenant_objects_by_user(cls, user):
-        return cls.select_by_user(user).filter(kind = cls.KIND)
-
-    @classmethod
-    def select_by_user(cls, user):
-        if user.is_admin:
-            return cls.objects.all()
-        else:
-            tr_ids = [trp.tenant_root.id for trp in TenantRootPrivilege.objects.filter(user=user)]
-            return cls.objects.filter(id__in=tr_ids)
-
-class Tenant(PlCoreBase, AttributeMixin):
-    """ A tenant is a relationship between two entities, a subscriber and a
-        provider. This object represents an edge.
-
-        The subscriber can be a User, a Service, or a Tenant.
-
-        The provider is always a Service.
-
-        TODO: rename "Tenant" to "Tenancy"
-    """
-
-    CONNECTIVITY_CHOICES = (('public', 'Public'), ('private', 'Private'), ('na', 'Not Applicable'))
-
-    # when subclassing a service, redefine KIND to describe the new service
-    KIND = "generic"
-
-    kind = StrippedCharField(max_length=30, default=KIND)
-    provider_service = models.ForeignKey(Service, related_name='provided_tenants')
-
-    # The next four things are the various type of objects that can be subscribers of this Tenancy
-    # relationship. One and only one can be used at a time.
-    subscriber_service = models.ForeignKey(Service, related_name='subscribed_tenants', blank=True, null=True)
-    subscriber_tenant = models.ForeignKey("Tenant", related_name='subscribed_tenants', blank=True, null=True)
-    subscriber_user = models.ForeignKey("User", related_name='subscribed_tenants', blank=True, null=True)
-    subscriber_root = models.ForeignKey("TenantRoot", related_name="subscribed_tenants", blank=True, null=True)
-
-    # Service_specific_attribute and service_specific_id are opaque to XOS
-    service_specific_id = StrippedCharField(max_length=30, blank=True, null=True)
-    service_specific_attribute = models.TextField(blank=True, null=True)
-
-    # Connect_method is only used by Coarse tenants
-    connect_method = models.CharField(null=False, blank=False, max_length=30, choices=CONNECTIVITY_CHOICES, default="na")
-
-    def __init__(self, *args, **kwargs):
-        # for subclasses, set the default kind appropriately
-        self._meta.get_field("kind").default = self.KIND
-        super(Tenant, self).__init__(*args, **kwargs)
-
-    def __unicode__(self):
-        return u"%s-tenant-%s" % (str(self.kind), str(self.id))
-
-    @classmethod
-    def get_tenant_objects(cls):
-        return cls.objects.filter(kind = cls.KIND)
-
-    @classmethod
-    def get_tenant_objects_by_user(cls, user):
-        return cls.select_by_user(user).filter(kind = cls.KIND)
-
-    @classmethod
-    def get_deleted_tenant_objects(cls):
-        return cls.deleted_objects.filter(kind = cls.KIND)
-
-    @property
-    def tenantattribute_dict(self):
-        attrs = {}
-        for attr in self.tenantattributes.all():
-            attrs[attr.name] = attr.value
-        return attrs
-
-    # helper function to be used in subclasses that want to ensure service_specific_id is unique
-    def validate_unique_service_specific_id(self):
-        if self.pk is None:
-            if self.service_specific_id is None:
-                raise XOSMissingField("subscriber_specific_id is None, and it's a required field", fields={"service_specific_id": "cannot be none"})
-
-            conflicts = self.get_tenant_objects().filter(service_specific_id=self.service_specific_id)
-            if conflicts:
-                raise XOSDuplicateKey("service_specific_id %s already exists" % self.service_specific_id, fields={"service_specific_id": "duplicate key"})
-
-    def save(self, *args, **kwargs):
-        subCount = sum( [1 for e in [self.subscriber_service, self.subscriber_tenant, self.subscriber_user, self.subscriber_root] if e is not None])
-        if (subCount > 1):
-            raise XOSConflictingField("Only one of subscriber_service, subscriber_tenant, subscriber_user, subscriber_root should be set")
-
-        super(Tenant, self).save(*args, **kwargs)
-
-    def get_subscribed_tenants(self, tenant_class):
-        ids = self.subscribed_tenants.filter(kind=tenant_class.KIND)
-        return tenant_class.objects.filter(id__in = ids)
-
-    def get_newest_subscribed_tenant(self, kind):
-        st = list(self.get_subscribed_tenants(kind))
-        if not st:
-            return None
-        return sorted(st, key=attrgetter('id'))[0]
-
-class Scheduler(object):
-    # XOS Scheduler Abstract Base Class
-    # Used to implement schedulers that pick which node to put instances on
-
-    def __init__(self, slice):
-        self.slice = slice
-
-    def pick(self):
-        # this method should return a tuple (node, parent)
-        #    node is the node to instantiate on
-        #    parent is for container_vm instances only, and is the VM that will
-        #      hold the container
-
-        raise Exception("Abstract Base")
-
-class LeastLoadedNodeScheduler(Scheduler):
-    # This scheduler always return the node with the fewest number of instances.
-
-    def __init__(self, slice):
-        super(LeastLoadedNodeScheduler, self).__init__(slice)
-
-    def pick(self):
-        from core.models import Node
-        nodes = list(Node.objects.all())
-
-        # TODO: logic to filter nodes by which nodes are up, and which
-        #   nodes the slice can instantiate on.
-        nodes = sorted(nodes, key=lambda node: node.instances.all().count())
-        return [nodes[0], None]
-
-class ContainerVmScheduler(Scheduler):
-    # This scheduler picks a VM in the slice with the fewest containers inside
-    # of it. If no VMs are suitable, then it creates a VM.
-
-    # this is a hack and should be replaced by something smarter...
-    LOOK_FOR_IMAGES=["ubuntu-vcpe4",        # ONOS demo machine -- preferred vcpe image
-                     "Ubuntu 14.04 LTS",    # portal
-                     "Ubuntu-14.04-LTS",    # ONOS demo machine
-                     "trusty-server-multi-nic", # CloudLab
-                    ]
-
-    MAX_VM_PER_CONTAINER = 10
-
-    def __init__(self, slice):
-        super(ContainerVmScheduler, self).__init__(slice)
-
-    @property
-    def image(self):
-        from core.models import Image
-
-        look_for_images = self.LOOK_FOR_IMAGES
-        for image_name in look_for_images:
-            images = Image.objects.filter(name = image_name)
-            if images:
-                return images[0]
-
-        raise XOSProgrammingError("No ContainerVM image (looked for %s)" % str(look_for_images))
-
-    def make_new_instance(self):
-        from core.models import Instance, Flavor
-
-        flavors = Flavor.objects.filter(name="m1.small")
-        if not flavors:
-            raise XOSConfigurationError("No m1.small flavor")
-
-        (node,parent) = LeastLoadedNodeScheduler(self.slice).pick()
-
-        instance = Instance(slice = self.slice,
-                        node = node,
-                        image = self.image,
-                        creator = self.slice.creator,
-                        deployment = node.site_deployment.deployment,
-                        flavor = flavors[0],
-                        isolation = "vm",
-                        parent = parent)
-        instance.save()
-        # We rely on a special naming convention to identify the VMs that will
-        # hole containers.
-        instance.name = "%s-outer-%s" % (instance.slice.name, instance.id)
-        instance.save()
-        return instance
-
-    def pick(self):
-        from core.models import Instance, Flavor
-
-        for vm in self.slice.instances.filter(isolation="vm"):
-            avail_vms = []
-            if (vm.name.startswith("%s-outer-" % self.slice.name)):
-                container_count = Instance.objects.filter(parent=vm).count()
-                if (container_count < self.MAX_VM_PER_CONTAINER):
-                    avail_vms.append( (vm, container_count) )
-            # sort by least containers-per-vm
-            avail_vms = sorted(avail_vms, key = lambda x: x[1])
-            print "XXX", avail_vms
-            if avail_vms:
-                instance = avail_vms[0][0]
-                return (instance.node, instance)
-
-        instance = self.make_new_instance()
-        return (instance.node, instance)
-
-class TenantWithContainer(Tenant):
-    """ A tenant that manages a container """
-
-    # this is a hack and should be replaced by something smarter...
-    LOOK_FOR_IMAGES=["ubuntu-vcpe4",        # ONOS demo machine -- preferred vcpe image
-                     "Ubuntu 14.04 LTS",    # portal
-                     "Ubuntu-14.04-LTS",    # ONOS demo machine
-                     "trusty-server-multi-nic", # CloudLab
-                    ]
-
-    LOOK_FOR_CONTAINER_IMAGES=["docker-vcpe"]
-
-    class Meta:
-        proxy = True
-
-    def __init__(self, *args, **kwargs):
-        super(TenantWithContainer, self).__init__(*args, **kwargs)
-        self.cached_instance=None
-        self.orig_instance_id = self.get_initial_attribute("instance_id")
-
-    @property
-    def instance(self):
-        from core.models import Instance
-        if getattr(self, "cached_instance", None):
-            return self.cached_instance
-        instance_id=self.get_attribute("instance_id")
-        if not instance_id:
-            return None
-        instances=Instance.objects.filter(id=instance_id)
-        if not instances:
-            return None
-        instance=instances[0]
-        instance.caller = self.creator
-        self.cached_instance = instance
-        return instance
-
-    @instance.setter
-    def instance(self, value):
-        if value:
-            value = value.id
-        if (value != self.get_attribute("instance_id", None)):
-            self.cached_instance=None
-        self.set_attribute("instance_id", value)
-
-    @property
-    def external_hostname(self):
-        return self.get_attribute("external_hostname", "")
-
-    @external_hostname.setter
-    def external_hostname(self, value):
-        self.set_attribute("external_hostname", value)
-
-    @property
-    def external_container(self):
-        return self.get_attribute("external_container", "")
-
-    @external_container.setter
-    def external_container(self, value):
-        self.set_attribute("external_container", value)
-
-    @property
-    def creator(self):
-        from core.models import User
-        if getattr(self, "cached_creator", None):
-            return self.cached_creator
-        creator_id=self.get_attribute("creator_id")
-        if not creator_id:
-            return None
-        users=User.objects.filter(id=creator_id)
-        if not users:
-            return None
-        user=users[0]
-        self.cached_creator = users[0]
-        return user
-
-    @creator.setter
-    def creator(self, value):
-        if value:
-            value = value.id
-        if (value != self.get_attribute("creator_id", None)):
-            self.cached_creator=None
-        self.set_attribute("creator_id", value)
-
-    @property
-    def image(self):
-        from core.models import Image
-        # Implement the logic here to pick the image that should be used when
-        # instantiating the VM that will hold the container.
-
-        slice = self.provider_service.slices.all()
-        if not slice:
-            raise XOSProgrammingError("provider service has no slice")
-        slice = slice[0]
-
-        if slice.default_isolation in ["container", "container_vm"]:
-            look_for_images = self.LOOK_FOR_CONTAINER_IMAGES
-        else:
-            look_for_images = self.LOOK_FOR_IMAGES
-
-        for image_name in look_for_images:
-            images = Image.objects.filter(name = image_name)
-            if images:
-                return images[0]
-
-        raise XOSProgrammingError("No VPCE image (looked for %s)" % str(look_for_images))
-
-    def save_instance(self, instance):
-        # Override this function to do custom pre-save or post-save processing,
-        # such as creating ports for containers.
-        instance.save()
-
-    def pick_least_loaded_instance_in_slice(self, slices):
-        for slice in slices:
-            if slice.instances.all().count() > 0:
-                for instance in slice.instances.all():
-                     #Pick the first instance that has lesser than 5 tenants 
-                     if self.count_of_tenants_of_an_instance(instance) < 5:
-                         return instance
-        return None
-
-    #TODO: Ideally the tenant count for an instance should be maintained using a 
-    #many-to-one relationship attribute, however this model being proxy, it does 
-    #not permit any new attributes to be defined. Find if any better solutions 
-    def count_of_tenants_of_an_instance(self, instance):
-        tenant_count = 0
-        for tenant in self.get_tenant_objects().all():
-            if tenant.get_attribute("instance_id", None) == instance.id:
-                tenant_count += 1
-        return tenant_count
-
-    def manage_container(self):
-        from core.models import Instance, Flavor
-
-        if self.deleted:
-            return
-
-        if (self.instance is not None) and (self.instance.image != self.image):
-            self.instance.delete()
-            self.instance = None
-
-        if self.instance is None:
-            if not self.provider_service.slices.count():
-                raise XOSConfigurationError("The service has no slices")
-
-            new_instance_created = False
-            instance = None
-            if self.get_attribute("use_same_instance_for_multiple_tenants", default=False):
-                #Find if any existing instances can be used for this tenant
-                slices = self.provider_service.slices.all()
-                instance = self.pick_least_loaded_instance_in_slice(slices)
-
-            if not instance:
-                flavors = Flavor.objects.filter(name="m1.small")
-                if not flavors:
-                    raise XOSConfigurationError("No m1.small flavor")
-
-                slice = self.provider_service.slices.all()[0]
-
-                if slice.default_isolation == "container_vm":
-                    (node, parent) = ContainerVmScheduler(slice).pick()
-                else:
-                    (node, parent) = LeastLoadedNodeScheduler(slice).pick()
-
-                instance = Instance(slice = slice,
-                                node = node,
-                                image = self.image,
-                                creator = self.creator,
-                                deployment = node.site_deployment.deployment,
-                                flavor = flavors[0],
-                                isolation = slice.default_isolation,
-                                parent = parent)
-                self.save_instance(instance)
-                new_instance_created = True
-
-            try:
-                self.instance = instance
-                super(TenantWithContainer, self).save()
-            except:
-                if new_instance_created:
-                    instance.delete()
-                raise
-
-    def cleanup_container(self):
-        if self.instance:
-            if self.get_attribute("use_same_instance_for_multiple_tenants", default=False):
-                #Delete the instance only if this is last tenant in that instance
-                tenant_count = self.count_of_tenants_of_an_instance(self.instance)
-                if tenant_count == 0:
-                    self.instance.delete()
-            else:
-                self.instance.delete()
-            self.instance = None
-
-    def save(self, *args, **kwargs):
-        if (not self.creator) and (hasattr(self, "caller")) and (self.caller):
-            self.creator = self.caller
-        super(TenantWithContainer, self).save(*args, **kwargs)
-
-class CoarseTenant(Tenant):
-    """ TODO: rename "CoarseTenant" --> "StaticTenant" """
-    class Meta:
-        proxy = True
-
-    KIND = COARSE_KIND
-
-    def save(self, *args, **kwargs):
-        if (not self.subscriber_service):
-            raise XOSValidationError("subscriber_service cannot be null")
-        if (self.subscriber_tenant or self.subscriber_user):
-            raise XOSValidationError("subscriber_tenant and subscriber_user must be null")
-
-        super(CoarseTenant,self).save()
-
-class Subscriber(TenantRoot):
-    """ Intermediate class for TenantRoots that are to be Subscribers """
-
-    class Meta:
-        proxy = True
-
-    KIND = "Subscriber"
-
-class Provider(TenantRoot):
-    """ Intermediate class for TenantRoots that are to be Providers """
-
-    class Meta:
-        proxy = True
-
-    KIND = "Provider"
-
-class TenantAttribute(PlCoreBase):
-    name = models.CharField(help_text="Attribute Name", max_length=128)
-    value = models.TextField(help_text="Attribute Value")
-    tenant = models.ForeignKey(Tenant, related_name='tenantattributes', help_text="The Tenant this attribute is associated with")
-
-class TenantRootRole(PlCoreBase):
-    ROLE_CHOICES = (('admin','Admin'), ('access','Access'))
-
-    role = StrippedCharField(choices=ROLE_CHOICES, unique=True, max_length=30)
-
-    def __unicode__(self):  return u'%s' % (self.role)
-
-class TenantRootPrivilege(PlCoreBase):
-    user = models.ForeignKey('User', related_name="tenant_root_privileges")
-    tenant_root = models.ForeignKey('TenantRoot', related_name="tenant_root_privileges")
-    role = models.ForeignKey('TenantRootRole', related_name="tenant_root_privileges")
-
-    class Meta:
-        unique_together = ('user', 'tenant_root', 'role')
-
-    def __unicode__(self):  return u'%s %s %s' % (self.tenant_root, self.user, self.role)
-
-    def save(self, *args, **kwds):
-        if not self.user.is_active:
-            raise PermissionDenied, "Cannot modify role(s) of a disabled user"
-        super(TenantRootPrivilege, self).save(*args, **kwds)
-
-    def can_update(self, user):
-        return user.can_update_tenant_root_privilege(self)
-
-    @classmethod
-    def select_by_user(cls, user):
-        if user.is_admin:
-            return cls.objects.all()
-        else:
-            # User can see his own privilege
-            trp_ids = [trp.id for trp in cls.objects.filter(user=user)]
-
-            # A slice admin can see the SlicePrivileges for his Slice
-            for priv in cls.objects.filter(user=user, role__role="admin"):
-                trp_ids.extend( [trp.id for trp in cls.objects.filter(tenant_root=priv.tenant_root)] )
-
-            return cls.objects.filter(id__in=trp_ids)
-
-
diff --git a/xos/synchronizers/helloworldservice_complete/helloworldservice_complete_private_key b/xos/synchronizers/helloworldservice_complete/helloworldservice_complete_private_key
deleted file mode 100644
index 427bf89..0000000
--- a/xos/synchronizers/helloworldservice_complete/helloworldservice_complete_private_key
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEowIBAAKCAQEAr7ezZV9wU4O9F/fMOsG9Zm0kIbjLGNsL/MJXuGlqw0SRRbkx
-YipvtP+pJmCzkHmnUFCE1BMVHcnCJRfhcwabF08c+t7H5mj6GPo/QKR7seLr2IKM
-jfG3846u3k2Oo8wNfy8HJ5g+bZFhBk+Z0scYkqQFDL0IW1JtWkl+Yu2VcZsiSJCq
-j+7XjjM1QoiDCyx3p6z/jHi5K1XIFxvQaeBddm3ICau2x6ezd5wnYjPaCANuwisJ
-KgmwSvX/lr8NZkjpETME+ghMPDq7KvXFZL9MCmv8IFe2fKVzIDqHkbgcZ/W0maed
-A/2y9p55B+SQmN3PXW1EhOXHH0SNP31ZS+N5dwIDAQABAoIBAGrudaN5ItgP0WDm
-kUgoYmQUgupqlF2531+fvNYigK/36BfwDRdaD8Sr2HncWynOfn0nos2UF0ObZiRA
-lhfzqynSISahsDCNLbVJhHiIICYum6uUNoii0njLGat6sxUGtifxrH7x7Pusfsji
-ZA+azV9fpRsNZip8zMMm+lyljE4nQbVZv09aExq0Mh2n+mH6OWS43mZ1N7TxWtgd
-MmtoLBAPoMiqXlCxZOcznptVR9hY7CSG0uOQUSui44DOXOyqEI7z57eoYM1hWmng
-Ery07Qr9BbEVl4epLaEyLIGXcUsUbcQz3kbXCg0NbXHiFtr0kdIVwJXHg5M9MAsf
-fDaxJZECgYEA29oLRkI+0L9rSErteaf4spo4FJAARWbsVM3uj1gKEClUUHklI97A
-UVTcOFC7Drr/rwqfHy8fQq9ASIMDnj+FulYQSMna3SLdkgsbNSDuesbG4wp6+chQ
-uSzZP1YtaYrjMxz6s8s/zmFkqAssyOuscsOhgF16945hc63GLro4GwUCgYEAzJv4
-eqWrY6Il7p/Oir4AJxbdfO50Oj1dECsFNZ1KhtA280FslW6Za+oUfD1+Xv13XRZP
-O62IvXXJT67NOq0rKVUixPJJFXQqSRU1QljLgREM6dqr4pS4NirkaPvGwuuej8I4
-dKLqVPcNxDSAXfMwR0KQu7+IVEdvzrw5hrsgg0sCgYB21YUClQwfCViT2uxBtelX
-oMRvWObMnLVhoW4xTQUjdzN7y/+nQ9/wFk5yojB55doOY09fK7lZ8iBtEWQDRZKj
-BaIHthP3M8FQD3DFZueAtbELR77xBLWdYgCLm6kwQ0JLfn6EcHgstbgSnPe4Iqsz
-3UqOd/jflrZWMLfOyhlJgQKBgCGCRa5oZWo6yvWKjHviZAoCz6E/OB+1nwEf2omO
-Sf9MKEOsakkKxOuMeXBjbcfGwP6owa8nW2aT3LVFDm1WoOPzAm+4sklmLeqsI33L
-JwDrNu8xlcbUzlpoqeGbolCX3+7xQuevKqthjoqcgo1gX368IxHsazpKPMBhyRYM
-nWWDAoGBANOG/59508uQqZvWtByA092ARXjEUYLgNTwDo1N4kM5zgV8NETtv7qs/
-P/ze2e88sI230jzbU3iq2OGjk6S1c6LHVG9QohZPwtnwTCeKRhSG+CYHMcXSLK7D
-xf4C0kAbPsaG5F0w3vbGTTF4uuGXyijOQSXMhiG4756VaMEGvb9k
------END RSA PRIVATE KEY-----
diff --git a/xos/synchronizers/helloworldservice_complete/helloworldservice_private_key b/xos/synchronizers/helloworldservice_complete/helloworldservice_private_key
deleted file mode 100644
index 427bf89..0000000
--- a/xos/synchronizers/helloworldservice_complete/helloworldservice_private_key
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEowIBAAKCAQEAr7ezZV9wU4O9F/fMOsG9Zm0kIbjLGNsL/MJXuGlqw0SRRbkx
-YipvtP+pJmCzkHmnUFCE1BMVHcnCJRfhcwabF08c+t7H5mj6GPo/QKR7seLr2IKM
-jfG3846u3k2Oo8wNfy8HJ5g+bZFhBk+Z0scYkqQFDL0IW1JtWkl+Yu2VcZsiSJCq
-j+7XjjM1QoiDCyx3p6z/jHi5K1XIFxvQaeBddm3ICau2x6ezd5wnYjPaCANuwisJ
-KgmwSvX/lr8NZkjpETME+ghMPDq7KvXFZL9MCmv8IFe2fKVzIDqHkbgcZ/W0maed
-A/2y9p55B+SQmN3PXW1EhOXHH0SNP31ZS+N5dwIDAQABAoIBAGrudaN5ItgP0WDm
-kUgoYmQUgupqlF2531+fvNYigK/36BfwDRdaD8Sr2HncWynOfn0nos2UF0ObZiRA
-lhfzqynSISahsDCNLbVJhHiIICYum6uUNoii0njLGat6sxUGtifxrH7x7Pusfsji
-ZA+azV9fpRsNZip8zMMm+lyljE4nQbVZv09aExq0Mh2n+mH6OWS43mZ1N7TxWtgd
-MmtoLBAPoMiqXlCxZOcznptVR9hY7CSG0uOQUSui44DOXOyqEI7z57eoYM1hWmng
-Ery07Qr9BbEVl4epLaEyLIGXcUsUbcQz3kbXCg0NbXHiFtr0kdIVwJXHg5M9MAsf
-fDaxJZECgYEA29oLRkI+0L9rSErteaf4spo4FJAARWbsVM3uj1gKEClUUHklI97A
-UVTcOFC7Drr/rwqfHy8fQq9ASIMDnj+FulYQSMna3SLdkgsbNSDuesbG4wp6+chQ
-uSzZP1YtaYrjMxz6s8s/zmFkqAssyOuscsOhgF16945hc63GLro4GwUCgYEAzJv4
-eqWrY6Il7p/Oir4AJxbdfO50Oj1dECsFNZ1KhtA280FslW6Za+oUfD1+Xv13XRZP
-O62IvXXJT67NOq0rKVUixPJJFXQqSRU1QljLgREM6dqr4pS4NirkaPvGwuuej8I4
-dKLqVPcNxDSAXfMwR0KQu7+IVEdvzrw5hrsgg0sCgYB21YUClQwfCViT2uxBtelX
-oMRvWObMnLVhoW4xTQUjdzN7y/+nQ9/wFk5yojB55doOY09fK7lZ8iBtEWQDRZKj
-BaIHthP3M8FQD3DFZueAtbELR77xBLWdYgCLm6kwQ0JLfn6EcHgstbgSnPe4Iqsz
-3UqOd/jflrZWMLfOyhlJgQKBgCGCRa5oZWo6yvWKjHviZAoCz6E/OB+1nwEf2omO
-Sf9MKEOsakkKxOuMeXBjbcfGwP6owa8nW2aT3LVFDm1WoOPzAm+4sklmLeqsI33L
-JwDrNu8xlcbUzlpoqeGbolCX3+7xQuevKqthjoqcgo1gX368IxHsazpKPMBhyRYM
-nWWDAoGBANOG/59508uQqZvWtByA092ARXjEUYLgNTwDo1N4kM5zgV8NETtv7qs/
-P/ze2e88sI230jzbU3iq2OGjk6S1c6LHVG9QohZPwtnwTCeKRhSG+CYHMcXSLK7D
-xf4C0kAbPsaG5F0w3vbGTTF4uuGXyijOQSXMhiG4756VaMEGvb9k
------END RSA PRIVATE KEY-----
diff --git a/xos/synchronizers/vbbu/steps/sync_vbbu.yaml.old b/xos/synchronizers/vbbu/steps/sync_vbbu.yaml.old
deleted file mode 100644
index 5c46908..0000000
--- a/xos/synchronizers/vbbu/steps/sync_vbbu.yaml.old
+++ /dev/null
@@ -1,23 +0,0 @@
----
-- hosts: {{ instance_name }}
-  gather_facts: False
-  connection: ssh
-  user: ubuntu
-  sudo: yes
-  tasks:
-
-  - name: write message
-    shell: echo "{{ display_message }}" > /var/tmp/index.html
-
-  - name: setup s1u interface config
-    shell: ./start_3gpp_int.sh eth1 {{ s1u_tag }} {{ s1u_ip }}/24 
-
-  - name: setup s1mme interface config
-    shell: ./start_3gpp_int.sh eth2 {{ s1mme_tag }} {{ s1mme_ip }}/24 
-
-  - name: setup rru interface config
-    shell: ./start_3gpp_int.sh eth3 {{ rru_tag }} {{ rru_ip }}/24 
-
-#  - name: startup bbu
-#    shell: /bin/sh -c /usr/sbin/start_bbu 0
-
diff --git a/xos/xos_configuration/xos_common_config b/xos/xos_configuration/xos_common_config
index b4c371d..2855816 100755
--- a/xos/xos_configuration/xos_common_config
+++ b/xos/xos_configuration/xos_common_config
@@ -37,15 +37,9 @@
 images_directory=/opt/xos/images
 dependency_graph=/opt/xos/model-deps
 logfile=/var/log/xos_backend.log
-proxy_ssh=True
-proxy_ssh_key=/root/setup/node_key
-proxy_ssh_user=root
 
 [gui]
 disable_minidashboard=True
 branding_name=Open Cloud
 branding_icon=/static/logo.png
 branding_favicon=/static/favicon.png
-
-[networking]
-use_vtn=True
