Comment 5 for bug 1359808

Revision history for this message
Dan Smith (danms) wrote :

Agree that this is more important than wishlist, and agree that it's an easily measurable thing we need to fix.

Part of the problem is the design of our API infrastructure, as I understand it. It doesn't make it easy to do batch operations for things required by the extensions.

One way to fix this would be to expose the list of servers through the context provided to the extensions (where they get the server object they're going to operate on). Then, we could have a batch operation on the InstanceList (like we have now for fill_faults:

https://github.com/openstack/nova/blob/master/nova/objects/instance.py#L780-L802

Then the first call to the extension could effectively say "hey, we're going to need BDMs" (in this case) which would cause them to be pulled and efficiently stashed in some way the first time through the list, instead of one at a time. Right now, instance doesn't have a bdm property, AFAIK, so we'd need to correct that.

The other option would be to just stash a list of BDMs into the context object, but that would get messy over time for things other than BDMs, and would put the onus on the API instead of the model to do that demand-loading, which isn't ideal, IMHO.

Regardless, we should fix this.