Re: ldom.conf.5: Mention default boot disk

2020-01-08 Thread Klemens Nanni
On Wed, Jan 08, 2020 at 09:33:09AM +, Andrew Grillet wrote:
> Yes - I like the alias idea.
> 
> The example you give exactly matches most of my setups.
Cool.

> Would it be possible to pass the actual filename to boot from via OBP?
You mean specifying the absolute file path of the primary domain's
filesystem in the guest's OBP?  No.

> (Perhaps if enabled/forced by a null or "*" as the filename).
> This would make it possible to add/replace a disk to a  guest after the
> config is running, without interrupting the primary or other guests.
> (EG because guest is re-purposed).
You can use `vdisk /some/generic/path' and simply replace the file on
the primary, or use symlinks.  Adding or removing disks to guests is not
possible, but you may replace existing disks as you wish.

I'm currently just using symlinks, that is

domain guest {
vdisk /var/ldom/guest.img
...
}

Where /var/ldom/guest.img is a symbolic link to whatever I want to boot.
Not nice but works;  replace the target and restart the guest: done.



Re: ldom.conf.5: Mention default boot disk

2020-01-08 Thread Andrew Grillet
Yes - I like the alias idea.

The example you give exactly matches most of my setups.

Would it be possible to pass the actual filename to boot from via OBP?
(Perhaps if enabled/forced by a null or "*" as the filename).
This would make it possible to add/replace a disk to a  guest after the
config is running, without interrupting the primary or other guests.
(EG because guest is re-purposed).




On Tue, 7 Jan 2020 at 23:41, Klemens Nanni  wrote:

> 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 -   1.9
> +++ ldom.conf.5 7 Jan 2020 23:30:14 -
> @@ -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
>
>


Re: ldom.conf.5: Mention default boot disk

2020-01-07 Thread Klemens Nanni
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 -   1.9
+++ ldom.conf.5 7 Jan 2020 23:30:14 -
@@ -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



Re: ldom.conf.5: Mention default boot disk

2019-12-31 Thread Klemens Nanni
On Mon, Dec 30, 2019 at 11:19:31PM +0100, Klemens Nanni wrote:
>   -> set /HOST send_break_action=break
> 
>   Set 'send_break_action' to 'break'  
> 
> 
>   -> start -script /SP/console
> 
>   Serial console started.  To stop, type #.   
> 
>   {0} ok
> 
> That should be doable for guest domains from within the primary domain
> as well, I'll see to that.
Just send a break to guest and it will stop net boot loops just as fine:

Requesting Internet Address for 0:14:4f:f8:f7:fb
...

Type  'go' to resume
{0} ok 



Re: ldom.conf.5: Mention default boot disk

2019-12-30 Thread Klemens Nanni
On Mon, Dec 30, 2019 at 10:57:39AM +, Andrew Grillet wrote:
> Whether the config is screwed, there is a typo in a config or a cable has
> fallen off somewhere,
> it would be very nice to be able to kill the netboot and start again,
> regardless of this particular reason.
At least on the primary domain you can send a break to drop back to OBP,
ie. from ILOM do

-> set /HOST send_break_action=break

Set 'send_break_action' to 'break'  


-> start -script /SP/console

Serial console started.  To stop, type #.   

{0} ok

That should be doable for guest domains from within the primary domain
as well, I'll see to that.



Re: ldom.conf.5: Mention default boot disk

2019-12-30 Thread Andrew Grillet
The fact that netbooting cannot be interrupted has caused me to waste a lot
of time over the years.

Whether the config is screwed, there is a typo in a config or a cable has
fallen off somewhere,
it would be very nice to be able to kill the netboot and start again,
regardless of this particular reason.



On Sun, 29 Dec 2019 at 22:45, 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:
>
> - remove network so OBP exhausts boot devices and drops to prompt
>(not tested)
> - provide working network boot setup
> - make miniroot be the first disk so OBP boots into something usable
> - provision the actual guest disk prior to starting the domain
> - make OBP stay at boot prompt with `variable auto-boot?=false'
>
> Since our code handles no dynamic runtime changes, all of those
> approaches currently requires rewriting new LDOM configurations and
> resetting the physical machine to make it effective.
>
> Implementing the features will take much effort, but polishing
> documentation to make users more aware of such behaviour is easy, so I
> want to start with simply mentioning which disk is tried at boot.
>
> Hopefull users transport this into ordering their `vdisk' lines
> accordingly or disabling automatic boot.
>
> 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 -   1.9
> +++ ldom.conf.5 29 Dec 2019 22:11:12 -
> @@ -64,6 +64,7 @@ can be a block device node or a disk ima
>  .Cm create-vdisk
>  command.
>  This keyword can be used multiple times.
> +The first disk will be the default boot device.
>  .It Ic vnet Op Brq Ar keyword Ns = Ns Ar value ...
>  Assign a
>  .Xr vnet 4
>
>


ldom.conf.5: Mention default boot disk

2019-12-29 Thread Klemens Nanni
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:

- remove network so OBP exhausts boot devices and drops to prompt
   (not tested)
- provide working network boot setup
- make miniroot be the first disk so OBP boots into something usable
- provision the actual guest disk prior to starting the domain
- make OBP stay at boot prompt with `variable auto-boot?=false'

Since our code handles no dynamic runtime changes, all of those
approaches currently requires rewriting new LDOM configurations and
resetting the physical machine to make it effective.

Implementing the features will take much effort, but polishing
documentation to make users more aware of such behaviour is easy, so I
want to start with simply mentioning which disk is tried at boot.

Hopefull users transport this into ordering their `vdisk' lines
accordingly or disabling automatic boot.

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 -   1.9
+++ ldom.conf.5 29 Dec 2019 22:11:12 -
@@ -64,6 +64,7 @@ can be a block device node or a disk ima
 .Cm create-vdisk
 command.
 This keyword can be used multiple times.
+The first disk will be the default boot device.
 .It Ic vnet Op Brq Ar keyword Ns = Ns Ar value ...
 Assign a
 .Xr vnet 4