Glance image snapshot is not getting deleted after instance unshelve operation

Solution Verified - Updated -

Issue

  • Why snapshot image of shelved instance, using rbd backend for glance and nova, remains due to an exception after unshelving ?
  • Tried to unshelve an shelved instance, the instance can be booted successfully. However, its snapshot image, expected to be removed automatically, still remains.
  • Following call trace reported when ushelve instance is trying to delete the glance image snapshot.
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [req-115b4b59-be81-48c0-bc6e-479a62a1082b eab775545c8b4e16bd9527cc6e0d42a7 c5a40b20eaf4415ca67dc283250e72d6 - - -] [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081] Something wrong happened when trying to delete snapshot from shelved instance.
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081] Traceback (most recent call last):
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081]   File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2535, in _delete_snapshot_of_shelved_instance
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081]     self.image_api.delete(context, snapshot_id)
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081]   File "/usr/lib/python2.7/site-packages/nova/image/api.py", line 141, in delete
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081]     return session.delete(context, image_id)
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081]   File "/usr/lib/python2.7/site-packages/nova/image/glance.py", line 430, in delete
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081]     self._client.call(context, 1, 'delete', image_id)
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081]   File "/usr/lib/python2.7/site-packages/nova/image/glance.py", line 231, in call
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081]     result = getattr(client.images, method)(*args, **kwargs)
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081]   File "/usr/lib/python2.7/site-packages/glanceclient/v1/images.py", line 291, in delete
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081]     resp, body = self.client.delete(url)
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081]   File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 288, in delete
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081]     return self._request('DELETE', url, **kwargs)
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081]   File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 268, in _request
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081]     resp, body_iter = self._handle_response(resp)
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081]   File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 89, in _handle_response
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081]     raise exc.from_response(resp, resp.content)
2016-12-15 11:21:32.242 20357 ERROR nova.compute.manager [instance: fb806a68-9ac6-4e1c-9807-03da2c4dc081] HTTPConflict: 409 Conflict: Image 52a29361-e4c6-4747-9f6e-d5276fb76cbf could not be deleted because it is in use: The image cannot be deleted because it is in use through the backend store outside of Glance. (HTTP 409)
  • Second shelving of same instance goes to error and space of shelved instance doesn't decrease.

Environment

  • Red Hat OpenStack Platform
  • Ceph as nova and glance backend

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In