summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/ec2/cloud.py13
-rw-r--r--nova/api/openstack/servers.py4
2 files changed, 8 insertions, 9 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index 9084958a1..7b6144ba5 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -837,13 +837,11 @@ class CloudController(object):
for num in range(num_instances):
- instance_data = base_options
-
instance_ref = self.compute_manager.create_instance(context,
- instance_data,
security_groups,
mac_address=utils.generate_mac(),
- launch_index=num)
+ launch_index=num,
+ **base_options)
inst_id = instance_ref['id']
internal_id = instance_ref['internal_id']
@@ -851,7 +849,6 @@ class CloudController(object):
self.compute_manager.update_instance(context,
inst_id,
- instance_ref,
hostname=ec2_id)
# TODO(vish): This probably should be done in the scheduler
@@ -903,8 +900,10 @@ class CloudController(object):
'state': 0,
'terminated_at': now}
self.compute_manager.update_instance(context,
- instance_ref['id'],
- updated_data)
+ instance_ref['id'],
+ state_description='terminating',
+ state=0,
+ terminated_at=now)
# FIXME(ja): where should network deallocate occur?
address = db.instance_get_floating_address(context,
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index e1a254d4e..1d8aa2fa4 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -246,11 +246,11 @@ class Controller(wsgi.Controller):
inst['mac_address'] = utils.generate_mac()
inst['launch_index'] = 0
- ref = self.compute_manager.create_instance(ctxt, inst)
+ ref = self.compute_manager.create_instance(ctxt, **inst)
inst['id'] = ref['internal_id']
inst['hostname'] = str(ref['internal_id'])
- self.compute_manager.update_instance(ctxt, inst['id'], inst)
+ self.compute_manager.update_instance(ctxt, inst['id'], **inst)
address = self.network_manager.allocate_fixed_ip(ctxt,
inst['id'])