Ask Your Question
0

snapshots fail to delete / volume unable to be deleted (mitaka) [closed]

asked 2016-11-07 10:37:41 -0600

Unable to delete volume snapshot to delete volume.

Openstack Mitaka using gluster / nfs as storage repos.

After testing snapshot ability on a volume i tried to delete the snapshot and got this.

2016-11-07 00:01:03.725 31305 CRITICAL cinder [req-23a17285-b210-44a2-99ba-f8c1beaab80d - - - - -] DBReferenceError: (pymysql.err.IntegrityError) (1451, u'Cannot delete or update a parent row: a foreign key constraint fails (`cinder`.`volume_glance_metadata`, CONSTRAINT `volume_glance_metadata_ibfk_2` FOREIGN KEY (`snapshot_id`) REFERENCES `snapshots` (`id`))') [SQL: u'DELETE FROM snapshots WHERE snapshots.deleted_at < %s'] [parameters: (datetime.datetime(2016, 11, 6, 5, 1, 3, 715297),)]
2016-11-07 00:01:03.725 31305 ERROR cinder Traceback (most recent call last):
2016-11-07 00:01:03.725 31305 ERROR cinder   File "/bin/cinder-manage", line 10, in <module>
2016-11-07 00:01:03.725 31305 ERROR cinder     sys.exit(main())
2016-11-07 00:01:03.725 31305 ERROR cinder   File "/usr/lib/python2.7/site-packages/cinder/cmd/manage.py", line 596, in main
2016-11-07 00:01:03.725 31305 ERROR cinder     fn(*fn_args)
2016-11-07 00:01:03.725 31305 ERROR cinder   File "/usr/lib/python2.7/site-packages/cinder/cmd/manage.py", line 231, in purge
2016-11-07 00:01:03.725 31305 ERROR cinder     db.purge_deleted_rows(ctxt, age_in_days)
2016-11-07 00:01:03.725 31305 ERROR cinder   File "/usr/lib/python2.7/site-packages/cinder/db/api.py", line 1062, in purge_deleted_rows
2016-11-07 00:01:03.725 31305 ERROR cinder     return IMPL.purge_deleted_rows(context, age_in_days=age_in_days)
2016-11-07 00:01:03.725 31305 ERROR cinder   File "/usr/lib/python2.7/site-packages/cinder/db/sqlalchemy/api.py", line 175, in wrapper
2016-11-07 00:01:03.725 31305 ERROR cinder     return f(*args, **kwargs)
2016-11-07 00:01:03.725 31305 ERROR cinder   File "/usr/lib/python2.7/site-packages/cinder/db/sqlalchemy/api.py", line 4267, in purge_deleted_rows
2016-11-07 00:01:03.725 31305 ERROR cinder     .where(t.c.deleted_at < deleted_age))
2016-11-07 00:01:03.725 31305 ERROR cinder   File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 1046, in execute
2016-11-07 00:01:03.725 31305 ERROR cinder     bind, close_with_result=True).execute(clause, params or {})
2016-11-07 00:01:03.725 31305 ERROR cinder   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
2016-11-07 00:01:03.725 31305 ERROR cinder     return meth(self, multiparams, params)
2016-11-07 00:01:03.725 31305 ERROR cinder   File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
2016-11-07 00:01:03.725 31305 ERROR cinder     return connection._execute_clauseelement(self, multiparams, params)
2016-11-07 00:01:03.725 31305 ERROR cinder   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
2016-11-07 00:01:03.725 31305 ERROR cinder     compiled_sql, distilled_params
2016-11-07 00:01:03.725 31305 ERROR cinder   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
2016-11-07 00:01:03.725 31305 ERROR cinder     context)
2016-11-07 00:01:03.725 31305 ERROR cinder   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1337, in _handle_dbapi_exception
2016-11-07 00:01:03.725 31305 ERROR ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by bcollins
close date 2016-11-09 08:33:47.629999

Comments

Try to delete it using --force

cinder snapshot-delete [--force] <snapshot> [<snapshot> ...]
Beny gravatar imageBeny ( 2016-11-08 01:07:59 -0600 )edit

no --force option .... tried cinder and openstack client....

bcollins gravatar imagebcollins ( 2016-11-08 22:01:16 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-11-08 22:55:31 -0600

Using mysql cmd line or 3rd party tool like dbeaver and update the record.

This seems to work.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-11-07 10:37:41 -0600

Seen: 340 times

Last updated: Nov 08 '16