'Manage an existing 3PAR volume.
existing_ref is a dictionary of the form:
{\'source-name\': <name of the virtual volume>}'

def manage_existing(self, volume, existing_ref):

    target_vol_name = self._get_existing_volume_ref_name(existing_ref)
    old_comment_str = ''
    try:
        vol = self.client.getVolume(target_vol_name)
        if ('comment' in vol):
            old_comment_str = vol['comment']
    except hpeexceptions.HTTPNotFound:
        err = (_("Virtual    volume    '%s'    doesn't    exist    on    array.") % target_vol_name)
        LOG.error(err)
        raise exception.InvalidInput(reason=err)
    new_comment = {}
    if volume['display_name']:
        display_name = volume['display_name']
        new_comment['display_name'] = volume['display_name']
    elif ('comment' in vol):
        display_name = self._get_3par_vol_comment_value(vol['comment'], 'display_name')
        if display_name:
            new_comment['display_name'] = display_name
    else:
        display_name = None
    new_vol_name = self._get_3par_vol_name(volume['id'])
    name = ('volume-' + volume['id'])
    new_comment['volume_id'] = volume['id']
    new_comment['name'] = name
    new_comment['type'] = 'OpenStack'
    volume_type = None
    if volume['volume_type_id']:
        try:
            volume_type = self._get_volume_type(volume['volume_type_id'])
        except Exception:
            reason = (_("Volume    type    ID    '%s'    is    invalid.") % volume['volume_type_id'])
            raise exception.ManageExistingVolumeTypeMismatch(reason=reason)
    new_vals = {'newName': new_vol_name, 'comment': json.dumps(new_comment)}
    if ('snapCPG' not in vol):
        new_vals['snapCPG'] = vol['userCPG']
        LOG.info("Virtual    volume    %(disp)s    '%(new)s'    snapCPG    is    empty    so    it    will    be    set    to:    %(cpg)s", {'disp': display_name, 'new': new_vol_name, 'cpg': new_vals['snapCPG']})
    self.client.modifyVolume(target_vol_name, new_vals)
    LOG.info("Virtual    volume    '%(ref)s'    renamed    to    '%(new)s'.", {'ref': existing_ref['source-name'], 'new': new_vol_name})
    retyped = False
    model_update = None
    if volume_type:
        LOG.info("Virtual    volume    %(disp)s    '%(new)s'    is    being    retyped.", {'disp': display_name, 'new': new_vol_name})
        try:
            (retyped, model_update) = self._retype_from_no_type(volume, volume_type)
            LOG.info('Virtual    volume    %(disp)s    successfully    retyped    to    %(new_type)s.', {'disp': display_name, 'new_type': volume_type.get('name')})
        except Exception:
            with excutils.save_and_reraise_exception():
                LOG.warning('Failed    to    manage    virtual    volume    %(disp)s    due    to    error    during    retype.', {'disp': display_name})
                self.client.modifyVolume(new_vol_name, {'newName': target_vol_name, 'comment': old_comment_str})
    updates = {'display_name': display_name}
    if (retyped and model_update):
        updates.update(model_update)
    LOG.info("Virtual    volume    %(disp)s    '%(new)s'    is    now    being    managed.", {'disp': display_name, 'new': new_vol_name})
    return updates
