'Removes the specified volume from Cinder management.'

def unmanage(self, volume):

    vol_name = volume['name']
    LOG.debug('Entering    unmanage_volume    volume    =%s', vol_name)
    vol_info = self.APIExecutor.get_vol_info(vol_name)
    if ((vol_info['agent_type'] != AGENT_TYPE_OPENSTACK) and (vol_info['agent_type'] != AGENT_TYPE_OPENSTACK_GST)):
        msg = _('Only    volumes    managed    by    OpenStack    can    be    unmanaged.')
        raise exception.InvalidVolume(reason=msg)
    data = {'data': {'agent_type': AGENT_TYPE_NONE}}
    self.APIExecutor.edit_vol(vol_name, data)
    self.APIExecutor.online_vol(vol_name, False)
