'Convert the volume to be of the new type.
Returns a boolean indicating whether the retype occurred.
:param ctxt: Context
:param volume: A dictionary describing the volume to retype
:param new_type: A dictionary describing the volume type to convert to
:param diff: A dictionary with the difference between the two types
:param host: A dictionary describing the host, where
host[\'host\'] is its name, and host[\'capabilities\'] is a
dictionary of its reported capabilities.'

@cinder_utils.trace
def retype(self, ctxt, volume, new_type, diff, host):

    LOG.debug('enter:    retype:    id=%(id)s,    new_type=%(new_type)s,diff=%(diff)s,    host=%(host)s', {'id': volume['id'], 'new_type': new_type, 'diff': diff, 'host': host})
    client = self._login()
    try:
        volume_info = client.getVolumeByName(volume['name'])
        new_extra_specs = dict(new_type).get('extra_specs')
        lh_extra_specs = self._get_lh_extra_specs(new_extra_specs, extra_specs_key_map.keys())
        LOG.debug('LH    specs=%(specs)s', {'specs': lh_extra_specs})
        changed_extra_specs = {}
        for (key, value) in lh_extra_specs.items():
            (old, new) = diff['extra_specs'][key]
            if (old != new):
                changed_extra_specs[key] = value
        options = self._map_extra_specs(changed_extra_specs)
        if (len(options) > 0):
            client.modifyVolume(volume_info['id'], options)
        return True
    except hpeexceptions.HTTPNotFound:
        raise exception.VolumeNotFound(volume_id=volume['id'])
    except Exception as ex:
        LOG.warning('%s', ex)
    finally:
        self._logout(client)
    return False
