'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 migrate
: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 to migrate to, where
host[\'host\'] is its name, and host[\'capabilities\'] is a
dictionary of its reported capabilities (Not Used).
:returns: Boolean or Boolean, model_update tuple.'

def retype(self, ctxt, volume, new_type, diff, host):

    LOG.info('retype:    volume_name:    %(name)s    new_type:    %(newtype)s    diff:    %(diff)s    host:    %(host)s', {'name': volume.get('id'), 'newtype': new_type, 'diff': diff, 'host': host})
    model_update = None
    if diff['extra_specs']:
        volume_name = volume.get('id')
        provider_id = volume.get('provider_id')
        with self._client.open_connection() as api:
            try:
                scvolume = api.find_volume(volume_name, provider_id)
                if (scvolume is None):
                    LOG.error('Retype    unable    to    find    volume    %s.', volume_name)
                    return False
                (current, requested) = self._get_retype_spec(diff, volume_name, 'Storage    Profile', 'storagetype:storageprofile')
                if ((current != requested) and (not api.update_storage_profile(scvolume, requested))):
                    LOG.error('Failed    to    update    storage    profile')
                    return False
                (current, requested) = self._get_retype_spec(diff, volume_name, 'Replay    Profiles', 'storagetype:replayprofiles')
                if (requested and (not api.update_replay_profiles(scvolume, requested))):
                    LOG.error('Failed    to    update    replay    profiles')
                    return False
                (current, requested) = self._get_retype_spec(diff, volume_name, 'Volume    QOS    Profile', 'storagetype:volumeqos')
                if (current != requested):
                    if (not api.update_qos_profile(scvolume, requested)):
                        LOG.error('Failed    to    update    volume    qos    profile')
                (current, requested) = self._get_retype_spec(diff, volume_name, 'Group    QOS    Profile', 'storagetype:groupqos')
                if (current != requested):
                    if (not api.update_qos_profile(scvolume, requested, True)):
                        LOG.error('Failed    to    update    group    qos    profile')
                        return False
                (current, requested) = self._get_retype_spec(diff, volume_name, 'Data    Reduction    Profile', 'storagetype:datareductionprofile')
                if (current != requested):
                    if (not api.update_datareduction_profile(scvolume, requested)):
                        LOG.error('Failed    to    update    data    reduction    profile')
                        return False
                (current, requested) = self._get_retype_spec(diff, volume_name, 'Replicate    Active    Replay', 'replication:activereplay')
                if ((current != requested) and (not api.update_replicate_active_replay(scvolume, (requested == '<is>    True')))):
                    LOG.error('Failed    to    apply    replication:activereplay    setting')
                    return False
                (ret, model_update) = self._retype_replication(api, volume, scvolume, new_type, diff)
                if (not ret):
                    return False
            except exception.VolumeBackendAPIException:
                return False
    if model_update:
        return (True, model_update)
    return True
