diff --git a/xos/tosca/resources/vhsstenant.py b/xos/tosca/resources/vhsstenant.py
index 074c423..2d572c0 100644
--- a/xos/tosca/resources/vhsstenant.py
+++ b/xos/tosca/resources/vhsstenant.py
@@ -13,29 +13,34 @@
 # limitations under the License.
 
 from xosresource import XOSResource
-from core.models import Tenant, Service
+from core.models import ServiceInstance, Service
 from services.vhss.models import VHSSTenant
 
 class XOSVHSSTenant(XOSResource):
     provides = "tosca.nodes.VHSSTenant"
     xos_model = VHSSTenant
-    name_field = "service_specific_id"
+    name_field = None
     copyin_props = ()
 
     def get_xos_args(self, throw_exception=True):
         args = super(XOSVHSSTenant, self).get_xos_args()
 
-        provider_name = self.get_requirement("tosca.relationships.TenantOfService", throw_exception=True)
+        provider_name = self.get_requirement("tosca.relationships.TenantOfService", throw_exception=throw_exception)
         if provider_name:
-            args["provider_service"] = self.get_xos_object(Service, throw_exception=True, name=provider_name)
+            args["owner"] = self.get_xos_object(Service, throw_exception=throw_exception, name=provider_name)
 
         return args
 
     def get_existing_objs(self):
         args = self.get_xos_args(throw_exception=False)
-        return VHSSTenant.get_tenant_objects().filter(provider_service=args["provider_service"], service_specific_id=args["service_specific_id"])
+        owner = args.get("provider", None)
+        if owner:
+            return [ self.get_xos_object(owner=owner) ]
         return []
 
+    def postprocess(self, obj):
+        pass
+
     def can_delete(self, obj):
         return super(XOSVHSSTenant, self).can_delete(obj)
 
