summaryrefslogtreecommitdiff
path: root/nova/cells
diff options
context:
space:
mode:
authorAndrew Laski <andrew@lascii.com>2016-02-09 17:20:15 -0500
committerMatt Riedemann <mriedem@us.ibm.com>2016-03-02 21:53:15 -0500
commit62835426f72ba3a3a0e2217127fdb3525e8543a5 (patch)
treedff2323cff670175bfa5016f7ac8d8b27ffd6062 /nova/cells
parent00d656193486a0efaa0dcf8fcb079275d775b781 (diff)
downloadnova-62835426f72ba3a3a0e2217127fdb3525e8543a5.tar.gz
Create BuildRequest object during boot process
The BuildRequest object represents a boot request before an instance has been created and written to the database. It will be required to respond to API requests to list/show an instance in cellsv2 where the instance is not written to the database immediately. An upcoming change will modify the boot process to defer instance creation until after scheduling has picked a cell/host and having this BuildRequest object persisted is a prerequisite for that work. The BuildRequest object lifetime ends as soon as the instance has been written to a database and a mapping is in place for it. Until instance creation moves the BuildRequest object is destroyed rather quickly. Note there is a small optimization added here such that when creating instances in the API, only populate the SecurityGroupList once rather than each pass in the for loop (if building multiple instances). Change-Id: I080fa53d13f7301f6f7f2977a8e3cb287a46c02c Partially-implements: bp cells-scheduling-interaction
Diffstat (limited to 'nova/cells')
-rw-r--r--nova/cells/scheduler.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/cells/scheduler.py b/nova/cells/scheduler.py
index f218df500f..b45b39ce99 100644
--- a/nova/cells/scheduler.py
+++ b/nova/cells/scheduler.py
@@ -83,6 +83,9 @@ class CellsScheduler(base.Base):
instances = []
num_instances = len(instance_uuids)
+ security_groups = (
+ self.compute_api.security_group_api.populate_security_groups(
+ security_groups))
for i, instance_uuid in enumerate(instance_uuids):
instance = objects.Instance(context=ctxt)
instance.update(instance_values)