diff options
| author | Chris Behrens <cbehrens@codestud.com> | 2011-05-25 20:31:05 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-05-25 20:31:05 +0000 |
| commit | 9ec9a8b39db2d65b7ce8d74f994cb32c49a56df8 (patch) | |
| tree | 9fa99a51a97288cfddd4a4cdd040d3d7e7cf7480 /nova/api | |
| parent | a2505ee554052ee591d1a79c2329c50b31a43dc4 (diff) | |
| parent | bd0b4b87da9e960042c3d0caf00370ef526ce8b7 (diff) | |
| download | nova-9ec9a8b39db2d65b7ce8d74f994cb32c49a56df8.tar.gz nova-9ec9a8b39db2d65b7ce8d74f994cb32c49a56df8.tar.xz nova-9ec9a8b39db2d65b7ce8d74f994cb32c49a56df8.zip | |
During the API create call, the API would kick off a build and then loop in a greenthread waiting for the scheduler to pick a host for the instance. After API would see a host was picked, it would cast to the compute node's set_admin_password method.
The API server really should not have to do this. The password to set should be pushed along with the build request, instead. The compute node can then set the password after it detects the instance has booted. This removes a greenthread from the API server, a loop that constantly checks the DB for the host, and finally a cast to the compute node.
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/servers.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index fcb630fae..5c10fc916 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -180,7 +180,8 @@ class Controller(common.OpenstackController): key_name=key_name, key_data=key_data, metadata=env['server'].get('metadata', {}), - injected_files=injected_files) + injected_files=injected_files, + admin_password=password) except quota.QuotaError as error: self._handle_quota_error(error) @@ -190,8 +191,6 @@ class Controller(common.OpenstackController): builder = self._get_view_builder(req) server = builder.build(inst, is_detail=True) server['server']['adminPass'] = password - self.compute_api.set_admin_password(context, server['server']['id'], - password) return server def _deserialize_create(self, request): @@ -608,7 +607,6 @@ class ControllerV10(Controller): def _parse_update(self, context, server_id, inst_dict, update_dict): if 'adminPass' in inst_dict['server']: - update_dict['admin_pass'] = inst_dict['server']['adminPass'] self.compute_api.set_admin_password(context, server_id, inst_dict['server']['adminPass']) |
