Do not pass PXE net config from bootloader to ramdisk

All PXE templates currently pass network configuration from the
bootloader to the ramdisk via a kernel parameter,
ip=$ip:$tftp-server:$gateway:$netmask. The current deploy-ironic
ramdisks built by DIB uses this to bring up networking manually,
but this behavior exists there for non-PXE deployments where DHCP
is unavailable.  We ideally want ramdisks to use DHCP to allow pushing
more than just ip/gw/nm. This updates PXE templates to not pass net config,
since DHCP is assumed to be functioning for all PXE env.  Without the
ip= parameter, the ramdisk has no easy way to resolve the boot server's
address.  To signal where to callback to, a boot_server parameter has
been added that points back to the TFTP server address.

Closes-bug: 1401298

Change-Id: Icc04de7b8b7324ce685f930d2e8074b0c764fc0c
This commit is contained in:
Adam Gandelman 2014-12-11 11:31:19 -08:00
parent 5a7662419a
commit cb82dabdca
5 changed files with 8 additions and 9 deletions

View File

@ -3,7 +3,7 @@ default=deploy
image={{pxe_options.deployment_aki_path}}
label=deploy
initrd={{pxe_options.deployment_ari_path}}
append="rootfstype=ramfs 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) }} ip=%I:{{pxe_options.tftp_server}}:%G:%M:%H::on" {% if pxe_options.root_device %}root_device={{ pxe_options.root_device }}{% endif %}
append="rootfstype=ramfs 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 boot_server={{ pxe_options.tftp_server }} text {{ pxe_options.pxe_append_params|default("", true) }} BOOTIF={{ mac }}" {% if pxe_options.root_device %}root_device={{ pxe_options.root_device }}{% endif %}
image={{pxe_options.aki_path}}
label=boot

View File

@ -5,7 +5,7 @@ dhcp
goto deploy
:deploy
kernel {{ pxe_options.deployment_aki_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) }} ip=${ip}:${next-server}:${gateway}:${netmask} BOOTIF=${mac} {% if pxe_options.root_device %}root_device={{ pxe_options.root_device }}{% endif %}
kernel {{ pxe_options.deployment_aki_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 boot_server={{ pxe_options.tftp_server }} text {{ pxe_options.pxe_append_params|default("", true) }} BOOTIF=${mac} {% if pxe_options.root_device %}root_device={{ pxe_options.root_device }}{% endif %}
initrd {{ pxe_options.deployment_ari_path }}
boot

View File

@ -2,9 +2,8 @@ default deploy
label deploy
kernel {{ pxe_options.deployment_aki_path }}
append initrd={{ pxe_options.deployment_ari_path }} rootfstype=ramfs 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) }} {% if pxe_options.root_device %}root_device={{ pxe_options.root_device }}{% endif %}
ipappend 3
append initrd={{ pxe_options.deployment_ari_path }} rootfstype=ramfs 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 boot_server={{ pxe_options.tftp_server }} text {{ pxe_options.pxe_append_params|default("", true) }} {% if pxe_options.root_device %}root_device={{ pxe_options.root_device }}{% endif %}
ipappend 2
label boot
kernel {{ pxe_options.aki_path }}

View File

@ -2,9 +2,8 @@ default deploy
label deploy
kernel /tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_kernel
append initrd=/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_ramdisk rootfstype=ramfs selinux=0 disk=cciss/c0d0,sda,hda,vda iscsi_target_iqn=iqn-1be26c0b-03f2-4d2e-ae87-c02d7f33c123 deployment_id=1be26c0b-03f2-4d2e-ae87-c02d7f33c123 deployment_key=0123456789ABCDEFGHIJKLMNOPQRSTUV ironic_api_url=http://192.168.122.184:6385 troubleshoot=0 text test_param root_device=vendor=fake,size=123
ipappend 3
append initrd=/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_ramdisk rootfstype=ramfs selinux=0 disk=cciss/c0d0,sda,hda,vda iscsi_target_iqn=iqn-1be26c0b-03f2-4d2e-ae87-c02d7f33c123 deployment_id=1be26c0b-03f2-4d2e-ae87-c02d7f33c123 deployment_key=0123456789ABCDEFGHIJKLMNOPQRSTUV ironic_api_url=http://192.168.122.184:6385 troubleshoot=0 boot_server=192.168.122.184 text test_param root_device=vendor=fake,size=123
ipappend 2
label boot
kernel /tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/kernel

View File

@ -49,7 +49,8 @@ class TestPXEUtils(db_base.DbTestCase):
'deployment_aki_path': u'/tftpboot/1be26c0b-03f2-4d2e-ae87-'
u'c02d7f33c123/deploy_kernel',
'disk': 'cciss/c0d0,sda,hda,vda',
'root_device': 'vendor=fake,size=123'
'root_device': 'vendor=fake,size=123',
'tftp_server': '192.168.122.184'
}
self.agent_pxe_options = {
'deployment_ari_path': u'/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7'