diff --git a/xos/synchronizer/model_policies/model_policy_vsghwserviceinstance.py b/xos/synchronizer/model_policies/model_policy_vsghwserviceinstance.py
index aece04e..18475c9 100644
--- a/xos/synchronizer/model_policies/model_policy_vsghwserviceinstance.py
+++ b/xos/synchronizer/model_policies/model_policy_vsghwserviceinstance.py
@@ -31,21 +31,12 @@
 
     def handle_update(self, service_instance):
         log.info("Handle_update VSG-HW Service Instance", service_instance=service_instance)
-        if (service_instance.link_deleted_count>0) and (not service_instance.provided_links.exists()):
-            # if the last provided_link has just gone away, then self-destruct
-            self.logger.info("The last provided link has been deleted -- self-destructing.")
-            # TODO: We shouldn't have to call handle_delete ourselves. The model policy framework should handle this
-            #       for us, but it isn't. I think that's happening is that serviceinstance.delete() isn't setting a new
-            #       updated timestamp, since there's no way to pass `always_update_timestamp`, and therefore the
-            #       policy framework doesn't know that the object has changed and needs new policies. For now, the
-            #       workaround is to just call handle_delete ourselves.
+
+        if (service_instance.link_deleted_count > 0) and (not service_instance.provided_links.exists()):
+            # If this instance has no links pointing to it, delete
             self.handle_delete(service_instance)
-            # Note that if we deleted the Instance in handle_delete, then django may have cascade-deleted the service
-            # instance by now. Thus we have to guard our delete, to check that the service instance still exists.
             if VSGHWServiceInstance.objects.filter(id=service_instance.id).exists():
                 service_instance.delete()
-            else:
-                self.logger.info("Tenant %s is already deleted" % service_instance)
             return
 
     def handle_delete(self, service_instance):
diff --git a/xos/synchronizer/steps/sync_vsg_hw_service_instance.py b/xos/synchronizer/steps/sync_vsg_hw_service_instance.py
index 28dfddf..c437610 100644
--- a/xos/synchronizer/steps/sync_vsg_hw_service_instance.py
+++ b/xos/synchronizer/steps/sync_vsg_hw_service_instance.py
@@ -12,31 +12,91 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
-import os
-import sys
 from synchronizers.new_base.SyncInstanceUsingAnsible import SyncStep
-from synchronizers.new_base.modelaccessor import VSGHWServiceInstance
+from synchronizers.new_base.modelaccessor import model_accessor, VSGHWServiceInstance, ServiceInstance
 
 from xosconfig import Config
 from multistructlog import create_logger
-from time import sleep
 import requests
+from requests.auth import HTTPBasicAuth
 
 log = create_logger(Config().get('logging'))
 
-# parentdir = os.path.join(os.path.dirname(__file__), "..")
-# sys.path.insert(0, parentdir)
-# sys.path.insert(0, os.path.dirname(__file__))
-
 class SyncVSGHWServiceInstance(SyncStep):
     provides = [VSGHWServiceInstance]
 
     observes = VSGHWServiceInstance
 
+    @staticmethod
+    def format_url(url):
+        if 'http' in url:
+            return url
+        else:
+            return 'http://%s' % url
+
+    @staticmethod
+    def get_fabric_onos_info(si):
+
+        # get the vsg-hw service
+        vsg_hw = si.owner
+
+        # get the onos_fabric service
+        fabric_onos = [s.leaf_model for s in vsg_hw.provider_services if "onos" in s.name.lower()]
+
+        if len(fabric_onos) == 0:
+            raise Exception('Cannot find ONOS service in provider_services of vSG-HW')
+
+        fabric_onos = fabric_onos[0]
+
+        return {
+            'url': SyncVSGHWServiceInstance.format_url("%s:%s" % (fabric_onos.rest_hostname, fabric_onos.rest_port)),
+            'user': fabric_onos.rest_username,
+            'pass': fabric_onos.rest_password
+        }
+
     def sync_record(self, o):
         log.info("Sync'ing VSG-HW Service Instance", service_instance=o)
 
