def sync():
    try:
        _keep_alive_for = int(NS.config.data.get("sync_interval", 10)) + 250
        disks = get_node_disks()
        disk_map = {}
        for disk in disks:
            # Creating dict with disk name as key and disk_id as value
            # It will help populate block device disk_id attribute
            _map = dict(disk_id=disks[disk]['disk_id'], ssd=False)
            disk_map[disks[disk]['disk_name']] = _map
        block_devices = get_node_block_devices(disk_map)

        for disk in disks:
            if disk_map[disks[disk]['disk_name']]:
                disks[disk]['ssd'] = disk_map[disks[disk][
                    'disk_name']]['ssd']

            if "virtio" in disks[disk]["driver"]:
                # Virtual disk
                NS.tendrl.objects.VirtualDisk(**disks[disk]).save(
                    ttl=_keep_alive_for
                )
            else:
                # physical disk
                NS.tendrl.objects.Disk(**disks[disk]).save(ttl=_keep_alive_for)

        for device in block_devices['all']:
            NS.tendrl.objects.BlockDevice(**device).save(ttl=_keep_alive_for)
        for device_id in block_devices['used']:
            etcd_utils.write(
                "nodes/%s/LocalStorage/BlockDevices/used/%s" %
                (NS.node_context.node_id,
                 device_id.replace("/", "_").replace("_", "", 1)),
                device_id, ttl=_keep_alive_for
            )
        for device_id in block_devices['free']:
            etcd_utils.write(
                "nodes/%s/LocalStorage/BlockDevices/free/%s" %
                (NS.node_context.node_id,
                 device_id.replace("/", "_").replace("_", "", 1)),
                device_id, ttl=_keep_alive_for
            )
        raw_reference = get_raw_reference()
        etcd_utils.write(
            "nodes/%s/LocalStorage/DiskRawReference" %
            NS.node_context.node_id,
            raw_reference,
            ttl=_keep_alive_for,
        )
    except(Exception, KeyError) as ex:
        _msg = "node_sync disks sync failed: " + ex.message
        Event(
            ExceptionMessage(
                priority="error",
                publisher=NS.publisher_id,
                payload={"message": _msg,
                         "exception": ex}
            )
        )