Notes on osload/ossetup os new user allocatable switches.
The only common partition (when there is no NOS installed) between the Dell and the Mellanox is the ONIE-BOOT partition, this is the on disk version of ONIE (not the one on the dongle, we cannot write the dongle). This is where we have to store a grubenv file (not called grubenv) that tells grub what to boot. So the general approach is:
-
Switch boots into grub and loads our grubenv file from the hdd ONIE partition. It tells us to boot into ONIE or into an NOS via env variables.
-
If its a NOS, that is easy; clear the grubenv setting, and boot into the NOS. Aside; might have to write the grubenv file on the HDD partition to set the default menu entry, since we are chainloading.
-
If it says to boot into ONIE (or, not to boot an NOS), then we boot into ONIE rescue mode.
-
We issue a tmcc bootwhat call to tell us what to do.
-
If bootwhat says to boot an NOS, we write that into the grubenv on the hdd and reboot.
-
If bootwhat says to boot the admin MFS, we stay right where are.
Aside; we need to set the root password, and install some ssh keys for root and the user. We can issue the usual tmcc state commands, keeping us on the MINIMAL state machine path for stated.
-
If bootwhat says to boot the Frisbee MFS, we use the tmcc loadinfo command to find out what to load. We call the onie-uninstaller script to clear the hdd. Then we call onie-nos-install script to install the new NOS. If that works, we write a new grubenv to the hdd and reboot.
-
We need to change /bin/exec_installer; it does an automatic reboot after the install, but we need to regain control after to cleanup and send tmcc status. But even so, the NOS installer might do this too (the dell installer has it commented out, I have not looked at ONL or MLNX-OS).
-
Also need to change the onie uninstaller script; it calls reboot too, but I do not see a need to reboot between uninstall and install?
-
Need to wrap the onie uninstaller with a script that does David's parted trick, to avoid hours long uninstall which erases the flash. Is this generally okay to do?
-
The NOSs will be represented by image descriptors.
-
Not sure what loadinfo is going to return yet, but we want to use URLS to boss' www downloads directory.
-
We can use RELOAD state machine states in this mode.
-
-
Here is some stuff I have not figured out yet:
-
Basic configuration file for both switches. This config can be much more basic then the Procurve config, we are leaving it all to the users, but we do need to get IP config set, and put in a password and some ssh keys. Note that the dell appears to dhcp on a different mac while running FTOS, then when running ONIE. Call me confused.
-
How to get that config onto the switches. The above approach does not quite fit with using expect, but we can probably work around that somehow. The dell has a DHCP mode, and you can pass a config to the switch, but that would only be something we do for the first boot. I do not know what the mlnx has.
-
Power control.
-
How to write a shell script that is longer then six lines, cause we ain't got Perl when running ONIE!