summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorTrey Morris <trey.morris@rackspace.com>2011-03-14 13:32:22 -0500
committerTrey Morris <trey.morris@rackspace.com>2011-03-14 13:32:22 -0500
commit093c8200a102891232e2da166830cd59ee133fc4 (patch)
treef07ed6dac0a7e83fe9bf6adf6dc4b4ea0d3da02d /nova/compute
parent18e16ab9f5be77764a810b2d6ac5ae8c5be6bb52 (diff)
committing to share
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/api.py3
-rw-r--r--nova/compute/manager.py12
2 files changed, 10 insertions, 5 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index c475e3bff..1737565aa 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -184,8 +184,7 @@ class API(base.Base):
instances = []
LOG.debug(_("Going to run %s instances..."), num_instances)
for num in range(num_instances):
- instance = dict(mac_address=utils.generate_mac(),
- launch_index=num,
+ instance = dict(launch_index=num,
**base_options)
instance = self.db.instance_create(context, instance)
instance_id = instance['id']
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index d659712ad..ce2fa8713 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -193,16 +193,22 @@ class ComputeManager(manager.Manager):
# with the address currently, but I'm leaving it as
# a call to ensure that network setup completes. We
# will eventually also need to save the address here.
+ #NOTE(tr3buchet): I don't see why we'd save it here when the network
+ # manager is saving it.
if not FLAGS.stub_network:
- address = rpc.call(context,
- self.get_network_topic(context),
- {"method": "allocate_fixed_ip",
+ rpc.call(context, self.get_network_topic(context),
+ {"method": "allocate_fixed_ips",
"args": {"instance_id": instance_id,
"vpn": is_vpn}})
+ rpc.call(context, self.get_network_topic(context),
+ {"method": "allocate_mac_addresses",
+ "args": {"instance_id": instance_id}})
self.network_manager.setup_compute_network(context,
instance_id)
+ Log.debug(_("instance addresses: |%s|"), instance_ref['fixed_ips'])
+
# TODO(vish) check to make sure the availability zone matches
self.db.instance_set_state(context,
instance_id,