summaryrefslogtreecommitdiff
path: root/nova/network/api.py
diff options
context:
space:
mode:
authordekehn <dekehn@gmail.com>2013-08-08 11:27:16 -0600
committerdekehn <dekehn@gmail.com>2013-08-19 17:40:40 -0600
commit33a41617eaf6006464168660cf96363509bb6376 (patch)
tree0e8f9cce2a135a5c88aa2413b245fb073d73de49 /nova/network/api.py
parent6875dee3fb7d93614252a71f34828a79a647a740 (diff)
downloadnova-33a41617eaf6006464168660cf96363509bb6376.tar.gz
quantum pxeboot-port support for baremetal
Baremetal provisioning currently requires a separate DHCP server because PXE options are not being set in Neutron. This feature does not support nova-network, only Neutron. Implements blueprint pxeboot-ports Change-Id: I2fefced6ce8ce466f0bc6dc5dd68053fb5827884
Diffstat (limited to 'nova/network/api.py')
-rw-r--r--nova/network/api.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/nova/network/api.py b/nova/network/api.py
index 092379f971..7069529e78 100644
--- a/nova/network/api.py
+++ b/nova/network/api.py
@@ -255,7 +255,8 @@ class API(base.Base):
@refresh_cache
def allocate_for_instance(self, context, instance, vpn,
requested_networks, macs=None,
- conductor_api=None, security_groups=None):
+ conductor_api=None, security_groups=None,
+ dhcp_options=None):
"""Allocates all network structures for an instance.
TODO(someone): document the rest of these parameters.
@@ -263,6 +264,11 @@ class API(base.Base):
:param macs: None or a set of MAC addresses that the instance
should use. macs is supplied by the hypervisor driver (contrast
with requested_networks which is user supplied).
+ :param dhcp_options: None or a set of key/value pairs that should
+ determine the DHCP BOOTP response, eg. for PXE booting an instance
+ configured with the baremetal hypervisor. It is expected that these
+ are already formatted for the neutron v2 api.
+ See nova/virt/driver.py:dhcp_options_for_instance for an example.
:returns: network info as from get_instance_nw_info() below
"""
# NOTE(vish): We can't do the floating ip allocation here because
@@ -278,6 +284,7 @@ class API(base.Base):
args['host'] = instance['host']
args['rxtx_factor'] = instance_type['rxtx_factor']
args['macs'] = macs
+ args['dhcp_options'] = dhcp_options
nw_info = self.network_rpcapi.allocate_for_instance(context, **args)
return network_model.NetworkInfo.hydrate(nw_info)