OpenStack Image Registry and Delivery Service (Glance)

Improve Glance Notifications

Registered by Brian Waldon on 2012-08-24

There is some (yet-to-be-defined) amount of work that needs happen with Glance's notifications. We should be carefully thinking about what we are generating and when in specific workflows we send them off.

Blueprint information

Status:
Complete
Approver:
Brian Waldon
Priority:
Undefined
Drafter:
Brian Waldon
Direction:
Needs approval
Assignee:
Andrew Melton
Definition:
Discussion
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Brian Waldon on 2012-09-19
Completed by
Mark Washenberger on 2013-04-30

Related branches

Sprints

Whiteboard

jay asked me to add some discussion on a defect I opened: https://bugs.launchpad.net/bugs/1041359

the method _upload in module ./glance/target/rpmbuild/BUILD/glance-2012.1/glance/api/v1/images.py does not perform the image.upload event until the end of the upload.

This makes the UI appear sluggish, as the indexer ( our UI event listener at HP) will have no record
of the os image until some minutes have passed (however long it takes
the upload of the image to process). As a user of various UI systems over the years I know that responsive UI is important (even if all it says at some points in time is "please wait"). A UI (like the glance "Add Image" UI) which does not appear to be doing anything (while the upload is progressing) will lead to confusion and perhaps (because it appears broken) doing the "Add image" function a couple of times. This could be avoided if the "image.upload" event is done first instead of last. And at the end of the _upload method the "image.update" event would be done to update the fields changed by processing. The event driven listeners for these events would be much more responsive .

---
Added 15-Jan-2013: I have a problem with Kirk's patch referenced above, namely, that it changes the semantics of the 'image.upload' notification. Before the patch, the notification indicates a successful image upload. After the patch, it indicates only that an image upload has been initiated.

Even though the term 'image.upload' is ambiguous (it could mean either of the above), I'd prefer that we stick with the current meaning. I appreciate Kirk's concern with respect to the problem a late notification presents for UIs; perhaps this can be addressed by introducing another notification?
-- Rosmaita
---

Gerrit topic: https://review.openstack.org/#q,topic:bp/glance-notifications-deux,n,z

Addressed by: https://review.openstack.org/13190
    Remove notifications on error

---
There is a nova blueprint scheduled for grizzly,
    https://blueprints.launchpad.net/nova/+spec/nova-direct-image-upload
that aims to reduce bandwidth usage by uploading snapshots directly to Swift and separately creating the image record in Glance. It would be good to have an 'image.activate' notification (with the same content as the 'image.upload' notification) available for this use case.

---
Added 17-Jan-2013: I've created a wiki page (http://wiki.openstack.org/glance-notifications-deux) defining a few new notifications, one of which addresses Kirk's need for an event that signifies that an upload is starting. Please take a look and give me your input.
-- Andrew Melton

---
Nice job, Andrew. As part of this blueprint, we should add a page defining what Glance notifications exist and what their intended meanings are, similar to what's there now for image statuses [1]. I know documentation is a pain in the butt and no one likes to do it, so I volunteer to put that page together when this BP is finalized.
-- Rosmaita
[1] http://docs.openstack.org/developer/glance/statuses.html

---
29-Jan-2013: Updated Andrew's spec with an 'image.exists' notification.

Addressed by: https://review.openstack.org/21452
    Adding finer notifications.

Addressed by: https://review.openstack.org/21823
    Periodic image.exists event generation

(?)

Work Items

Work items:
Remove all error notifications due to user requests: INPROGRESS
Add notification at start of image creation/upload: DONE
Rewrite notification calls to exclusively use domain model: TODO
Replace notification framework: TODO

This blueprint contains Public information 
Everyone can see this information.