'Manages an existing LV.'

def manage_existing(self, volume, existing_ref, is_snapshot=False):

    lv_name = existing_ref['source-name']
    try:
        vol_obj = self.client.req('volumes', name=lv_name)['content']
        if (is_snapshot and ((not vol_obj['ancestor-vol-id']) or (vol_obj['ancestor-vol-id'][XTREMIO_OID_NAME] != volume.volume_id))):
            kwargs = {'existing_ref': lv_name, 'reason': ('Not    a    snapshot    of    vol    %s' % volume.volume_id)}
            raise exception.ManageExistingInvalidReference(**kwargs)
    except exception.NotFound:
        kwargs = {'existing_ref': lv_name, 'reason': (('Specified    logical    %s    does    not    exist.' % 'snapshot') if is_snapshot else 'volume')}
        raise exception.ManageExistingInvalidReference(**kwargs)
    self.client.req('volumes', 'PUT', data={'vol-name': volume['id']}, idx=vol_obj['index'])
