Make sure advertise host is set for IPA
Change-Id: Iadfe058b3534c73f303df7435a3c783cdd1aae65
This commit is contained in:
parent
20151a83d9
commit
8c1d7d22a1
|
@ -69,6 +69,7 @@ class PXEBoot(pxe.PXEBoot):
|
|||
extra={"vif_port_id": port['port']['id'],
|
||||
"type": "deploy", "state": "ACTIVE"})
|
||||
new_port.create()
|
||||
return port['port']['fixed_ips'][0]['ip_address']
|
||||
|
||||
def _unplug_provisioning(self, task, **kwargs):
|
||||
LOG.debug("Unplugging the provisioning!")
|
||||
|
@ -99,7 +100,7 @@ class PXEBoot(pxe.PXEBoot):
|
|||
os.path.basename(CONF.pxe.ipxe_boot_script))
|
||||
shutil.copyfile(CONF.pxe.ipxe_boot_script, bootfile_path)
|
||||
|
||||
self._plug_provisioning(task)
|
||||
prov_ip = self._plug_provisioning(task)
|
||||
|
||||
task.ports = objects.Port.list_by_node_id(task.context, node.id)
|
||||
|
||||
|
@ -112,6 +113,7 @@ class PXEBoot(pxe.PXEBoot):
|
|||
|
||||
pxe_options = pxe._build_pxe_config_options(task, pxe_info)
|
||||
pxe_options.update(ramdisk_params)
|
||||
pxe_options['advertise_host'] = prov_ip
|
||||
|
||||
if deploy_utils.get_boot_mode_for_deploy(node) == 'uefi':
|
||||
pxe_config_template = CONF.pxe.uefi_pxe_config_template
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
default deploy
|
||||
|
||||
label deploy
|
||||
kernel {{ pxe_options.deployment_aki_path }}
|
||||
append initrd={{ pxe_options.deployment_ari_path }} selinux=0 disk={{ pxe_options.disk }} iscsi_target_iqn={{ pxe_options.iscsi_target_iqn }} deployment_id={{ pxe_options.deployment_id }} deployment_key={{ pxe_options.deployment_key }} ironic_api_url={{ pxe_options.ironic_api_url }} troubleshoot=0 text {{ pxe_options.pxe_append_params|default("", true) }} boot_option={{ pxe_options.boot_option }} {% if pxe_options.root_device %}root_device={{ pxe_options.root_device }}{% endif %} ipa-api-url={{ pxe_options['ipa-api-url'] }} ipa-driver-name={{ pxe_options['ipa-driver-name'] }} boot_mode={{ pxe_options['boot_mode'] }} ipa-advertise-host={{ pxe_options['advertise_host'] }} coreos.configdrive=0
|
||||
ipappend 3
|
||||
|
||||
|
||||
label boot_partition
|
||||
kernel {{ pxe_options.aki_path }}
|
||||
append initrd={{ pxe_options.ari_path }} root={{ ROOT }} ro text {{ pxe_options.pxe_append_params|default("", true) }}
|
||||
|
||||
|
||||
label boot_whole_disk
|
||||
COM32 chain.c32
|
||||
append mbr:{{ DISK_IDENTIFIER }}
|
||||
|
||||
label trusted_boot
|
||||
kernel mboot
|
||||
append tboot.gz --- {{pxe_options.aki_path}} root={{ ROOT }} ro text {{ pxe_options.pxe_append_params|default("", true) }} intel_iommu=on --- {{pxe_options.ari_path}}
|
|
@ -56,7 +56,10 @@ class PXEBootTestCase(test_common.CIMCBaseTestCase):
|
|||
'port': {
|
||||
'id': 'fake_id',
|
||||
'network_id': CONF.neutron.cleaning_network_uuid,
|
||||
'mac_address': 'fake_address'
|
||||
'mac_address': 'fake_address',
|
||||
'fixed_ips': [
|
||||
{'ip_address': "1.2.3.4"}
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,7 +69,7 @@ class PXEBootTestCase(test_common.CIMCBaseTestCase):
|
|||
}
|
||||
}
|
||||
|
||||
task.driver.boot._plug_provisioning(task)
|
||||
ip = task.driver.boot._plug_provisioning(task)
|
||||
|
||||
neutron_data = {
|
||||
'port': {
|
||||
|
@ -87,6 +90,7 @@ class PXEBootTestCase(test_common.CIMCBaseTestCase):
|
|||
"type": "deploy",
|
||||
"state": "ACTIVE"})
|
||||
mock_port.return_value.create.assert_called_once_with()
|
||||
self.assertEqual('1.2.3.4', ip)
|
||||
|
||||
@mock.patch.object(objects, 'Port', autospec=True)
|
||||
@mock.patch.object(neutron, '_build_client', autospec=True)
|
||||
|
|
Loading…
Reference in New Issue