'Convert the volume to be of the new type.'

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

    if (volume['host'] != host['host']):
        if self._check_volume_attachment(volume):
            LOG.warning('Volume    %(volume_id)s    cannot    be    retyped    during    attachment.', {'volume_id': volume['id']})
            return False
        if self._check_volume_has_snapshot(volume):
            LOG.warning('Volume    %(volume_id)s    cannot    be    retyped    because    it    has    snapshot.', {'volume_id': volume['id']})
            return False
        new_extraspecs = new_type['extra_specs']
        (rc, model_update) = self.migrate_volume(volume, host, new_extraspecs)
        if rc:
            LOG.info('Retype    Volume    %(volume_id)s    is    done    and    migrated    to    pool    %(pool_id)s.', {'volume_id': volume['id'], 'pool_id': host['capabilities']['pool_id']})
        return (rc, model_update)
    else:
        if (('infortrend_provisioning' in diff['extra_specs']) and (diff['extra_specs']['infortrend_provisioning'][0] != diff['extra_specs']['infortrend_provisioning'][1])):
            LOG.warning('The    provisioning:    %(provisioning)s    is    not    valid.', {'provisioning': diff['extra_specs']['infortrend_provisioning'][1]})
            return False
        LOG.info('Retype    Volume    %(volume_id)s    is    completed.', {'volume_id': volume['id']})
        return True
