diff --git a/cinder/cmd/manage.py b/cinder/cmd/manage.py index 45fc102f4b8..b9f84641de9 100644 --- a/cinder/cmd/manage.py +++ b/cinder/cmd/manage.py @@ -248,12 +248,7 @@ class DbCommands(object): # preceed any element of the "online_migrations" tuple, like this: # # Added in Queens remove in Rocky # db.service_uuids_online_data_migration, - online_migrations = ( - # Added in Train - db.untyped_volumes_online_data_migration, - # Added in Train - db.untyped_snapshots_online_data_migration - ) + online_migrations = tuple() def __init__(self): pass diff --git a/cinder/db/api.py b/cinder/db/api.py index b101c27c969..b53b5713403 100644 --- a/cinder/db/api.py +++ b/cinder/db/api.py @@ -429,13 +429,6 @@ def volume_has_other_project_snp_filter(): return IMPL.volume_has_other_project_snp_filter() -def untyped_volumes_online_data_migration(context, max_count): - return IMPL.untyped_volumes_online_data_migration(context, max_count) - - -def untyped_snapshots_online_data_migration(context, max_count): - return IMPL.untyped_snapshots_online_data_migration(context, max_count) - #################### diff --git a/cinder/db/sqlalchemy/api.py b/cinder/db/sqlalchemy/api.py index 2d6c6978fad..e0d86096dba 100644 --- a/cinder/db/sqlalchemy/api.py +++ b/cinder/db/sqlalchemy/api.py @@ -584,55 +584,6 @@ def service_update(context, service_id, values): raise exception.ServiceNotFound(service_id=service_id) -@enginefacade.writer -def untyped_volumes_online_data_migration(context, max_count): - from cinder.volume import volume_types - default_type = volume_types.get_volume_type_by_name(context, - '__DEFAULT__') - # get all volumes having volume_type=None - total = 0 - updated = 0 - session = get_session() - with session.begin(): - total = model_query(context, - models.Volume, - session=session).filter_by( - volume_type_id=None).limit(max_count).count() - volumes = model_query(context, - models.Volume, - session=session).filter_by( - volume_type_id=None).limit(max_count).all() - for volume in volumes: - volume.volume_type_id = default_type.get('id') - updated += 1 - - return total, updated - - -@enginefacade.writer -def untyped_snapshots_online_data_migration(context, max_count): - from cinder.volume import volume_types - default_type = volume_types.get_volume_type_by_name(context, - '__DEFAULT__') - # get all snapshots having volume_type=None - total = 0 - updated = 0 - session = get_session() - with session.begin(): - total = model_query(context, - models.Snapshot, - session=session).filter_by( - volume_type_id=None).limit(max_count).count() - snapshots = model_query(context, - models.Snapshot, - session=session).filter_by( - volume_type_id=None).limit(max_count).all() - for snapshot in snapshots: - snapshot.volume_type_id = default_type.get('id') - updated += 1 - - return total, updated - ###################