diff --git a/xos/synchronizer/models/convenience/vrouterapp.py b/xos/synchronizer/models/convenience/vrouterapp.py
new file mode 100644
index 0000000..3dafde2
--- /dev/null
+++ b/xos/synchronizer/models/convenience/vrouterapp.py
@@ -0,0 +1,33 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import json
+from xosapi.orm import ORMWrapper, register_convenience_wrapper
+
+class ORMWrapperVRouterApp(ORMWrapper):
+    @property
+    def interfaces(self):
+        app_interfaces = []
+        devices = self.stub.VRouterDevice.objects.filter(vrouter_service_id=self.vrouter_service.id)
+        for device in devices:
+            ports = self.stub.VRouterPort.objects.filter(vrouter_device_id=device.id)
+            for port in ports:
+                interfaces = self.stub.VRouterInterface.objects.filter(vrouter_port_id=port.id)
+                for iface in interfaces:
+                    app_interfaces.append(iface.name)
+        return app_interfaces
+
+register_convenience_wrapper("VRouterApp", ORMWrapperVRouterApp)
diff --git a/xos/synchronizer/models/convenience/vrouterservice.py b/xos/synchronizer/models/convenience/vrouterservice.py
new file mode 100644
index 0000000..28f1421
--- /dev/null
+++ b/xos/synchronizer/models/convenience/vrouterservice.py
@@ -0,0 +1,31 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import json
+from xosapi.orm import ORMWrapper, register_convenience_wrapper
+from xosapi.convenience.service import ORMWrapperService
+
+class ORMWrapperVRouterService(ORMWrapperService):
+    def get_gateways(self):
+        gateways = []
+
+        aps = self.addresspools.all()
+        for ap in aps:
+            gateways.append({"gateway_ip": ap.gateway_ip, "gateway_mac": ap.gateway_mac})
+
+        return gateways
+
+register_convenience_wrapper("VRouterService", ORMWrapperVRouterService)
diff --git a/xos/synchronizer/models/convenience/vroutertenant.py b/xos/synchronizer/models/convenience/vroutertenant.py
new file mode 100644
index 0000000..f9b76c2
--- /dev/null
+++ b/xos/synchronizer/models/convenience/vroutertenant.py
@@ -0,0 +1,67 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import json
+from xosapi.orm import ORMWrapper, register_convenience_wrapper
+
+class ORMWrapperVRouterTenant(ORMWrapper):
+    @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
+
+    # Use for tenant_for_instance_id
+    # TODO: These should be reimplemented using real database models
+
+    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)
+
+    def set_attribute(self, name, value):
+        if self.service_specific_attribute:
+            attributes = json.loads(self.service_specific_attribute)
+        else:
+            attributes = {}
+        attributes[name] = value
+        self.service_specific_attribute = json.dumps(attributes)
+
+
+register_convenience_wrapper("VRouterTenant", ORMWrapperVRouterTenant)
