731af40129
Adds a pxe deploy driver to support the concept of a deployment just consisting of a ramdisk. Ideally, as long as a kernel and ramdisk are defined, either by the operator or via a glance image, the PXE/iPXE template should point the booted kernel to using ramdisk as the root. In theory, this would allow deployment via nova, or directly using the parameters posted to the node's instance_info. There may be additional features realistically needed for this to be beyond minimally useful, but that would also depend on the contents of the ramdisk that is deployed by an API user. Change-Id: Id7067527cba27ed49753736f33ccb35e9b35bcba Story: 1753842 Task: 10666
57 lines
1.3 KiB
Plaintext
57 lines
1.3 KiB
Plaintext
#!ipxe
|
|
|
|
set attempts:int32 10
|
|
set i:int32 0
|
|
|
|
goto deploy
|
|
|
|
:deploy
|
|
imgfree
|
|
kernel http://1.2.3.4:1234/deploy_kernel selinux=0 troubleshoot=0 text test_param BOOTIF=${mac} ipa-api-url=http://192.168.122.184:6385 initrd=deploy_ramdisk coreos.configdrive=0 || goto retry
|
|
|
|
initrd http://1.2.3.4:1234/deploy_ramdisk || goto retry
|
|
boot
|
|
|
|
:retry
|
|
iseq ${i} ${attempts} && goto fail ||
|
|
inc i
|
|
echo No response, retrying in {i} seconds.
|
|
sleep ${i}
|
|
goto deploy
|
|
|
|
:fail
|
|
echo Failed to get a response after ${attempts} attempts
|
|
echo Powering off in 30 seconds.
|
|
sleep 30
|
|
poweroff
|
|
|
|
:boot_partition
|
|
imgfree
|
|
kernel http://1.2.3.4:1234/kernel root={{ ROOT }} ro text test_param initrd=ramdisk || goto boot_partition
|
|
initrd http://1.2.3.4:1234/ramdisk || goto boot_partition
|
|
boot
|
|
|
|
:boot_ramdisk
|
|
imgfree
|
|
kernel http://1.2.3.4:1234/kernel root=/dev/ram0 text test_param ramdisk_param initrd=ramdisk || goto boot_ramdisk
|
|
initrd http://1.2.3.4:1234/ramdisk || goto boot_ramdisk
|
|
boot
|
|
|
|
:boot_iscsi
|
|
imgfree
|
|
set username fake_username
|
|
set password fake_password
|
|
set initiator-iqn fake_iqn
|
|
sanhook --drive 0x80 iscsi:fake_host::3260:0:fake_iqn || goto fail_iscsi_retry
|
|
|
|
|
|
sanboot --no-describe || goto fail_iscsi_retry
|
|
|
|
:fail_iscsi_retry
|
|
echo Failed to attach iSCSI volume(s), retrying in 10 seconds.
|
|
sleep 10
|
|
goto boot_iscsi
|
|
|
|
:boot_whole_disk
|
|
sanboot --no-describe
|