+
+        onos = SyncVSGHWServiceInstance.get_fabric_onos_info(o)
+
+        si = ServiceInstance.objects.get(id=o.id)
+
+        mac_address = si.get_westbound_service_instance_properties("mac_address")
+        s_tag = si.get_westbound_service_instance_properties("s_tag")
+        c_tag = si.get_westbound_service_instance_properties("c_tag")
+        ip = si.get_westbound_service_instance_properties("ip_address")
+        dpid = si.get_westbound_service_instance_properties("switch_datapath_id")
+        port = si.get_westbound_service_instance_properties("switch_port")
+
+        data = {
+            'hosts': {
+                mac_address + "/" + str(s_tag): {
+                    "basic": {
+                        "ips": [ip],
+                        "locations": ["%s/%s" % (dpid, port)],
+                        "innerVlan": str(c_tag),
+                    }
+                }
+            }
+        }
+
+        # Adding the optional tpid
+        tpid = si.get_westbound_service_instance_properties("outer_tpid")
+        if tpid:
+            data["hosts"][mac_address + "/" + str(s_tag)]["basic"]["outerTpid"] = str(tpid)
+
+        url = onos['url'] + '/onos/v1/network/configuration'
+
+        log.info("Sending requests to ONOS", url=url, body=data)
+
+        r = requests.post(url, json=data, auth=HTTPBasicAuth(onos['user'], onos['pass']))
+
+        if r.status_code != 200:
+            raise Exception("Failed to terminate subscriber in ONOS: %s" % r.text)
+
+        log.info("ONOS response", res=r.text)
+
     def delete_record(self, o):
         log.info("Deleting VSG-HW Service Instance", service_instance=o)
         pass
