Change menu boot order
-
Currently there is not a way to change the ordinal position of menu entries in the FOG iPXE menu. That might make a nice feature request for a future release of FOG.
-
What was it that you had done in 1.2.0? Maybe it can be altered to work in the latest versions?
I too am very interested in this as the options I will use the most, and thus want at the top of the list/menu, are the ones I have created.
I have a feeling the only way to accomplish this is by messing with the php files that dynamically create the menu, which I am not really comfortable with.
-
Depending on if you have all systems booting to network by default or not, if they are not, you could set the default option to be what you what, like Quick Image or whatever.
-
@wayne-workman Its more an issue of having to skip 4-5 options at the top that I dont want to disable because I may need them sometimes to get to the next 4-5 option I created and will use regularly. If it was just 1 item I needed to use always, default would be the ticket.
So I made entries for installing CentOS 7.4, 7.5, ESXi 6.5, 6.7, Windows 7 and Windows 10. I have to skip over memtest (which I could need someday but not every time I boot), host registration x2 and image deployment to get to my options which I will use more frequently. I dont want to disable those 4 options as I will use them, just not as often as the entries I made myself.
-
I get it. It would be nice to be able to arrange the menu - but also that’s a lot of coding to accomplish while and hitting the arrow key down to go to the right item isn’t hard at all.
-
@wayne-workman I get that each feature request needs to be evaluated to see if its worth while. I truly have no concept of what it would take to allow re-ordering the menus but I can not imagine it would, by comparison to other aspects of FOG, be that complicated.
Lets say it takes 1 second for me to “just change the selection” and I am conservatively doing it only 1 time a day and only 300 days in the year. Thats 5 minutes of time spent just switching selection. Lets presume arbitrarily that 1,000 other Foreman users do the same thing. That 5,000 minutes a year spent “just switching” to the desired menu item, or in other words 83.33 hours a year spent doing something that may otherwise be altered to improve usability.
Just looking at the boot.php (and again not being a programmer myself) the new entries are not placed at the beginning nor appended to the end of the file, which leads me to believe there is already code determining its placement within the overall boot.php. It may of course be much more simple than defining order by the user…but something has to tell it my 6th entry goes after my 5th entry. If “something” is doing that, the mechanism is already there to set the placement in the menu, it would just be a matter of changing the “something” to a user.
-
@zer0cool the menu items are ordered by I’d of the pxe menu as ordered in the database. E.g. the menu item with Id = 1 is the first item displayed (boot to disk). That said there is the option to auto select an item as default. By default boot to disk is the default, but you can say have it boot to inventory first, or boot to quick reg first. Adding ordering wouldn’t be hard, but based on the menu shown it complicates things. For example, there’s 4 types of menu items.
Non-registered hosts
Registered Hosts
All hosts
Advanced.So ordering becomes problematic as the all hosts items show in either the non reg or reg hosts. So priority should go where? Should non reg hosts be displayed before or after all host items. Or vice versa? Similarly for reg hosts. Or should we just do it based on numbers.
-
@tom-elliott Numeric seems the best option. I was trying to artificially accomplish this in my menus by naming them (which works in the list of menus in the web GUI but not in the iPXE menus):
I would think a drop down with used numbers eliminated would be the ideal approach (IE: drop down has 1-50 in it, if 1-3 are already used drop down only shows 4-50). lowest number is at top of menu, highest number at bottom. Skipped numbers ignored.
In this fashion you could order menu entries and account for the “include with” as well.
ex:
entry A - include with unknown - 1
entry B - include with known - 2
entry C - include with known - 3
entry D - include with unknown - 4
entry E - include with known - 5
entry F - include with unknown - 6So I boot an unknown host and entries A, D, F show in order 1, 4, 6. I boot known host and entries show in order 2, 3, 5. All hosts show 1-6.
I of course realize with that, you’ll eventually get someone who wants different orders per type lol…
EDIT: As an extra thought, you could add weight to type: (order for type if you will).
Ex (type-order):
type A - 4
type B - 3
type C - 2
type D - 1So then each has its weight 10^#.
Type D is 10^1, so each ordered item is: item order * type order. Ex: Type D (10^1) = 10, plus the item order
ex: (type item - item order)
type D item A - 3 = 10^1 + 3 = 13
type D item B - 2 = 10^1 + 2 = 12
type D item C - 1 = 10^1 + 1 = 11type C item A - 3 = 10^2 + 3 = 103
type C item B - 2 = 10^2 + 2 = 102
type C item C - 1 = 10^2 + 1 = 101thus if show all types (in numeric item order):
type D item C - 1 = 10^1 + 1 = 11
type D item B - 2 = 10^1 + 2 = 12
type D item A - 3 = 10^1 + 3 = 13
type C item C - 1 = 10^2 + 1 = 101
type C item B - 2 = 10^2 + 2 = 102
type C item A - 3 = 10^2 + 3 = 103Thus you have control over order within a type and order when types overlap. 10^# is one trick, but likely becomes burdensome after about 10-20 groups. You dont have to start at 10^1 like I did, you could start with .00001 through 10^5 (10 types) for example. There may be better programatic ways to handle it, just some brainstorming.
-
@tom-elliott jst realized I shouldnt do math this late at night…you could just do dot decimal for type/order instead of 10^#.
IE:
type.order:
ex: (type item - item order)
type D item A - 3 = 1 . 3 = 1.3
type D item B - 2 = 1 . 2 = 1.2
type D item C - 1 = 1 . 1 = 1.1type C item A - 3 = 2 . 3 = 2.3
type C item B - 2 = 2 . 2 = 2.2
type C item C - 1 = 2 . 1 = 2.1would allow ordering with type weighted, and likely be easier to code and store in variables than 10^
-
@tom-elliott said in Change menu boot order:
So ordering becomes problematic as the all hosts items show in either the non reg or reg hosts. So priority should go where? Should non reg hosts be displayed before or after all host items. Or vice versa? Similarly for reg hosts. Or should we just do it based on numbers.
I looked into this a bit then got lost how fog imported the pxeMenu table. I was hoping it was a sql query to where I could just add a new integer field to the table as display order. Then use a sql statement like
select * from pxeMenu order by pxeOrder asc, pxeID asc
That would allow pxeOrder to override pxeID if set, otherwise pxeID indexing would work the same as it does now. You could default pxeOrder to0
so the pxeMenu would work as it does today and then let the FOG Admin mix up the menu. But alas I could not pull it off, but it was the plan.