'Remove a volume connection using the volume api.'

@wrap_exception()
def remove_volume_connection(self, context, volume_id, instance):

    try:
        bdm = objects.BlockDeviceMapping.get_by_volume_and_instance(context, volume_id, instance.uuid)
        driver_bdm = driver_block_device.convert_volume(bdm)
        driver_bdm.driver_detach(context, instance, self.volume_api, self.driver)
        connector = self.driver.get_volume_connector(instance)
        self.volume_api.terminate_connection(context, volume_id, connector)
    except exception.NotFound:
        pass
