diff --git a/xos/cord/models.py b/xos/cord/models.py
index 639c66f..926a42d 100644
--- a/xos/cord/models.py
+++ b/xos/cord/models.py
@@ -17,12 +17,16 @@
 from hpc.models import *
 from cord.models import *
 django.setup()
-svc = Service.objects.get(name="VCPE")
+svc = VOLTService.get_service_objects().all()[0]
 
-t = VCPETenant(provider_service=svc)
+t = VOLTTenant(provider_service=svc)
 t.caller = User.objects.all()[0]
 t.save()
 
+for v in VOLTTenant.objects.all():
+    v.caller = User.objects.all()[0]
+    v.delete()
+
 for v in VCPETenant.objects.all():
     v.caller = User.objects.all()[0]
     v.delete()
@@ -31,15 +35,97 @@
 class ConfigurationError(Exception):
     pass
 
-class VCPEService(Service):
+# -------------------------------------------
+# VOLT
+# -------------------------------------------
+
+class VOLTService(Service):
+    KIND = "vOLT"
+
     class Meta:
-        app_label = "vCPE"
+        app_label = "cord"
+        verbose_name = "vOLT Service"
+        proxy = True
+
+class VOLTTenant(Tenant):
+    class Meta:
+        proxy = True
+
+    KIND = "vOLT"
+
+    @property
+    def vcpe(self):
+        vcpe_id=self.get_attribute("vcpe_id")
+        if not vcpe_id:
+            return None
+        vcpes=VCPETenant.objects.filter(id=vcpe_id)
+        if not vcpes:
+            return None
+        return vcpes[0]
+
+    @vcpe.setter
+    def vcpe(self, value):
+        if value:
+            self.set_attribute("vcpe_id", value.id)
+        else:
+            self.set_attribute("vcpe_id", None)
+
+    def manage_vcpe(self):
+        # Each VOLT object owns exactly one VCPE object
+
+        if self.deleted:
+            return
+
+        if self.vcpe is None:
+            vcpeServices = VCPEService.get_service_objects().all()
+            if not vcpeServices:
+                raise ConfigurationError("No VCPE Services available")
+
+            vcpe = VCPETenant(provider_service = vcpeServices[0],
+                              subscriber_tenant = self)
+            vcpe.caller = self.caller
+            vcpe.save()
+
+            try:
+                self.vcpe = vcpe
+                self.save()
+            except:
+                vcpe.delete()
+                raise
+
+    def cleanup_vcpe(self):
+        if self.vcpe:
+            self.vcpe.delete()
+            self.vcpe = None
+
+    def save(self, *args, **kwargs):
+        if not getattr(self, "caller", None):
+            raise TypeError("VOLTTenant's self.caller was not set")
+        super(VOLTTenant, self).save(*args, **kwargs)
+        self.manage_vcpe()
+
+    def delete(self, *args, **kwargs):
+        self.cleanup_vcpe()
+        super(VOLTTenant, self).delete(*args, **kwargs)
+
+# -------------------------------------------
+# VCPE
+# -------------------------------------------
+
+class VCPEService(Service):
+    KIND = "vCPE"
+
+    class Meta:
+        app_label = "cord"
         verbose_name = "vCPE Service"
+        proxy = True
 
 class VCPETenant(Tenant):
     class Meta:
         proxy = True
 
+    KIND = "vCPE"
+
     default_attributes = {"firewall_enable": False,
                           "sliver_id": None}
 
@@ -82,10 +168,11 @@
         return nodes[0]
 
     def manage_sliver(self):
+        # Each VCPE object owns exactly one sliver.
+
         if self.deleted:
             return
 
-        # TODO: This could be a model_policy...
         if (self.sliver is not None) and (self.sliver.image != self.image):
             self.sliver.delete()
             self.sliver = None
@@ -101,7 +188,12 @@
                             deployment = node.site_deployment.deployment)
             sliver.save()
 
-            self.sliver = sliver
+            try:
+                self.sliver = sliver
+                self.save()
+            except:
+                sliver.delete()
+                raise
 
     def cleanup_sliver(self):
         if self.sliver:
@@ -111,8 +203,8 @@
     def save(self, *args, **kwargs):
         if not getattr(self, "caller", None):
             raise TypeError("VCPETenant's self.caller was not set")
-        self.manage_sliver()
         super(VCPETenant, self).save(*args, **kwargs)
+        self.manage_sliver()
 
     def delete(self, *args, **kwargs):
         self.cleanup_sliver()
