Merge branch 'master' of github.com:open-cloud/xos
diff --git a/containers/observer/Dockerfile b/containers/observer/Dockerfile
new file mode 100644
index 0000000..7ec6592
--- /dev/null
+++ b/containers/observer/Dockerfile
@@ -0,0 +1,44 @@
+FROM       xos
+
+# Install custom Ansible
+RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
+    openssh-client \
+    python-crypto \
+    python-jinja2 \
+    python-paramiko \
+    python-yaml \
+    python-httplib2 \
+    supervisor
+
+RUN \
+    git clone -b release1.8.2 git://github.com/ansible/ansible.git /opt/ansible && \
+    git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/lib/ansible/modules/extras && \
+    git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/v2/ansible/modules/extras && \
+    git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/lib/ansible/modules/core && \
+    git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/v2/ansible/modules/core && \
+    # git clone uses cached copy, doesn't pick up latest
+    git -C /opt/ansible pull && \
+    git -C /opt/ansible/lib/ansible/modules/core pull && \
+    git -C /opt/ansible/v2/ansible/modules/core pull
+
+
+# For Observer
+RUN mkdir -p /usr/local/share /bin /etc/ansible
+
+RUN cp /tmp/xos/containers/observer/conf/ansible-hosts /etc/ansible/hosts
+
+ADD http://phantomjs.googlecode.com/files/phantomjs-1.7.0-linux-x86_64.tar.bz2 /usr/local/share/
+
+RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum && \
+    cd /tmp/fofum; python setup.py install && \
+    rm -rf /tmp/fofum && \
+    tar jxvf /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 -C /usr/local/share/ && \
+    rm -f /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 && \
+    ln -s /usr/local/share/phantomjs-1.7.0-linux-x86_64 /usr/local/share/phantomjs && \
+    ln -s /usr/local/share/phantomjs/bin/phantomjs /bin/phantomjs
+
+
+# Supervisor
+RUN cp /tmp/xos/containers/observer/conf/observer.conf /etc/supervisor/conf.d/
+
+CMD /usr/bin/supervisord -c /etc/supervisor/conf.d/observer.conf
diff --git a/containers/observer/Makefile b/containers/observer/Makefile
new file mode 100644
index 0000000..e7fedf5
--- /dev/null
+++ b/containers/observer/Makefile
@@ -0,0 +1,13 @@
+CONTAINER_NAME:=observer-server
+
+.PHONY: build
+build: ; docker build --rm -t observer .
+
+.PHONY: run
+run: ; docker run -d --name ${CONTAINER_NAME} observer
+
+.PHONY: stop
+stop: ; docker stop ${CONTAINER_NAME}
+
+.PHONY: rm
+rm: ; docker rm ${CONTAINER_NAME}
diff --git a/xos/configurations/opencloud/ansible-hosts b/containers/observer/conf/ansible-hosts
similarity index 100%
rename from xos/configurations/opencloud/ansible-hosts
rename to containers/observer/conf/ansible-hosts
diff --git a/containers/observer/conf/observer.conf b/containers/observer/conf/observer.conf
new file mode 100644
index 0000000..48f61dd
--- /dev/null
+++ b/containers/observer/conf/observer.conf
@@ -0,0 +1,9 @@
+[supervisord]
+logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log)
+pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
+nodaemon=true
+
+[program:observer]
+command=python /opt/xos/xos-observer.py
+stderr_logfile=/var/log/supervisor/observer.err.log
+stdout_logfile=/var/log/supervisor/observer.out.log
diff --git a/containers/postgresql/Dockerfile b/containers/postgresql/Dockerfile
index bd9943a..4d4ebfd 100644
--- a/containers/postgresql/Dockerfile
+++ b/containers/postgresql/Dockerfile
@@ -18,10 +18,12 @@
 USER postgres
 
 RUN /etc/init.d/postgresql start && \
-    psql --command "ALTER USER postgres WITH SUPERUSER PASSWORD 'password';"
+    psql --command "ALTER USER postgres WITH SUPERUSER PASSWORD 'password' " && \
+    psql --command "CREATE DATABASE xos"
 
 # Allow remote connections. 
 RUN echo "host all  all    0.0.0.0/0  md5" >> /etc/postgresql/9.3/main/pg_hba.conf
+RUN echo "host all  all    0.0.0.0/0  password" >> /etc/postgresql/9.3/main/pg_hba.conf
 
 RUN echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf
 
