Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for disk.driver hardware requirement #2667

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

skycastlelily
Copy link
Collaborator

@skycastlelily skycastlelily commented Feb 4, 2024

Pull Request Checklist

  • implement the feature
  • write the documentation
  • update the specification
  • modify the json schema
  • mention the version
  • include a release note

@skycastlelily
Copy link
Collaborator Author

fix #2546

@happz happz added the hardware label Feb 5, 2024
@happz happz added this to the 1.32 milestone Feb 5, 2024
spec/hardware/bootdisk.fmf Outdated Show resolved Hide resolved
spec/hardware/bootdisk.fmf Outdated Show resolved Hide resolved
Copy link
Collaborator

@psss psss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for drafting the new hardware spec key. Added a couple of comments.

spec/hardware/bootdisk.fmf Outdated Show resolved Hide resolved
spec/hardware/bootdisk.fmf Outdated Show resolved Hide resolved
tmt/schemas/provision/hardware.yaml Outdated Show resolved Hide resolved
@thrix
Copy link
Collaborator

thrix commented Feb 20, 2024

@skycastlelily could you look at the comments so we can make it into this release pls?

@skycastlelily
Copy link
Collaborator Author

Thanks for drafting the new hardware spec key. Added a couple of comments.

Thanks for your review,updated accordingly:)

spec/hardware/bootdisk.fmf Outdated Show resolved Hide resolved
@skycastlelily
Copy link
Collaborator Author

could you look at the comments so we can make it into this release pls?

Sure, talked with @happz in the artemis ticket and implemented accordingly.

tmt/hardware.py Outdated Show resolved Hide resolved
tmt/hardware.py Outdated Show resolved Hide resolved
@skycastlelily
Copy link
Collaborator Author

skycastlelily commented Feb 21, 2024 via email

spec/hardware/bootdisk.fmf Outdated Show resolved Hide resolved
@skycastlelily
Copy link
Collaborator Author

skycastlelily commented Feb 22, 2024 via email

@happz
Copy link
Collaborator

happz commented Feb 23, 2024

If I put driver: virtio_blk into my plan, I might get an OpenStack VM.
As you can see from the link I sent in the artemis ticket, root-device property won't accept a driver param.

Yes, I am aware of that. Yet, both "boot disk" and "root disk" describe very similar concept, I don't see much difference between them. Not enough to have one key for "boot disk" and another for "root disk" when we can have just one.

To be specific, the params supported by beaker's BOOTDISK and openstack's root-device are totally different, though I also do feel they are describing a same thing. https://docs.openstack.org/ironic/queens/install/advanced.html#specifying-the-disk-for-deployment-root-device-hints

Yes, I see the overlap too. And I am aware of the difference, but you can look at it as Beaker being a subset of what OpenStack (or AWS and Azure) accept: you may ask OpenStack to give you a VM whose boot disk/root disk requires a particular driver. In this sense, what you propose based on your OpenStack experience can easily cover Beaker as well.

Let's ignore the implementation in various drivers for now, and focus on
clean, correct, and easy-to-understand specifications
You mean I only need to change the bootdisk.fmf, right?

Yes, I would focus on making the specification right for now, without looking into actual implementations in mrack.py or Artemis. Let's define the boot-disk key first.

I think we can handle openstack's root-device after I extend disk.fmf or implement device.fmf,which would be commonly used,and BOOTDISK is only for a small group of users.

Ok, then the question is whether we do need boot-disk after all. :) If you can see a way to define "root disk" requirements under disk, then maybe we can do the same with "boot disk". For example:

# "Give me a disk of this size"
# Historically, we did not care whether it was a boot disk or a root disk. It probably was.
disk:
  - size: ">= 20 GB"

# New requirements, trying to pin the `disk` to a particular type of disk as seen by the guest.
# With Artemis, this would be directed to Beaker. tmt's `virtual` might be able to create this
# `mrack` would translate it to Beaker XML, everyone's happy.
disk:
  - boot-disk: true
    driver: pcieport
    size: ">= 20 GB"

# This you can get from Beaker or OpenStack, or any cloud delivering KVM-backed VMs. Again, everyone's happy.
disk:
  - boot-disk: true
    driver: virtio_blk
    size: ">= 20 GB"

# Artemis would send this to OpenStack, based on `wwn` key, `mrack` would tell you `wwn` is unsupported & it would try to at least get you Seagate disk, and `virtual` might try to emulate the Seagate.
disk:
  - root-disk: true
    wwn: 0x4000cca77fc4dba
    vendor: Seagate

@skycastlelily
Copy link
Collaborator Author

skycastlelily commented Feb 23, 2024 via email

@happz
Copy link
Collaborator

happz commented Feb 23, 2024

Yes, I am aware of that. Yet, both "boot disk" and "root disk" describe very similar concept, I don't see much difference between them. Not enough to have one key for "boot disk" and another for "root disk" when we can have just one

Yes,they are very similar concepts, but in beaker,BOOTDISK is for those users who want to test a specific driver or port type,as there is no disk.driver property. Typically,users can do some translate work,like find all the disk models which provide,say driver, megaraid_sas,and write plan like below,if we offer code to handle model-name as an or-list,but I guess we should NOT handle it like that. disk: model-name: model-name-a|model-name-b|.... I was NOT thinking of handling root-disk property by adding root-disk:true,I was planning to handle it like this: if there is only one disk specified, then we pass that one to root-device,if there are more than one disk is specified,then we pass the first one. But beaker'BOOTDISK doesn't fit disk well,as BOOTDISK'properties( or,more exactly, property) are supposed to be string,while disk's properties are supposed to be dict,so we need BOOTDISK merge requests to avoid complexity: )

