Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary and Scope
Issue Type
Change drive inclusion behavior from keying off of the
TRANSPORT
value oflsblk
to theSUBSYSTEM
. TheTRANSPORT
value makes it easy to see which bus is being utilized by a disk, however this value is NULL (empty) forvirtio
devices.In order to include
virtio
devices, such as devices used by Google Cloud, we can key off of theSUBSYSTEM
value instead. TheSUBSYSTEM
value provides similar information, allowing us to continue choosingsas
,sata
,nvme
, andscsi
while excludingusb
devices.Some refactoring is included in this change to fix variables that were (in some cases) undefined.
Fixes
metal_resolve_disk
, which was returning disks even if they failed the conditional check.Add
metal-log.sh
This hook will copy any and all current and future log files made by metal in/tmp
, presuming any new logs start with^metal
and end with.log
. Currently this produces a just a handful of logs:Prerequisites
Testing for VSHA-536:
metal.no-wipe=0
after already deploying yielded a fresh rebuild)kdump
)metal.no-wipe=1
and mounted all expected, respective partitionsscsi
:sata
,sas
, andvirtio
; andnvme
)kdump
) on USB (skipping remoteISO)I used redbull and a VshastaV2 machine to test my changes and verify parity between metal and vshasta.
Idempotency
Redeploying and rebooting (net and disk) both produced the same behavior.
Risks and Mitigations
This updates the disk selection logic, while leaving the disk formatting/partitioning logic alone. Existing partition expectations are unchanged.