diff --git a/containers/postgresql/Makefile b/containers/postgresql/Makefile
index f26c78a..327f661 100644
--- a/containers/postgresql/Makefile
+++ b/containers/postgresql/Makefile
@@ -2,7 +2,7 @@
 build: ; docker build --rm -t postgres .
 
 .PHONY: run
-run: ; docker run --rm -p 5432:5432 --name postgres-server postgres
+run: ; docker run -d -p 5432:5432 --name postgres-server postgres
 
 .PHONY: stop
 stop: ; docker stop postgres-server
diff --git a/containers/xos/Dockerfile b/containers/xos/Dockerfile
index 70b334e..37bd55b 100644
--- a/containers/xos/Dockerfile
+++ b/containers/xos/Dockerfile
@@ -1,6 +1,14 @@
-FROM ubuntu
+FROM       ubuntu:14.04.3
 
-RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --force-yes \
+# XXX Workaround for docker bug:
+# https://github.com/docker/docker/issues/6345
+# Kernel 3.15 breaks docker, uss the line below as a workaround
+# until there is a fix
+RUN ln -s -f /bin/true /usr/bin/chfn
+# XXX End workaround
+
+# Install.
+RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
     curl \
     gcc \
     geoip-database \
@@ -11,28 +19,70 @@
     libxslt1.1 \
     libxslt1-dev \
     libyaml-dev \
+    m4 \
     pkg-config \
     python-dev \
     python-httplib2 \
     python-pip \
     python-psycopg2 \
     python-pycurl \
+    python-setuptools \
     tar \
-    wget
+    wget \
+##### observer dependencies  
+    python-keystoneclient \
+    python-novaclient \
+    python-neutronclient \
+    python-glanceclient \
+    python-ceilometerclient
 
-RUN pip install \
-    lxml \
+RUN pip install -U \
+    django==1.7 \
+    django-bitfield \
+    django-crispy-forms \
+    django-encrypted-fields \
+    django_evolution \
+    django-extensions \
+    django-filter \
+    django-geoposition \
+    django-ipware \
+    django_rest_swagger \
+    django-suit \
+    django-timezones \
+    djangorestframework==2.4.4 \
+    dnslib \
+    google_api_python_client \
+    httplib2 \
+    httplib2.ca_certs_locater \
+    lxml \  
+    markdown \
     netaddr \
-    pytz \
-    requests \
+    python-dateutil \
+    python_gflags \
     python-keyczar \
     pygraphviz \
-    dnslib
+    pytz \
+    pyyaml \
+    requests
 
-RUN easy_install \
-    python_gflags \
-    google_api_python_client \
-    httplib2.ca_certs_locater
+ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
 
-RUN easy_install --upgrade httplib2
+# Install XOS
+RUN git clone git://github.com/open-cloud/xos.git /tmp/xos && \
+    mv /tmp/xos/xos /opt/ && \
+    chmod +x /opt/xos/scripts/opencloud && \
+    /opt/xos/scripts/opencloud genkeys
 
+# install Tosca engine
+RUN bash /opt/xos/tosca/install_tosca.sh
+
+EXPOSE 8000
+
+# Set environment variables.
+ENV HOME /root
+
+# Define working directory.
+WORKDIR /root
+
+# Define default command.
+CMD python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure
diff --git a/containers/xos/Makefile b/containers/xos/Makefile
index 7731152..c71873e 100644
--- a/containers/xos/Makefile
+++ b/containers/xos/Makefile
@@ -1,5 +1,17 @@
-.PHONY: build
-build: ; docker build --rm -t xos/python_common .
+CONTAINER_NAME:=xos-server
+TOSCA_CONFIG_PATH:=/opt/xos/configurations/opencloud/opencloud.yaml
 
