Earlier  
Posted Nick Remark
#openstack-nova - 2025-05-21
14:45:23 sean-k-mooney dansmith: right so you can requiest trait in the alias
14:45:36 bauzas but that requires PCI in placvement
14:45:48 dansmith bauzas: I only care about pci in placement :)
14:45:58 dansmith sean-k-mooney: I don't see that in the docs, can you link me?
14:46:03 bauzas ah, then provide device_spec with traits
14:46:13 bauzas and then request that trait thru the alias
14:46:17 bauzas https://docs.openstack.org/nova/latest/configuration/config.html#pci.device_spec
14:46:24 bauzas https://docs.openstack.org/nova/latest/configuration/config.html#pci.alias
14:46:40 dansmith ... I don't see in the docs how to request a trait with the alias
14:46:44 sean-k-mooney dansmith: https://github.com/openstack/nova/blob/master/nova/pci/request.py#L110-L115
14:46:55 dansmith them's not docs :)
14:47:04 sean-k-mooney dansmith: it may or may not be but it was added with the pci in placement feature
14:47:05 bauzas dansmith: there is a traits dict key that you can add
14:47:08 sean-k-mooney so it shoudl be in the spec
14:47:14 bauzas request. This field can only be used only if [filter_scheduler]pci_in_placement is enabled.
14:47:14 bauzas character outside of [A-Z0-9_] with a single ‘_’, and prefixing the name with CUSTOM_ if not yet prefixed. The maximum allowed length of a trait name is 255 character including the prefix. Every trait in traits requested in the alias ensured to be in the list of traits provided in the traits field of the [pci]device_spec when scheduling the
14:47:14 bauzas An optional comma separated list of Placement trait names requested to be present on the resource provider that fulfills this alias. Each trait can be a standard trait from os-traits lib or it can be an arbitrary string. If it is a non-standard trait then Nova will normalize the trait name by making it upper case, replacing any consecutive
14:47:14 bauzas traits
14:47:17 dansmith https://docs.openstack.org/nova/latest/configuration/extra-specs.html#pci_passthrough:alias
14:47:32 sean-k-mooney that is the wrong doc
14:47:41 bauzas you don't specify the trait explicitely
14:47:49 bauzas I mean in the flavor
14:47:52 dansmith ohhh, you mean an alias in _config_ can be a trait instead of a vendor/product?
14:48:03 bauzas the flavor only requests an amount of that alias
14:48:18 bauzas and that alias is defined by having a traits key in it
14:48:28 bauzas dansmith: yes
14:48:52 bauzas and device_spec allows you to tag with traits some PCI devices automatically
14:48:54 sean-k-mooney dansmith: correct you can use placement resouce classes + traits instead of vendor and product id
14:49:01 bauzas just add traits to the device_spec dict in question
14:49:16 dansmith I see, I thought we were talking about the alias in the request
14:49:29 sean-k-mooney in the flavor no
14:49:31 bauzas that's transparent to the user or to the API admin
14:49:36 dansmith so the doc for alias needs a trait example I guess
14:49:40 sean-k-mooney this is all intentioally hiden form the flavor
14:49:50 bauzas dansmith: we have the conf docs
14:49:54 sean-k-mooney dansmith: ya https://docs.openstack.org/nova/latest/admin/pci-passthrough.html#pci-tracking-in-placement is where i was expectin git
14:50:06 dansmith sean-k-mooney: I understand, and that's how I expected it to work, I just didn't see the path to that alias requesting one of multiple things
14:50:07 bauzas but indeed the examples don't show< it
14:50:15 sean-k-mooney or maybe here https://docs.openstack.org/nova/latest/admin/pci-passthrough.html#configuring-pci-aliases-for-users
14:50:24 dansmith we need one here: https://docs.openstack.org/nova/latest/configuration/config.html#pci.alias
14:50:45 dansmith because that says you can use traits, but doesn't give me an example to see where that is the only thing used
14:50:53 gibi I can add that doc if that helps getting reviews on the eventlet series :)
14:50:57 dansmith I'll try this locally and then document if it works
14:50:57 bauzas dansmith: at least that's documented below in the list of accepted keys
14:51:04 bauzas cool
14:51:16 dansmith bauzas: I understand (now), but obviously not obvious to me :)
14:51:23 bauzas dansmith: we tested that with Uggla when he was working on vfio-pci
14:51:26 bauzas should work
14:51:26 gibi (I assume it works there are functional test coverage on it)
14:51:43 sean-k-mooney ya so in the devspec you can advertise them https://specs.openstack.org/openstack/nova-specs/specs/zed/approved/pci-device-tracking-in-placement.html#pci-device-spec-configuration and in the aliss you can requet them but we dont have that in the doc today
14:51:43 bauzas Uggla can give you some examples
14:51:45 sean-k-mooney https://specs.openstack.org/openstack/nova-specs/specs/zed/approved/pci-device-tracking-in-placement.html#pci-alias-configuration
14:51:45 dansmith gibi: sorry, I'm not farting around for no reason, I'm trying to get some other important stuff tested and this is in my way.. I promise I'm not ignoring your series for unimportant reasons
14:52:00 gibi ack
14:52:06 dansmith sean-k-mooney: yeah I think I understand the glue path now
14:52:08 bauzas gibi: I'd be more than happy to give a shot to your series
14:52:21 bauzas provided my meeting of meetings is done
14:53:00 sean-k-mooney so in https://docs.openstack.org/nova/latest/configuration/config.html#pci.alias
14:53:11 sean-k-mooney we do mention traits but only provide the eexample of a resouce class
14:53:39 dansmith sean-k-mooney: right
14:53:57 dansmith which is really just vendor/model (by default) so it doesn't look helpful to someone looking for it
14:57:25 bauzas we need one more example, I agree
14:57:34 bauzas without the product/vendor ID need
14:57:59 bauzas but IIRC, we still need to somehow define them, right Uggla ?
14:59:31 Uggla Give me a sec, need to reload the context.
15:00:26 bauzas long story short, can we skip the vendor/product ID settings in the pci alias ? I think we had to do something like providing a star (*)
15:01:26 dansmith bauzas: star does not help me here
15:01:36 dansmith but as I said, I will test this example shortly
15:01:45 bauzas dansmith: I guess I understood your case
15:02:00 bauzas you wanna request a group of arbitrary pci devices by traits
15:02:37 bauzas that's why I'm saying you shouldn't provide vendor and product IDs in the alias definition or you would restrict that list
15:03:00 gibi yeah so if you have two different devices with different product id then you can whitelist them via address (with full or partial match on the address) and connect them the the same resource class in the whitelist, you can add traits there as well. Then you can request that resource class in the alias
15:03:06 bauzas but IIRC, when we wanted to do that thing, we found some limitation that we fixed somehow I can't recall (maybe a star or something else)
15:03:38 Uggla Yes I think in the alias section we can skip product / vendor and only use ressource class or trait.
15:03:39 gibi the key is that you can use the same RC in multiple device_spec lines
15:05:49 Uggla Yep I updated the documentation for the alias section to highlight that product_id / vendor_id are optional.
15:07:14 dansmith I don't see that
15:07:34 dansmith ...that they are optional.. I do see the class example
15:08:02 Uggla dansmith, https://docs.openstack.org/nova/latest/configuration/config.html --> alias --> A JSON dictionary which describe a PCI device.
15:08:18 dansmith gibi: traits would be better for me that RC.. if they use the same RC, then I can't do inventory planning based on RC, and also, I might want to still request via RC for specific devices, or traits for generic "just give me a 256G nvme"
15:08:20 gibi https://github.com/openstack/nova/blob/221a3e89e8988bc664298106ee691a4e41ca71f9/nova/tests/functional/libvirt/test_pci_in_placement.py#L1759-L1772
15:08:57 dansmith Uggla: yeah I said I see the example, just not that vendor/product is optional (as it says for traits and rc)
15:09:04 gibi dansmith: if you don't define the RC then the RC will be based on the product_id so you cannot have a single alias requesting it as a single alias cannot request two different RC
15:09:27 dansmith gibi: ... but I can request just a trait no?
15:10:14 Uggla dansmith, --> Note that [...] indicates optional field.
15:10:16 gibi you can request a set of traits
15:10:36 gibi but you need to eithe provide an RC or a product/vendor id in the alias
15:10:49 gibi otherwise we cannot createa placement allocation candidate query
15:11:56 dansmith Uggla: fine, but very not as obvious as: "resource_class: The **optional** Placement resource class name"
15:12:21 dansmith gibi: okay if that's the case then that's definitely not very well explained in the docs here
15:12:33 dansmith lemme try with just the trait so I can see what happens
15:12:36 gibi lets improve the doc
15:13:18 gibi if you provides just traits in the alias and no RC or vendor/product id then you will get that the alias is invalid
15:13:27 gibi (I hope : )
15:15:07 dansmith I do not, on service startup at least
15:15:13 Uggla dansmith, I agree it could be better.
15:18:52 gibi dansmith: it is validated when the alias is used
15:19:12 gibi it was true for before PCI in Placement time
15:19:43 dansmith gibi: so, I might be missing something but it looks to me like I was able to create a server and it just silently ignored my pci request
15:20:30 dansmith https://paste.opendev.org/show/bkADIKJZwFGSAv3UcXCF/

Earlier   Later