diff --git a/xos/xos_client/xosapi/convenience/vroutertenant.py b/xos/xos_client/xosapi/convenience/vroutertenant.py
new file mode 100644
index 0000000..ef8a1bf
--- /dev/null
+++ b/xos/xos_client/xosapi/convenience/vroutertenant.py
@@ -0,0 +1,63 @@
+import json
+from xosapi.orm import ORMWrapper, register_convenience_wrapper
+
+class ORMWrapperVRouterTenant(ORMWrapper):
+    # hopefully this goes away when VRouterTenant is made a real object
+
+    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)
+
+    @property
+    def address_pool_id(self):
+        return self.get_attribute("address_pool_id", None)
+
+    @property
+    def public_ip(self):
+        return self.get_attribute("public_ip", None)
+
+    @property
+    def public_mac(self):
+        return self.get_attribute("public_mac", None)
+
+    @property
+    def gateway_ip(self):
+        if not self.address_pool:
+            return None
+        return self.address_pool.gateway_ip
+
+    @property
+    def gateway_mac(self):
+        if not self.address_pool:
+            return None
+        return self.address_pool.gateway_mac
+
+    @property
+    def cidr(self):
+        if not self.address_pool:
+            return None
+        return self.address_pool.cidr
+
+    @property
+    def netbits(self):
+        # return number of bits in the network portion of the cidr
+        if self.cidr:
+            parts = self.cidr.split("/")
+            if len(parts) == 2:
+                return int(parts[1].strip())
+        return None
+
+    @property
+    def address_pool(self):
+        if not self.address_pool_id:
+            return None
+        aps = self.stub.AddressPool.objects.filter(id=self.address_pool_id)
+        if not aps:
+            return None
+        ap = aps[0]
+        return ap
+
+register_convenience_wrapper("VRouterTenant", ORMWrapperVRouterTenant)
diff --git a/xos/xos_client/xosapi/convenience/vsgtenant.py b/xos/xos_client/xosapi/convenience/vsgtenant.py
new file mode 100644
index 0000000..aef9295
--- /dev/null
+++ b/xos/xos_client/xosapi/convenience/vsgtenant.py
@@ -0,0 +1,66 @@
+from xosapi.orm import ORMWrapper, register_convenience_wrapper
+
+class ORMWrapperVSGTenant(ORMWrapper):
+    @property
+    def volt(self):
+        if not self.subscriber_tenant:
+            return None
+        # make sure subscriber_tenant is properly subclassed to a volt object
+        volts = self.stub.VOLTTenant.objects.filter(id = self.subscriber_tenant.id)
+        if not volts:
+            return None
+        return volts[0]
+
+    @property
+    def vrouter(self):
+        vrouter_tenants = self.stub.VRouterTenant.objects.filter(subscriber_tenant_id = self.id)
+        if vrouter_tenants:
+            return vrouter_tenants[0]
+        return None
+
+    def get_vrouter_field(self, name, default=None):
+        if self.vrouter:
+            return getattr(self.vrouter, name, default)
+        else:
+            return default
+
+    @property
+    def wan_container_ip(self):
+        return self.get_vrouter_field("public_ip", None)
+
+    @property
+    def wan_container_mac(self):
+        return self.get_vrouter_field("public_mac", None)
+
+    @property
+    def wan_container_netbits(self):
+        return self.get_vrouter_field("netbits", None)
+
+    @property
+    def wan_container_gateway_ip(self):
+        return self.get_vrouter_field("gateway_ip", None)
+
+    @property
+    def wan_container_gateway_mac(self):
+        return self.get_vrouter_field("gateway_mac", None)
+
+    @property
+    def wan_vm_ip(self):
+        tags = self.stub.Tag.objects.filter(name="vm_vrouter_tenant", object_id=self.instance.id, content_type_id=self.instance.self_content_type_id)
+        if tags:
+            tenant = self.stub.VRouterTenant.objects.get(id=int(tags[0].value))
+            return tenant.public_ip
+        else:
+            raise Exception("no vm_vrouter_tenant tag for instance %s" % self.instance)
+
+    @property
+    def wan_vm_mac(self):
+        tags = self.stub.Tag.objects.filter(name="vm_vrouter_tenant", object_id=self.instance.id, content_type_id=self.instance.self_content_type_id)
+        if tags:
+            tenant = self.stub.VRouterTenant.objects.get(id=int(tags[0].value))
+            return tenant.public_mac
+        else:
+            raise Exception("no vm_vrouter_tenant tag for instance %s" % self.instance)
+
+
+register_convenience_wrapper("VSGTenant", ORMWrapperVSGTenant)
diff --git a/xos/xos_client/xosapi/orm.py b/xos/xos_client/xosapi/orm.py
index dc84c96..bf59222 100644
--- a/xos/xos_client/xosapi/orm.py
+++ b/xos/xos_client/xosapi/orm.py
@@ -425,4 +425,6 @@
 import convenience.instance
 import convenience.cordsubscriberroot
 import convenience.volttenant
+import convenience.vsgtenant
+import convenience.vroutertenant
 