And I think this is the crucial point: "beaker'BOOTDISK doesn't fit disk well,as BOOTDISK'properties( or,more exactly, property) are supposed to be string" - Beaker's BOOTDISK. That does not mean it has to be a simple string in our specifications...

What BOOTDISK really means is the following: "I want a machine with boot disk based on this driver" - and we already have a way to express "I want a machine with X based on this driver" in our toolbox, we use driver key to specify such a request. So to me, this sounds like our specification should follow the established road and use driver: ... when expressing what Beaker calls BOOTDISK. The value would be a simple string, but instead of a new, dedicated key, we should add driver key to disk. The Beaker plugin would then translate it into Beaker's language & emit one simple element.

I was NOT thinking of handling root-disk property by adding root-disk:true,I was planning to handle it like this: if there is only one disk specified, then we pass that one to root-device,if there are more than one disk is specified,then we pass the first one.

Ok, that's pretty much how disk is treated today, the first item speaks about the first disk and so on. No problem there. With the driver addition, we'd get back to the following proposal, just without the root-disk/boot-disk keys we don't need:

disk:
  - size: ">= 60 GB"
    driver: virtio_blk
    # Or:
    driver: nvme

    # And, of course, in the future, we can also add support for other well-established keys (not necessarily here and now):
    vendor-name: Seagate
    ...

    # Or add more keys to support less common disk properties:
    wwm: 0x...

This would make perfect sense to me. It would be obvious what I'm looking for - Nth disk shall be using a given driver -, we would rely on keys already defined elsewhere for the very same concepts, and it would be easy to extend plugins to materialize the disk[].driver requirement.

Basically, this would be my bet at this moment. It seems much more fitting than a new key, especially because it's re-using what we already defined for other subsystems.

I think you professional has already spent way more than enough time on this tiny merge request,

I don't see it as a waste of time. This is literally my job, to build tools for testing stuff ;) And that requires discussions, reviews, dropping ideas, and inventing new ones when necessary. This is a discussion of how to do something in the best way possible, and that's useful. Especially for me, I never used root disk with OpenStack or BOOTDISK with Beaker, and this helped me gain more insight.

I bet you have lots of more important work to handle, at least from my side,we have guest-log(my mrack log merge request has already been merged), boot.method,and virtualization,etc,how about merge this ,and let it go?: )

Well, I for one would not be very happy about merging it as is & "let it go". There are loose ends and open topics that should be resolved, merging the patch without doing so for the sake of cleaning one's table would not be right. Those topics won't disappear, and we will be committed to implementing and supporting something that's not done properly. This is not a hot-fix patch, we do have time to discuss things. I'd like there to be a mutual understanding of where this is heading and how things should be designed to deliver good UX and a well-designed tool.

@skycastlelily
Copy link
Collaborator Author

skycastlelily commented Feb 26, 2024 via email

@happz
Copy link
Collaborator

happz commented Feb 26, 2024

That does not mean it has to be a simple string in our specifications...
Yeah,I know,but as you know, openstack root-device also won't accept a driver param, if we use disk.driver to implement BOOTDISK, it won't benefit anyone

I disagree :) It would benefit everyone in the sense that an existing concept, "I wish the guest to have a device with a given driver", would be extended to a new device class, disk, using the already established language, driver. The specification would remain consistent, one thing would be expressed with the same wording for network, device, gpu, or disk.

and will make it a little inconvenient to BOOTDISK users

Maybe, yes, they will have to write the following:

disk:
  - driver: ...

To me, the consistency wins over a bit of verbosity.

though we don't need add new key, we do need add a new subkey ,so I didn't propose that in my comments,but I believe you professional have better viewpoint than me. So, am I supposed to update this merge request accordingly after the disk model-name merge request is merged,or should I send another commit in the disk-model mr?:)

Yes, that would be my recommendation, to update this PR to add the driver key into disk specification, instead of a dedicated boot_disk key. Please, don't add this as a new commit to the disk.model-name PR, let's have PRs that focus one one particular change.

@skycastlelily
Copy link
Collaborator Author

skycastlelily commented Feb 27, 2024 via email

@psss
Copy link
Collaborator

psss commented Feb 27, 2024

@happz, thanks for the detailed analysis, I agree with your approach. It makes sense to keep design of the specification as consistent as possible. From my point of view, extending the existing disk field makes the most sense for this use case.

@skycastlelily
Copy link
Collaborator Author

Rebased and updated:)

@happz happz self-requested a review February 28, 2024 14:36
Copy link
Collaborator

@psss psss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this. I've just slightly adjusted the release note and spec in 6406f7c.

@psss psss added specification full test Pull request is ready for the full test execution labels Mar 5, 2024
@psss psss changed the title Support BOOTDISK key/value Add support for disk.driver hardware requirement Mar 5, 2024
@psss psss self-assigned this Mar 5, 2024
@skycastlelily
Copy link
Collaborator Author

skycastlelily commented Mar 5, 2024 via email

@psss
Copy link
Collaborator

psss commented Mar 5, 2024

/packit test

@psss psss merged commit c1e75f7 into teemtee:main Mar 5, 2024
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full test Pull request is ready for the full test execution hardware specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants