'Schedule the modification of a volume\'s type.
:param context: the request context
:param volume: the volume object to retype
:param request_spec: parameters for this retype request
:param filter_properties: parameters to filter by'

def retype(self, context, volume, request_spec, filter_properties=None):

    self._wait_for_scheduler()
    def _retype_volume_set_error(self, context, ex, request_spec, volume_ref, reservations, msg=None):
        if reservations:
            QUOTAS.rollback(context, reservations)
        previous_status = (volume_ref.previous_status or volume_ref.status)
        volume_state = {'volume_state': {'status': previous_status}}
        self._set_volume_state_and_notify('retype', volume_state, context, ex, request_spec, msg)
    reservations = request_spec.get('quota_reservations')
    old_reservations = request_spec.get('old_reservations', None)
    new_type = request_spec.get('volume_type')
    if (new_type is None):
        msg = _('New    volume    type    not    specified    in    request_spec.')
        ex = exception.ParameterNotFound(param='volume_type')
        _retype_volume_set_error(self, context, ex, request_spec, volume, reservations, msg)
    migration_policy = request_spec.get('migration_policy')
    if (not migration_policy):
        migration_policy = 'never'
    try:
        tgt_backend = self.driver.find_retype_backend(context, request_spec, filter_properties, migration_policy)
    except Exception as ex:
        reraise = (not isinstance(ex, exception.NoValidBackend))
        with excutils.save_and_reraise_exception(reraise=reraise):
            _retype_volume_set_error(self, context, ex, request_spec, volume, reservations)
    else:
        volume_rpcapi.VolumeAPI().retype(context, volume, new_type['id'], tgt_backend, migration_policy, reservations, old_reservations)
