'Get cinder_img_volume_type property from the image metadata.'

def _get_image_volume_type(self, context, image_id):

    if (image_id is None):
        return None
    image_meta = self.image_service.show(context, image_id)
    if (image_meta['status'] != 'active'):
        msg = (_('Image    %(image_id)s    is    not    active.') % {'image_id': image_id})
        raise exception.InvalidInput(reason=msg)
    image_volume_type = 'cinder_img_volume_type'
    properties = image_meta.get('properties')
    if properties:
        try:
            img_vol_type = properties.get(image_volume_type)
            if (img_vol_type is None):
                return None
            volume_type = volume_types.get_volume_type_by_name(context, img_vol_type)
        except exception.VolumeTypeNotFoundByName:
            LOG.warning("Failed    to    retrieve    volume_type    from    image    metadata.    '%(img_vol_type)s'    doesn't    match    any    volume    types.", {'img_vol_type': img_vol_type})
            return None
        LOG.debug('Retrieved    volume_type    from    glance    image    metadata.    image_id:    %(image_id)s,    image    property:    %(image_volume_type)s,    volume_type:    %(volume_type)s.', {'image_id': image_id, 'image_volume_type': image_volume_type, 'volume_type': volume_type})
        return volume_type
