'Get a backup device from an existing volume.
The function returns a volume or snapshot to backup service,
and then backup service attaches the device and does backup.'

def get_backup_device(self, context, backup):

    backup_device = None
    is_snapshot = False
    if self.backup_use_temp_snapshot():
        (backup_device, is_snapshot) = self._get_backup_volume_temp_snapshot(context, backup)
    else:
        backup_device = self._get_backup_volume_temp_volume(context, backup)
        is_snapshot = False
    return (backup_device, is_snapshot)
