'Update an instance in the DB if we\'re a top level cell.'

def instance_update_at_top(self, message, instance, **kwargs):

    if (not self._at_the_top()):
        return
    items_to_remove = ['id', 'security_groups', 'volumes', 'cell_name', 'name', 'metadata']
    instance.obj_reset_changes(items_to_remove)
    instance.cell_name = _reverse_path(message.routing_path)
    instance_repr = utils.get_obj_repr_unicode(instance)
    LOG.debug('Got    update    for    instance:    %(instance)s', {'instance': instance_repr}, instance_uuid=instance.uuid)
    expected_vm_state = self._get_expected_vm_state(instance)
    expected_task_state = self._get_expected_task_state(instance)
    with utils.temporary_mutation(message.ctxt, read_deleted='yes'):
        try:
            with instance.skip_cells_sync():
                instance.save(expected_vm_state=expected_vm_state, expected_task_state=expected_task_state)
        except exception.InstanceNotFound:
            instance.create()
        except exception.NotFound:
            pass
