From 24a68b54d9956c5a8d65d8057aaa8fd58f670a52 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Thu, 24 Jun 2010 04:11:58 +0100 Subject: Give vpns the proper ip address --- nova/endpoint/cloud.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'nova') diff --git a/nova/endpoint/cloud.py b/nova/endpoint/cloud.py index c176c4ade..4a115fe35 100644 --- a/nova/endpoint/cloud.py +++ b/nova/endpoint/cloud.py @@ -500,7 +500,11 @@ class CloudController(object): inst['mac_address'] = utils.generate_mac() inst['ami_launch_index'] = num inst['bridge_name'] = bridge_name - address = network.allocate_ip( + if inst['image_id'] == FLAGS.vpn_image_id: + address = network.allocate_vpn_ip( + inst['user_id'], inst['project_id'], mac=inst['mac_address']) + else: + address = network.allocate_ip( inst['user_id'], inst['project_id'], mac=inst['mac_address']) inst['private_dns_name'] = str(address) # TODO: allocate expresses on the router node -- cgit