tmt icon indicating copy to clipboard operation
tmt copied to clipboard

Support `disk.count` hw requirement for `mrack`

Open skycastlelily opened this issue 2 years ago • 1 comments

Pull Request Checklist

  • [ ] implement the feature
  • [ ] write the documentation
  • [ ] extend the test coverage
  • [ ] update the specification
  • [ ] adjust plugin docstring
  • [ ] modify the json schema
  • [ ] mention the version
  • [ ] include a release note

skycastlelily avatar Mar 26 '24 02:03 skycastlelily

Okay, we try to allow user to request a given number of disks (https://github.com/teemtee/tmt/issues/2536), and also allow user to speak about the whole set of disks (https://github.com/teemtee/tmt/issues/2721). So far, we have the following proposals in these tickets:

# This is what we have, a list of dictionaries, spelling requirements of each disk:
disk:
  # One disk must have at least 20 GB...
  - size: ">= 20 GB"
  # ... and the other at least 40 GB
  - size: ">= 40 GB"

# Let's say we allow special keys under `disk` (or `network`). One of the keys, `count`,
# would tell tmt to request the right number of disks, no matter their other attributes:
disk:
  # Request a guest with 4 or more disks
  count: ">= 4"

# Another key, `all`, would accept all keys normally accepted by `disk` entry, but apply
# them to all disks:
disk:
  # All disks must be at least 20 GB & by WD
  all:
    size: ">= 20 GB:
    model-name: "~ WD.*"

# We can combine, of course: a guest with at least 4 disks, all disks NVMe SSDs, and one of
# them must be at least 40 GB.
and:
  - disk:
      all:
        driver: "~ nvme.*"
      count: ">= 4"
  - disk:
      - size: ">= 40 GB"

So, if we go this way, we'd document special keys, provide examples for disks as items and disks as collections, and parse them in _parse_disk into more fitting constraints. I think we will start a new kind of constraint for these collections, disk[1].count would not make much sense - disk.count would.

@psss @lukaszachy @therazix what do you think? We don't have this in Artemis either, and there's obvious interest by users, all we need is to find a way to express it in tmt. Easy :)

happz avatar Mar 26 '24 15:03 happz

Dropping from the milestone, we need to review the idea and implement what has been discussed in the hacking meeting.

happz avatar Jun 04 '24 11:06 happz

Blocked by https://github.com/teemtee/tmt/issues/2721

happz avatar Dec 13 '24 10:12 happz