oxidecomputer / helios-omicron-brand

A zone brand for Omicron components running under Helios
Mozilla Public License 2.0
4 stars 0 forks source link

Consider Implementing 'query datasets' #8

Open citrus-it opened 1 year ago

citrus-it commented 1 year ago

I'm logging this because I noticed an error in the SMF log file from the filesystem/minimal service in omicron zones:

[ Oct  5 11:10:39 Enabled. ]
[ Oct  5 11:10:41 Executing start method ("/lib/svc/method/fs-minimal"). ]
cannot open 'oxp_ceb4461c-cf56-4719-ad3c-14430bfdfb60/crypt/zone/oxz_nexus_1c9db98c-0dbc-4680-8914-21c701d5e442': dataset does not exist
[ Oct  5 11:10:41 Method "start" exited with status 0. ]

The error is harmless - it's picking up the root dataset name from mnttab and failing to inspect it. This is because the root dataset is not included in the output of the query datasets brand helper.

For any zone which has additional datasets defined in their zone config, zfs list shows an artificial mount.

root@oxz_crucible_0869b3c3-1d16-4813-b1a2-55a419d60e60:~# zfs list
NAME                                                        USED  AVAIL     REFER  MOUNTPOINT
oxp_14b4dc87-ab46-49fb-a4b4-d361ae214c03                   1.02G  17.9G       24K  /oxp_14b4dc87-ab46-49fb-a4b4-d361ae214c03
oxp_14b4dc87-ab46-49fb-a4b4-d361ae214c03/crucible            48K  17.9G       24K  /data
oxp_14b4dc87-ab46-49fb-a4b4-d361ae214c03/crucible/regions    24K  17.9G       24K  /data/regions
> ::zone ! egrep 'crucible_[0-9]' | head -1
fffffd179485dac0     50 running       oxz_crucible_086...  /pool/ext/cd70d7f6-2354-4bf2...
> fffffd179485dac0::print zone_t zone_datasets | ::walk list | ::print zone_dataset_t zd_dataset
zd_dataset = 0xfffffd1258b23fa8 "oxp_14b4dc87-ab46-49fb-a4b4-d361ae214c03/crucible"

And for a zone which does not have any additional datasets in the zone configuration, none are shown:

root@oxz_nexus_1c9db98c-0dbc-4680-8914-21c701d5e442:~# zfs list
no datasets available

In both cases, since it's in mnttab, other commands show it.

root@oxz_nexus_1c9db98c-0dbc-4680-8914-21c701d5e442:~# df -h /
Filesystem             Size   Used  Available Capacity  Mounted on
oxp_ceb4461c-cf56-4719-ad3c-14430bfdfb60/crypt/zone/oxz_nexus_1c9db98c-0dbc-4680-8914-21c701d5e442
                     15.81G 344.64M     15.48G     3%    /

We should consider having the brand query helper output the root dataset when asked for the list of implicit datasets.