On Sun, Dec 29, 2019 at 11:33:06PM +0100, Klemens Nanni wrote:
> OBP defaults to booting from disk and network in that order.
> With multiple disks attached, only the first disk is tried.
> 
> OBP mostly if not always also defaults to automatic boot, meaning
> domains start trying boot devices once the firmware is done rather than
> dropping into the {0} ok prompt.
> 
> This means (newly provisioned) guest domains may end up in network boot
> loops without any possibility to force booting off any particular disk.
> 
> I ran into this case with a bunch of domains like this one:
> 
>       domain "guest01" {
>               vdisk "/var/ldom/guest01.img"
>               vdisk "/var/ldom/miniroot66.fs"
>               vnet
>               ...
>       }
> 
> Empty disk, miniroot for bootstrap/recovery and network.  But since the
> first disk (empty/invalid) cannot be booted from, OBP tries booting off
> net and seemingly does so forever: multiple solutions exist:
Alternatively, I thought about extending ldom.conf(5) by an additional
and optional parameter for `vdisk' such that disks can either be marked
as boot device, e.g. `boot', or even perhaps even given a device alias
right away, e.g. `miniroot'.

Those aliases can be used right away in OBP, that is `boot miniroot'.

All stuff for later on my list, but feedback is always welcome and small
steps like this diff seem simpler.

Documentation the default disk is a small step but adds much value in
this context, so the diff below mentions the default with regard to
eeprom(8)'s boot-device variable which the other diff mentions,
because technically the first disk is only the default boot device
until it gets set explicitly.

Feedback? OK?


Index: ldom.conf.5
===================================================================
RCS file: /cvs/src/usr.sbin/ldomctl/ldom.conf.5,v
retrieving revision 1.9
diff -u -p -r1.9 ldom.conf.5
--- ldom.conf.5 3 Dec 2019 21:07:03 -0000       1.9
+++ ldom.conf.5 7 Jan 2020 23:30:14 -0000
@@ -64,6 +64,9 @@ can be a block device node or a disk ima
 .Cm create-vdisk
 command.
 This keyword can be used multiple times.
+Unless
+.Cm variable Ar boot-device ...
+is set, fhe first disk will be the default boot device.
 .It Ic vnet Op Brq Ar keyword Ns = Ns Ar value ...
 Assign a
 .Xr vnet 4

Reply via email to