From 62835426f72ba3a3a0e2217127fdb3525e8543a5 Mon Sep 17 00:00:00 2001 From: Andrew Laski Date: Tue, 9 Feb 2016 17:20:15 -0500 Subject: 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 --- nova/cells/scheduler.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nova/cells') 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) -- cgit v1.2.1