'Brings an existing storage object under Cinder management.
existing_ref can contain source-id or source-name or both.
source-id: lun uuid.
source-name: complete lun path eg. /vol/vol0/lun.'

def manage_existing(self, volume, existing_ref):

    lun = self._get_existing_vol_with_manage_ref(existing_ref)
    extra_specs = na_utils.get_volume_extra_specs(volume)
    self._check_volume_type_for_lun(volume, lun, existing_ref, extra_specs)
    qos_policy_group_info = self._setup_qos_for_volume(volume, extra_specs)
    qos_policy_group_name = na_utils.get_qos_policy_group_name_from_info(qos_policy_group_info)
    path = lun.get_metadata_property('Path')
    if (lun.name == volume['name']):
        new_path = path
        LOG.info('LUN    with    given    ref    %s    need    not    be    renamed    during    manage    operation.', existing_ref)
    else:
        (rest, splitter, name) = path.rpartition('/')
        new_path = ('%s/%s' % (rest, volume['name']))
        self.zapi_client.move_lun(path, new_path)
        lun = self._get_existing_vol_with_manage_ref({'source-name': new_path})
    if (qos_policy_group_name is not None):
        self.zapi_client.set_lun_qos_policy_group(new_path, qos_policy_group_name)
    self._add_lun_to_table(lun)
    LOG.info('Manage    operation    completed    for    LUN    with    new    path    %(path)s    and    uuid    %(uuid)s.', {'path': lun.get_metadata_property('Path'), 'uuid': lun.get_metadata_property('UUID')})
    return self._get_volume_model_update(volume)
