diff --git a/xos/tosca/resources/controller.py b/xos/tosca/resources/controller.py
new file mode 100644
index 0000000..d5dc4b7
--- /dev/null
+++ b/xos/tosca/resources/controller.py
@@ -0,0 +1,47 @@
+# note: this module named xossite.py instead of site.py due to conflict with
+#    /usr/lib/python2.7/site.py
+
+import os
+import pdb
+import sys
+import tempfile
+sys.path.append("/opt/tosca")
+from translator.toscalib.tosca_template import ToscaTemplate
+
+from core.models import User,Controller,Deployment
+
+from xosresource import XOSResource
+
+class XOSController(XOSResource):
+    provides = "tosca.nodes.Controller"
+    xos_model = Controller
+
+    def get_xos_args(self):
+        args = {"name": self.nodetemplate.name}
+
+        deployment_name = self.get_requirement("tosca.relationships.ControllerDeployment")
+        if deployment_name:
+            args["deployment"] = self.get_xos_object(Deployment, name=deployment_name)
+
+        return args
+
+    def create(self):
+        xos_args = self.get_xos_args()
+
+        if not xos_args.get("deployment",None):
+            raise Exception("Controller must have a deployment")
+
+        controller = Controller(**xos_args)
+        controller.caller = self.user
+        controller.save()
+
+        self.info("Created Controller '%s'" % (str(controller), ))
+
+    def delete(self, obj):
+        if obj.controllersite.exists():
+            self.info("Controller %s has active sites; skipping delete" % obj.name)
+            return
+        super(XOSController, self).delete(obj)
+
+
+
diff --git a/xos/tosca/resources/deployment.py b/xos/tosca/resources/deployment.py
new file mode 100644
index 0000000..3524ca0
--- /dev/null
+++ b/xos/tosca/resources/deployment.py
@@ -0,0 +1,43 @@
+# note: this module named xossite.py instead of site.py due to conflict with
+#    /usr/lib/python2.7/site.py
+
+import os
+import pdb
+import sys
+import tempfile
+sys.path.append("/opt/tosca")
+from translator.toscalib.tosca_template import ToscaTemplate
+
+from core.models import User,Deployment
+
+from xosresource import XOSResource
+
+class XOSDeployment(XOSResource):
+    provides = "tosca.nodes.Deployment"
+    xos_model = Deployment
+
+    def get_xos_args(self):
+        args = {"name": self.nodetemplate.name}
+
+        return args
+
+    def create(self):
+        xos_args = self.get_xos_args()
+
+        slice = Deployment(**xos_args)
+        slice.caller = self.user
+        slice.save()
+
+        self.info("Created Deployment '%s'" % (str(slice), ))
+
+    def delete(self, obj):
+        if obj.sites.exists():
+            self.info("Deployment %s has active sites; skipping delete" % obj.name)
+            return
+        #if obj.nodes.exists():
+        #    self.info("Deployment %s has active nodes; skipping delete" % obj.name)
+        #    return
+        super(XOSDeployment, self).delete(obj)
+
+
+
diff --git a/xos/tosca/resources/xossite.py b/xos/tosca/resources/xossite.py
new file mode 100644
index 0000000..7ad5cee
--- /dev/null
+++ b/xos/tosca/resources/xossite.py
@@ -0,0 +1,76 @@
+# note: this module named xossite.py instead of site.py due to conflict with
+#    /usr/lib/python2.7/site.py
+
+import os
+import pdb
+import sys
+import tempfile
+sys.path.append("/opt/tosca")
+from translator.toscalib.tosca_template import ToscaTemplate
+
+from core.models import User,Site,Deployment,Controller,SiteDeployment
+
+from xosresource import XOSResource
+
+class XOSSite(XOSResource):
+    provides = "tosca.nodes.Site"
+    xos_model = Site
+
+    def get_xos_args(self):
+        args = {"login_base": self.nodetemplate.name,
+                "name": self.nodetemplate.name}
+
+        #deployment_name = self.get_requirement("tosca.relationships.SiteDeployment")
+        #if deployment_name:
+        #    args["deployment"] = self.get_xos_object(Deployment, name=deployment_name)
+
+        return args
+
+    def postprocess(self, obj):
+        results = []
+        for reqs in self.nodetemplate.requirements:
+            for (k,v) in reqs.items():
+                if (v["relationship"] == "tosca.relationships.SiteDeployment"):
+                    deployment_name = v["node"]
+                    deployment = self.get_xos_object(Deployment, name=deployment_name)
+
+                    controller_name = None
+                    for sd_req in v["requirements"]:
+                        for (sd_req_k, sd_req_v) in sd_req.items():
+                            if sd_req_v["relationship"] == "tosca.relationship.UsesController":
+                                controller_name = sd_req_v["node"]
+                    if not controller_name:
+                        raise Exception("Controller must be specified in SiteDeployment relationship")
+
+                    controller = self.get_xos_object(Controller, name=controller_name)
+
+                    existing_sitedeps = SiteDeployment.objects.filter(deployment=deployment, site=obj)
+                    if existing_sitedeps:
+                        self.info("SiteDeployment from %s to %s already exists" % (str(obj), str(deployment)))
+                    else:
+                        sitedep = SiteDeployment(deployment=deployment, site=obj, controller=controller)
+                        sitedep.save()
+                        self.info("Created SiteDeployment from %s to %s" % (str(obj), str(deployment)))
+
+    def create(self):
+        nodetemplate = self.nodetemplate
+        siteName = nodetemplate.name
+
+        xos_args = self.get_xos_args()
+
+        site = Site(**xos_args)
+        site.caller = self.user
+        site.save()
+
+        self.postprocess(site)
+
+        self.info("Created Site '%s'" % (str(site), ))
+
+    def delete(self, obj):
+        if obj.slices.exists():
+            self.info("Site %s has active slices; skipping delete" % obj.name)
+            return
+        super(XOSSite, self).delete(obj)
+
+
+