-.PHONY: rmi
-rm: ; docker rmi xos/python_common
+.PHONY: build
+build: ; docker build --rm -t xos . && ./initdb
+
+.PHONY: run
+run: ; docker run -d --name ${CONTAINER_NAME} -p 80:8000 xos
+
+.PHONY: runtosca
+runtosca: ; docker exec -it ${CONTAINER_NAME} /usr/bin/python /opt/xos/tosca/run.py padmin@vicci.org ${TOSCA_CONFIG_PATH}
+
+.PHONY: stop
+stop: ; docker stop ${CONTAINER_NAME}
+
+.PHONY: rm
+rm: ; docker rm ${CONTAINER_NAME}
diff --git a/containers/xos/initdb b/containers/xos/initdb
new file mode 100755
index 0000000..bd020c5
--- /dev/null
+++ b/containers/xos/initdb
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+IMAGE_NAME=xos
+DB_HOST=$(wget http://ipinfo.io/ip -qO -)
+
+# configure db host
+docker run -it $IMAGE_NAME sed -i '0,/host/{s/host=localhost/host='$DB_HOST'/}' /opt/xos/xos_config
+CONTAINER_ID=$(docker ps -a | grep $IMAGE_NAME | head -1 |  awk '{print $1}')
+echo $CONTAINER_ID $IMAGE_NAME
+docker commit $CONTAINER_ID $IMAGE_NAME
+
+# init db schema
+docker run -it $IMAGE_NAME /opt/xos/scripts/opencloud makemigrations
+CONTAINER_ID=$(docker ps -a | grep $IMAGE_NAME | head -1 | awk '{print $1}')
+# run overrides the CMD specifed in the Dockerfile, so we re-set the CMD in the final commit"
+docker commit --change "CMD python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure" $CONTAINER_ID $IMAGE_NAME
diff --git a/xos/configurations/opencloud/Dockerfile b/xos/configurations/opencloud/Dockerfile
deleted file mode 100644
index 3f8fc9d..0000000
--- a/xos/configurations/opencloud/Dockerfile
+++ /dev/null
@@ -1,144 +0,0 @@
-FROM       ubuntu:14.04.3
-MAINTAINER Andy Bavier <acb@cs.princeton.edu>
-
-# XXX Workaround for docker bug:
-# https://github.com/docker/docker/issues/6345
-# Kernel 3.15 breaks docker, uss the line below as a workaround
-# until there is a fix
-RUN ln -s -f /bin/true /usr/bin/chfn
-# XXX End workaround
-
-# Install.
-RUN apt-get update && apt-get install -y \
-    git \
-    postgresql \
-    python-psycopg2 \
-    graphviz \
-    graphviz-dev \
-    libxslt1.1 \
-    libxslt1-dev \
-    python-pip \
-    tar \
-    gcc \
-    python-httplib2 \
-    geoip-database \
-    libgeoip1 \
-    wget \
-    curl \
-    python-dev \
-    libyaml-dev \
-    pkg-config \
-    python-pycurl
-
-RUN pip install django==1.7
-RUN pip install djangorestframework==2.4.4
-RUN pip install markdown  # Markdown support for the browseable API.
-RUN pip install pyyaml    # YAML content-type support.
-RUN pip install django-filter  # Filtering support
-RUN pip install lxml  # XML manipulation library
-RUN pip install netaddr # IP Addr library
-RUN pip install pytz
-RUN pip install django-timezones
-RUN pip install requests
-RUN pip install django-crispy-forms
-RUN pip install django-geoposition
-RUN pip install django-extensions
-RUN pip install django-suit
-RUN pip install django-bitfield
-RUN pip install django-ipware
-RUN pip install django-encrypted-fields
-RUN pip install python-keyczar
-RUN pip install pygraphviz
-RUN pip install dnslib
-
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-keystoneclient
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-novaclient
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-neutronclient
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-glanceclient
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-ceilometerclient
-
-RUN pip install django_rest_swagger
-
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-setuptools
-RUN easy_install django_evolution
-RUN easy_install python_gflags
-RUN easy_install --upgrade httplib2
-RUN easy_install google_api_python_client
-RUN easy_install httplib2.ca_certs_locater
-
-# Install custom Ansible
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-crypto
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-yaml
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-client
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-paramiko
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-jinja2
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-httplib2
-RUN git clone -b release1.8.2 git://github.com/ansible/ansible.git /opt/ansible
-RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/lib/ansible/modules/extras
-RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/v2/ansible/modules/extras
-RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/lib/ansible/modules/core
-RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/v2/ansible/modules/core
-ADD ansible-hosts /etc/ansible/hosts
-
-ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
-
-# For Observer
-RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum
-RUN cd /tmp/fofum; python setup.py install
-RUN rm -rf /tmp/fofum
-
-RUN mkdir -p /usr/local/share /bin
-ADD http://phantomjs.googlecode.com/files/phantomjs-1.7.0-linux-x86_64.tar.bz2 /usr/local/share/
-RUN tar jxvf /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 -C /usr/local/share/
-RUN rm -f /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2
-RUN ln -s /usr/local/share/phantomjs-1.7.0-linux-x86_64 /usr/local/share/phantomjs
-RUN ln -s /usr/local/share/phantomjs/bin/phantomjs /bin/phantomjs
-
-# Get XOS
-RUN git clone git://github.com/open-cloud/xos.git /tmp/xos && mv /tmp/xos/xos /opt/
-
-# Supervisor
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y supervisor
-RUN cp /tmp/xos/observer.conf /etc/supervisor/conf.d/
-
-# Initscript is broken in Ubuntu
-#ADD observer-initscript /etc/init.d/xosobserver
-
-RUN chmod +x /opt/xos/scripts/opencloud
-RUN chmod +x /opt/xos/configurations/opencloud/run_opencloud
-RUN /opt/xos/scripts/opencloud genkeys
-
-# Workaround for AUFS issue
-# https://github.com/docker/docker/issues/783#issuecomment-56013588
-RUN mkdir /etc/ssl/private-copy; mv /etc/ssl/private/* /etc/ssl/private-copy/; rm -r /etc/ssl/private; mv /etc/ssl/private-copy /etc/ssl/private; chmod -R 0700 /etc/ssl/private; chown -R postgres /etc/ssl/private
-
-# Set postgres password to match default value in settings.py
-RUN service postgresql start; sudo -u postgres psql -c "alter user postgres with password 'password';"
-
-# Turn DEBUG on so that devel server will serve static files
-#    (not necessary if --insecure is passed to 'manage.py runserver')
-# RUN sed -i 's/DEBUG = False/DEBUG = True/' /opt/xos/xos/settings.py
-
-# Cruft to workaround problems with migrations, should go away...
-RUN /opt/xos/scripts/opencloud remigrate
-
-# git clone uses cached copy, doesn't pick up latest
-RUN git -C /opt/ansible pull
-RUN git -C /opt/ansible/lib/ansible/modules/core pull
-RUN git -C /opt/ansible/v2/ansible/modules/core pull
-
-# install Tosca engine
-RUN apt-get install -y m4
-RUN pip install python-dateutil
-RUN bash /opt/xos/tosca/install_tosca.sh
-
-EXPOSE 8000
-
-# Set environment variables.
-ENV HOME /root
-
-# Define working directory.
-WORKDIR /root
-
-# Define default command.
-CMD /opt/xos/configurations/opencloud/run_opencloud
diff --git a/xos/configurations/opencloud/Dockerfile.alpha b/xos/configurations/opencloud/Dockerfile.alpha
deleted file mode 100644
index dc4c927..0000000
--- a/xos/configurations/opencloud/Dockerfile.alpha
+++ /dev/null
@@ -1,143 +0,0 @@
-FROM       ubuntu:14.04.3
-MAINTAINER Andy Bavier <acb@cs.princeton.edu>
-
-# Set environment variables.
-ENV HOME /root
-
-# XXX Workaround for docker bug:
-# https://github.com/docker/docker/issues/6345
-# Kernel 3.15 breaks docker, uss the line below as a workaround
-# until there is a fix
-RUN ln -s -f /bin/true /usr/bin/chfn
-# XXX End workaround
-
-# Install.
-RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
-    curl \
-    git \
-    geoip-database \
-    graphviz \
-    graphviz-dev \
-    libgeoip1 \
-    libxslt1.1 \
-    libxslt1-dev \
-    libyaml-dev \
-    m4 \
-    nginx \
-    openssh-client \
-    python-dev \
-    pkg-config \
-    postgresql \
-    python-crypto \
-    python-httplib2>=0.9.1 \
-    python-jinja2 \
-    python-paramiko \
-    python-pip \
-    python-psycopg2 \
-    python-pycurl \
-    python-setuptools \
-    python-yaml \
-    python-keystoneclient \
-    python-novaclient \
-    python-neutronclient \
-    python-glanceclient \
-    python-ceilometerclient \
-    supervisor \
-    tar \
-    wget 
-
-RUN pip install \
-    django==1.7 \
-    djangorestframework==2.4.4 \
-    markdown  \ 
-    pyyaml \ 
-    django-filter \
-    lxml \
-    netaddr \
-    pytz \
-    django-timezones \
-    requests \
-    django-crispy-forms \
-    django-geoposition \
-    django-extensions \
-    django-suit \
-    django-bitfield \
-    django-ipware \
-    django-encrypted-fields \
-    django_rest_swagger \
-    python-dateutil \
-    python-keyczar \
-    pygraphviz \
-    dnslib \
-    uwsgi
-
-RUN easy_install --upgrade httplib2
-
-RUN easy_install \
-    django_evolution \
-    python_gflags \
-    google_api_python_client \
-    httplib2.ca_certs_locater
-
-
-# Install custom Ansible
-RUN git clone -b release1.8.2 git://github.com/ansible/ansible.git /opt/ansible
-RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/lib/ansible/modules/extras
-RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/v2/ansible/modules/extras
-RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/lib/ansible/modules/core
-RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/v2/ansible/modules/core
-# git clone uses cached copy, doesn't pick up latest
-RUN git -C /opt/ansible pull
-RUN git -C /opt/ansible/lib/ansible/modules/core pull
-RUN git -C /opt/ansible/v2/ansible/modules/core pull
-ADD ansible-hosts /etc/ansible/hosts
-
-
-# For Observer
-ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
-RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum
-RUN cd /tmp/fofum; python setup.py install
-RUN rm -rf /tmp/fofum
-
-RUN mkdir -p /usr/local/share /bin
-ADD http://phantomjs.googlecode.com/files/phantomjs-1.7.0-linux-x86_64.tar.bz2 /usr/local/share/
-RUN tar jxvf /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 -C /usr/local/share/
-RUN rm -f /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2
-RUN ln -s /usr/local/share/phantomjs-1.7.0-linux-x86_64 /usr/local/share/phantomjs
-RUN ln -s /usr/local/share/phantomjs/bin/phantomjs /bin/phantomjs
-
-# Get XOS
-RUN git clone git://github.com/open-cloud/xos.git /tmp/xos && mv /tmp/xos/xos /opt/
-
-RUN chmod +x /opt/xos/scripts/opencloud
-
-RUN /opt/xos/scripts/opencloud genkeys
-
-# Workaround for AUFS issue
-# https://github.com/docker/docker/issues/783#issuecomment-56013588
-RUN mkdir /etc/ssl/private-copy; mv /etc/ssl/private/* /etc/ssl/private-copy/; rm -r /etc/ssl/private; mv /etc/ssl/private-copy /etc/ssl/private; chmod -R 0700 /etc/ssl/private; chown -R postgres /etc/ssl/private
-
-# Set postgres password to match default value in settings.py
-RUN service postgresql start && sudo -u postgres psql -c "alter user postgres with password 'password';"
-
-# Turn DEBUG on so that devel server will serve static files
-#    (not necessary if --insecure is passed to 'manage.py runserver')
-# RUN sed -i 's/DEBUG = False/DEBUG = True/' /opt/xos/xos/settings.py
-
-# Cruft to workaround problems with migrations, should go away...
-RUN /opt/xos/scripts/opencloud remigrate
-
-
-# install Tosca engine
-RUN bash /opt/xos/tosca/install_tosca.sh
-
-# configure nginx
-RUN cp /opt/xos/nginx/xos.conf /etc/nginx/sites-enabled/default
-
-# Supervisor configuration
-RUN cp /opt/xos/configurations/opencloud/supervisord.conf  /etc/supervisor/conf.d/xos-all.conf
-
-EXPOSE 8000
-
-# Define default command.
-CMD /usr/bin/supervisord -c /etc/supervisor/conf.d/xos-all.conf
diff --git a/xos/configurations/opencloud/Makefile b/xos/configurations/opencloud/Makefile
deleted file mode 100644
index d7708b3..0000000
--- a/xos/configurations/opencloud/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-CONTAINER_NAME:=opencloud-server
-TOSCA_CONFIG_PATH:=/opt/xos/configurations/opencloud/opencloud.yaml
-
-.PHONY: build
-build: ; docker build --rm -t opencloud .
-
-.PHONY: run
-run: ; docker run --rm  --name ${CONTAINER_NAME} -p 80:8000 opencloud
-
-.PHONY: runtosca
-runtosca: ; docker exec -it ${CONTAINER_NAME} /usr/bin/python /opt/xos/tosca/run.py padmin@vicci.org ${TOSCA_CONFIG_PATH}
-
-.PHONY: stop
-stop: ; docker stop ${CONTAINER_NAME}
-
-.PHONY: rmcontainer
-rmcontainer: ; docker rm ${CONTAINER_NAME}
diff --git a/xos/configurations/opencloud/observer.conf b/xos/configurations/opencloud/observer.conf
deleted file mode 100644
index 92545eb..0000000
--- a/xos/configurations/opencloud/observer.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-[program:observer]
-command=python /opt/xos/xos-observer.py
diff --git a/xos/configurations/opencloud/run_opencloud b/xos/configurations/opencloud/run_opencloud
deleted file mode 100644
index f37e8c3..0000000
--- a/xos/configurations/opencloud/run_opencloud
+++ /dev/null
@@ -1,17 +0,0 @@
-#! /bin/bash
-
-function wait_postgres {
-    sudo -u postgres psql -c '\q'
-    while [[ "$?" != "0" ]]; do
-        echo Waiting for postgres to start
-        sleep 1
-        sudo -u postgres psql -c '\q'
-    done
-}
-
-cd /tmp
-service postgresql start
-wait_postgres
-service supervisor start
-cd /opt/xos
-python manage.py runserver 0.0.0.0:8000 --insecure
diff --git a/xos/configurations/opencloud/supervisord.conf b/xos/configurations/opencloud/supervisord.conf
deleted file mode 100644
index 98b4a0a..0000000
--- a/xos/configurations/opencloud/supervisord.conf
+++ /dev/null
@@ -1,27 +0,0 @@
-[supervisord]
-nodaemon=true
-logfile=/var/log/supervisord.log
-
-[program:postgresql]
-autorestart=true
-command=/usr/lib/postgresql/9.3/bin/postgres -D /var/lib/postgresql/9.3/main -c config_file=/etc/postgresql/9.3/main/postgresql.conf
-stderr_logfile=/var/log/supervisor/postgresql.err.log
-stdout_logfile=/var/log/supervisor/postgresql.out.log
-
-[program:observer]
-autorestart=true
-command=python /opt/xos/xos-observer.py
-stderr_logfile=/var/log/supervisor/observer.err.log
-stdout_logfile=/var/log/supervisor/observer.out.log
-
-program:uwsgi]
-autorestart=true
-command=uwsgi --ini /opt/xos/uwsgi/xos.ini
-stderr_logfile=/var/log/supervisor/uwsgi.err.log
-stdout_logfile=/var/log/supervisor/uwsgi.out.log
-
-[program:nginx]
-command=/usr/sbin/nginx
-autorestart=true
-stderr_logfile=/var/log/supervisor/nginx.err.log
-stdout_logfile=/var/log/supervisor/nginx.out.log
diff --git a/xos/scripts/opencloud b/xos/scripts/opencloud
index b936ce3..189a673 100755
--- a/xos/scripts/opencloud
+++ b/xos/scripts/opencloud
@@ -136,11 +136,8 @@
     fi
 }
 
-function remigrate {
-    if db_exists; then
-        dropdb
-    fi
-    rm -rf /opt/xos/*/migrations
+function makemigrations {
+    rm -rf /opt/xos/*/migrations /opt/xos/services/*/migrations
     python ./manage.py makemigrations core
     python ./manage.py makemigrations hpc
     python ./manage.py makemigrations requestrouter
@@ -151,6 +148,13 @@
     #python ./manage.py makemigrations servcomp
 }
 
+function remigrate {
+    if db_exists; then
+        dropdb
+    fi
+    makemigrations
+}
+
 COMMAND=$1
 
 if [ "$COMMAND" = "initdb" ]; then
@@ -226,3 +230,7 @@
    createdb
    syncdb
 fi
+if [ "$COMMAND" = "makemigrations" ]; then
+   makemigrations
+   syncdb
+fi
diff --git a/xos/tosca/custom_types/xos.m4 b/xos/tosca/custom_types/xos.m4
index a661af7..88d8f5f 100644
--- a/xos/tosca/custom_types/xos.m4
+++ b/xos/tosca/custom_types/xos.m4
@@ -136,6 +136,9 @@
             dependencies:
                 type: string
                 required: false
+            config_network-cfg.json:
+                type: string
+                required: false
 
     tosca.nodes.VCPEService:
         description: >
diff --git a/xos/tosca/custom_types/xos.yaml b/xos/tosca/custom_types/xos.yaml
index 9170ecf..4352ef5 100644
--- a/xos/tosca/custom_types/xos.yaml
+++ b/xos/tosca/custom_types/xos.yaml
@@ -154,6 +154,9 @@
             dependencies:
                 type: string
                 required: false
+            config_network-cfg.json:
+                type: string
+                required: false
 
     tosca.nodes.VCPEService:
         description: >