[FFE] Enhancing 'autoinstall-user-data' with s390x specific device enablement

Bug #1941889 reported by Frank Heimes
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu on IBM z Systems
Fix Committed
Wishlist
Canonical Foundations Team
subiquity
Fix Committed
Undecided
Olivier Gayot
subiquity (Ubuntu)
Status tracked in Plucky
Plucky
Fix Committed
Undecided
Olivier Gayot

Bug Description

Request
-------
We want Subiquity to have built-in support for enabling (or disabling) s390-specifc devices, when running an automated install.

We are past FF for plucky, so I would like to request an exception.

Why Needed
----------
On s390x, CCW devices need to be enabled (using chzdev from s390-tools) before they can be used. For manual installations of Ubuntu Server, we already have a TUI screen allowing people to enable or disable specific devices. However, we didn't have support for doing such actions in automated installs. Although it is true that early-commands can be used as an alternative, proper autoinstall support provides a cleaner approach, and makes it possible to use the generated autoinstall-user-data (from a manual installation) as a template for automated installs.

This feature is a request from the partner engineering team.

What changed
------------
* Subiquity can now read from a "zdevs" autoinstall section, allowing users to specify which devices should be enabled or disabled.
* On startup, devices that have been declared as "enabled": true are automatically enabled using a call to chzdev --enable "$device".
* On startup, devices that have been declared as "enabled": false are automatically disabled using a call to chzdev --disable "$device".

Code to be merged
-----------------
https://github.com/canonical/subiquity/pull/2167

Original description
--------------------

On s390x systems (IBM Z and LinuxONE) the s390x specific devices (or better ccw-devices) need to be enabled prior to their usage.
(This does _not_ apply to PCIe devices that the platform supports as well.)

Today this aspect of the special ccw-device enablement is not addressed in the 'autoinstall-user-data' file, which is created while doing a manual installation, but could be easily.

At the end of an interactive installation on a s390x system (or actually already right after the 'zDev' activation screen of subiquity) all s390x specific devices are known and can be obtained by:
$ lszdev --online
TYPE ID ON PERS NAMES
zfcp-host 0.0.e000 yes yes
zfcp-host 0.0.e100 yes yes
zfcp-lun 0.0.e000:0x50050763060b16b6:0x4026400300000000 yes yes sda sg0
zfcp-lun 0.0.e000:0x50050763061b16b6:0x4026400300000000 yes yes sdb sg1
zfcp-lun 0.0.e100:0x50050763060b16b6:0x4026400300000000 yes yes sdd sg3
zfcp-lun 0.0.e100:0x50050763061b16b6:0x4026400300000000 yes yes sdc sg2
qeth 0.0.c000:0.0.c001:0.0.c002 yes yes encc000
But this output can also be nicely filtered to just print the relevant device information like this:
$ lszdev --online --column ID --no-headings
0.0.e000
0.0.e100
0.0.e000:0x50050763060b16b6:0x4026400300000000
0.0.e000:0x50050763061b16b6:0x4026400300000000
0.0.e100:0x50050763060b16b6:0x4026400300000000
0.0.e100:0x50050763061b16b6:0x4026400300000000
0.0.c000:0.0.c001:0.0.c002

This is already the base for the device activation.
Enriching this information with the command that triggers the enablement ('chzdev --enable'):
$ for i in $(lszdev --online --column ID --no-headings); do echo chzdev -e $i; done
chzdev -e 0.0.e000
chzdev -e 0.0.e100
chzdev -e 0.0.e000:0x50050763060b16b6:0x4026400300000000
chzdev -e 0.0.e000:0x50050763061b16b6:0x4026400300000000
chzdev -e 0.0.e100:0x50050763060b16b6:0x4026400300000000
chzdev -e 0.0.e100:0x50050763061b16b6:0x4026400300000000
chzdev -e 0.0.c000:0.0.c001:0.0.c002
produces the list of commands that can be _directly_ added to the 'early-commands' section of the 'autoinstall-user-data' file.

Even if some devices get enabled using a different approach (for example using the boot kernels parm file or using the auto-conf option of a DPM machine), this doesn't hurt since it will be noticed and tolerated by the chzdev command:
$ for i in $(lszdev --online --column ID --no-headings); do chzdev -e $i; done
FCP device 0.0.e000 already configured
FCP device 0.0.e100 already configured
zFCP LUN 0.0.e000:0x50050763060b16b6:0x4026400300000000 already configured
zFCP LUN 0.0.e000:0x50050763061b16b6:0x4026400300000000 already configured
zFCP LUN 0.0.e100:0x50050763060b16b6:0x4026400300000000 already configured
zFCP LUN 0.0.e100:0x50050763061b16b6:0x4026400300000000 already configured
QETH device 0.0.c000:0.0.c001:0.0.c002 already configured
$ echo $?
0

Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
importance: Undecided → Wishlist
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Revision history for this message
Frank Heimes (fheimes) wrote :

I think work on that has already started:
https://github.com/canonical/subiquity/pull/800

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

That branch isn't going anywhere currently though :/ Do you agree with xnox that a more sophisticated schema is needed / desired?

Revision history for this message
Frank Heimes (fheimes) wrote :
Frank Heimes (fheimes)
tags: added: zdev
Frank Heimes (fheimes)
tags: added: installation
removed: installer
Revision history for this message
Olivier Gayot (ogayot) wrote :

We've resumed the work on this feature with https://github.com/canonical/subiquity/pull/2167

Changed in subiquity:
assignee: nobody → Olivier Gayot (ogayot)
status: New → In Progress
Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: New → In Progress
Olivier Gayot (ogayot)
description: updated
summary: - Enhancing 'autoinstall-user-data' with s390x specific device enablement
+ [FFE] Enhancing 'autoinstall-user-data' with s390x specific device
+ enablement
description: updated
Revision history for this message
Graham Inggs (ginggs) wrote :

To be clear, is this FFe request for plucky?

Revision history for this message
Olivier Gayot (ogayot) wrote :

@ginggs, yes, this is a FFe for plucky. I just updated the "Request" description to make it clearer.
Thanks

description: updated
Revision history for this message
Graham Inggs (ginggs) wrote :

Thanks, FFe approved.

Changed in subiquity (Ubuntu Plucky):
status: New → Triaged
Olivier Gayot (ogayot)
Changed in subiquity:
status: In Progress → Fix Committed
Changed in subiquity (Ubuntu Plucky):
status: Triaged → Fix Committed
milestone: none → ubuntu-25.04
assignee: nobody → Olivier Gayot (ogayot)
Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.