\ No newline at end of file
diff --git a/xos/synchronizer/steps/test_sync_vsg_hw_service_instance.py b/xos/synchronizer/steps/test_sync_vsg_hw_service_instance.py
new file mode 100644
index 0000000..548e8ab
--- /dev/null
+++ b/xos/synchronizer/steps/test_sync_vsg_hw_service_instance.py
@@ -0,0 +1,176 @@
+# 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 unittest
+
+import functools
+from mock import patch, call, Mock, PropertyMock
+import requests_mock
+
+import os, sys
+
+# Hack to load synchronizer framework
+test_path=os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
+xos_dir=os.path.join(test_path, "../../..")
+if not os.path.exists(os.path.join(test_path, "new_base")):
+    xos_dir=os.path.join(test_path, "../../../../../../orchestration/xos/xos")
+    services_dir = os.path.join(xos_dir, "../../xos_services")
+sys.path.append(xos_dir)
+sys.path.append(os.path.join(xos_dir, 'synchronizers', 'new_base'))
+# END Hack to load synchronizer framework
+
+# generate model from xproto
+def get_models_fn(service_name, xproto_name):
+    name = os.path.join(service_name, "xos", xproto_name)
+    if os.path.exists(os.path.join(services_dir, name)):
+        return name
+    else:
+        name = os.path.join(service_name, "xos", "synchronizer", "models", xproto_name)
+        if os.path.exists(os.path.join(services_dir, name)):
+            return name
+    raise Exception("Unable to find service=%s xproto=%s" % (service_name, xproto_name))
+# END generate model from xproto
+
+def mock_get_westbound_service_instance_properties(prop):
+    return prop
+
+def match_json(desired, req):
+    if desired!=req.json():
+        raise Exception("Got request %s, but body is not matching" % req.url)
+        return False
+    return True
+
+class TestSyncOLTDevice(unittest.TestCase):
+
+    def setUp(self):
+        global DeferredException
+
+        self.sys_path_save = sys.path
+        sys.path.append(xos_dir)
+        sys.path.append(os.path.join(xos_dir, 'synchronizers', 'new_base'))
+
+        # Setting up the config module
+        from xosconfig import Config
+        config = os.path.join(test_path, "../test_vsg_hw_config.yaml")
+        Config.clear()
+        Config.init(config, "synchronizer-config-schema.yaml")
+        # END Setting up the config module
+
+        from synchronizers.new_base.mock_modelaccessor_build import build_mock_modelaccessor
+        build_mock_modelaccessor(xos_dir, services_dir, [get_models_fn("vsg-hw", "vsg-hw.xproto")])
+        import synchronizers.new_base.modelaccessor
+
+        from sync_vsg_hw_service_instance import SyncVSGHWServiceInstance, model_accessor
+
+        # import all class names to globals
+        for (k, v) in model_accessor.all_model_classes.items():
+            globals()[k] = v
+
+
+        self.sync_step = SyncVSGHWServiceInstance
+
+
+        # mock onos-fabric
+        onos_fabric = Mock()
+        onos_fabric.name = "onos-fabric"
+        onos_fabric.rest_hostname = "onos-fabric"
+        onos_fabric.rest_port = "8181"
+        onos_fabric.rest_username = "onos"
+        onos_fabric.rest_password = "rocks"
+
+        # mock generic service
+        svc = Mock()
+        svc.name = "onos-fabric"
+        svc.leaf_model = onos_fabric
+
+        # mock vsg-hw service
+        self.vsg_service = Mock()
+        self.vsg_service.provider_services = [svc]
+
+        # create a mock vsg-hw service instance
+        o = Mock()
+        o.id = 1
+        o.owner = self.vsg_service
+        o.tologdict.return_value = {}
+
+        si = Mock()
+        si.get_westbound_service_instance_properties = mock_get_westbound_service_instance_properties
+
+        self.o = o
+        self.si = si
+
+
+
+    def tearDown(self):
+        self.o = None
+        sys.path = self.sys_path_save
+
+    @requests_mock.Mocker()
+    def test_sync_success(self, m):
+        expected_conf = {
+            'hosts': {
+                "mac_address/s_tag": {
+                    "basic": {
+                        "ips": ["ip_address"],
+                        "locations": ["switch_datapath_id/switch_port"],
+                        "innerVlan": "c_tag",
+                    }
+                }
+            }
+        }
+
+        m.post("http://onos-fabric:8181/onos/v1/network/configuration",
+               status_code=200,
+               additional_matcher=functools.partial(match_json, expected_conf))
+
+        # override the get_westbound_service_instance_properties mock to remove the outer_tpid field
+        def wb_si_prop(prop):
+            if prop == "outer_tpid":
+                return None
+            return prop
+
+        self.si.get_westbound_service_instance_properties = wb_si_prop
+
+        with patch.object(ServiceInstance.objects, "get") as service_instance_mock:
+            service_instance_mock.return_value = self.si
+
+            self.sync_step().sync_record(self.o)
+
+            self.assertTrue(m.called)
+
+    @requests_mock.Mocker()
+    def test_sync_success_with_tpid(self, m):
+        expected_conf = {
+            'hosts': {
+                "mac_address/s_tag": {
+                    "basic": {
+                        "ips": ["ip_address"],
+                        "locations": ["switch_datapath_id/switch_port"],
+                        "innerVlan": "c_tag",
+                        "outerTpid": "outer_tpid"
+                    }
+                }
+            }
+        }
+
+        m.post("http://onos-fabric:8181/onos/v1/network/configuration",
+               status_code=200,
+               additional_matcher=functools.partial(match_json, expected_conf))
+
+        with patch.object(ServiceInstance.objects, "get") as service_instance_mock:
+            service_instance_mock.return_value = self.si
+
+            self.sync_step().sync_record(self.o)
+
+            self.assertTrue(m.called)
\ No newline at end of file
diff --git a/xos/synchronizer/test_vsg_hw_config.yaml b/xos/synchronizer/test_vsg_hw_config.yaml
new file mode 100644
index 0000000..1645391
--- /dev/null
+++ b/xos/synchronizer/test_vsg_hw_config.yaml
@@ -0,0 +1,29 @@
+
+# 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.
+
+name: test-vsg-hw
+accessor:
+  username: xosadmin@opencord.org
+  password: "sample"
+  kind: "testframework"
+logging:
+  version: 1
+  handlers:
+    console:
+      class: logging.StreamHandler
+  loggers:
+    'multistructlog':
+      handlers:
+          - console
