8.8. Adding Kernel Boot Parameters

There are two scenarios in which you need to add extra kernel boot parameters: 1) during installation, and 2) during normal boot. For both scenarios, we will use the example of adding the kernel boot parameter: "ucsd=rocks".

8.8.1. Adding Kernel Boot Parameters to the Installation Kernel

The boot action of a node is controlled by the Rocks command line. For example, the following lists what the nodes will do on their next PXE boot:

# rocks list host boot
HOST         ACTION
vi-2:        ------
compute-0-0: os    
compute-0-1: os

We see that compute-0-0 will boot the "os", that is, it will boot off its local disk. Another common action is "install" which means the node will boot the installation kernel and install itself on the node's next PXE boot.

To list all the possible boot actions for a node, execute:

# rocks list bootaction
ACTION            KERNEL                RAMDISK             ARGS                                                                                  
install:          vmlinuz-5.2-i386      initrd.img-5.2-i386 ks ramdisk_size=150000 lang= devfs=nomount pxe kssendmac selinux=0 noipv6             
install headless: vmlinuz-5.2-i386      initrd.img-5.2-i386 ks ramdisk_size=150000 lang= devfs=nomount pxe kssendmac selinux=0 noipv6 headless vnc
memtest:          kernel memtest        ------------------- --------------------------------------------------------------------------------------
os:               localboot 0           ------------------- --------------------------------------------------------------------------------------
pxeflash:         kernel memdisk bigraw pxeflash.img        keeppxe                                                                               
rescue:           vmlinuz-5.2-i386      initrd.img-5.2-i386 ks ramdisk_size=150000 lang= devfs=nomount pxe kssendmac selinux=0 noipv6 rescue

To change a node's boot action to "install", execute:

# rocks set host boot compute-0-0 action="install"

Then we see that correct boot action has been applied:

# rocks list host boot
HOST         ACTION 
vi-2:        -------
compute-0-0: install
compute-0-1: os

Now to change the kernel boot parameters for the installing kernel, we'll need to add an action. We'll create a new action called "install ucsd" and add our boot flag "ucsd=rocks" to the end of the kernel boot parameters:

# rocks add bootaction action="install ucsd" kernel="vmlinuz-5.2-i386" ramdisk="initrd.img-5.2-i386" \
args="ks ramdisk_size=150000 lang= devfs=nomount pxe kssendmac selinux=0 noipv6 ucsd=rocks"

We now see that "install ucsd" is an available action:

# rocks list bootaction
ACTION            KERNEL                RAMDISK             ARGS                                                                                  
install:          vmlinuz-5.2-i386      initrd.img-5.2-i386 ks ramdisk_size=150000 lang= devfs=nomount pxe kssendmac selinux=0 noipv6             
install headless: vmlinuz-5.2-i386      initrd.img-5.2-i386 ks ramdisk_size=150000 lang= devfs=nomount pxe kssendmac selinux=0 noipv6 headless vnc
install ucsd:     vmlinuz-5.2-i386      initrd.img-5.2-i386 ks ramdisk_size=150000 lang= devfs=nomount pxe kssendmac selinux=0 noipv6 ucsd=rocks  
memtest:          kernel memtest        ------------------- --------------------------------------------------------------------------------------
os:               localboot 0           ------------------- --------------------------------------------------------------------------------------
pxeflash:         kernel memdisk bigraw pxeflash.img        keeppxe                                                                               
rescue:           vmlinuz-5.2-i386      initrd.img-5.2-i386 ks ramdisk_size=150000 lang= devfs=nomount pxe kssendmac selinux=0 noipv6 rescue

To set the install action for compute-0-0 to "install ucsd", execute:

# rocks set host installaction compute-0-0 action="install ucsd"

Then we see that correct boot action has been applied:

# rocks list host
HOST         MEMBERSHIP CPUS RACK RANK RUNACTION INSTALLACTION
vi-2:        Frontend   1    0    0    os        install      
compute-0-0: Compute    2    0    0    os        install ucsd 
compute-0-1: Compute    2    0    1    os        install 

The next time compute-0-0 is installed, it will use the "install ucsd" profile.

8.8.2. Adding Kernel Boot Parameters to the Running Kernel

To get the current parameters that will be appended to the default kernel boot parameters, execute:

# rocks report host bootflags
rocks-168: dom0_mem=1024M
compute-0-0: dom0_mem=1024M

Then, to add our boot flag of "ucsd=rocks", execute:

# rocks set host bootflags compute-0-0 flags="dom0_mem=1024M ucsd=rocks"

To check to make sure the flag has been added to the database, execute:

# rocks report host bootflags
rocks-168: dom0_mem=1024M
compute-0-0: dom0_mem=1024M ucsd=rocks

To apply the flags to the running kernel, you'll need to reinstall the compute nodes. For example, you'll need to reinstall compute-0-0 in order to apply "ucsd=rocks" to its kernel boot parameters. After compute-0-0 is reinstalled, you can check that the new kernel boot parameters have been applied by logging into compute-0-0 and executing:

# cat /proc/cmdline 
ro root=LABEL=/ dom0_mem=1024M ucsd=rocks