<div dir="ltr"><div>Hi Jay!<br><br></div>I appreciate your comments, but I think you're approaching the problem from purely VM point of view. Things simply don't work the same way in bare metal, at least not if we want to provide the same user experience.<br><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 22, 2017 at 2:25 PM, Jay Pipes <span dir="ltr"><<a href="mailto:jaypipes@gmail.com" target="_blank">jaypipes@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sorry for delay, took a week off before starting a new job. Comments inline.<span class=""><br>
<br>
On 10/16/2017 12:24 PM, Dmitry Tantsur wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
I promised John to dump my thoughts on traits to the ML, so here we go :)<br>
<br>
I see two roles of traits (or kinds of traits) for bare metal:<br>
1. traits that say what the node can do already (e.g. "the node is<br>
doing UEFI boot")<br>
2. traits that say what the node can be *configured* to do (e.g. "the node can<br>
boot in UEFI mode")<br>
</blockquote>
<br></span>
There's only one role for traits. #2 above. #1 is state information. Traits are not for state information. Traits are only for communicating capabilities of a resource provider (baremetal node).<br></blockquote><div><br></div><div>These are not different, that's what I'm talking about here. No users care about the difference between "this node was put in UEFI mode by an operator in advance", "this node was put in UEFI mode by an ironic driver on demand" and "this node is always in UEFI mode, because it's AARCH64 and it does not have BIOS". These situation produce the same result (the node is booted in UEFI mode), and thus it's up to ironic to hide this difference.</div><div><br></div><div>My suggestion with traits is one way to do it, I'm not sure what you suggest though.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
For example, let's say we add the following to the os-traits library [1]<br>
<br>
* STORAGE_RAID_0<br>
* STORAGE_RAID_1<br>
* STORAGE_RAID_5<br>
* STORAGE_RAID_6<br>
* STORAGE_RAID_10<br>
<br>
The Ironic administrator would add all RAID-related traits to the baremetal nodes that had the *capability* of supporting that particular RAID setup [2]<br>
<br>
When provisioned, the baremetal node would either have RAID configured in a certain level or not configured at all. <br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
A very important note: the Placement API and Nova scheduler (or future Ironic scheduler) doesn't care about this. At all. I know it sounds like I'm being callous, but I'm not. Placement and scheduling doesn't care about the state of things. It only cares about the capabilities of target destinations. That's it.<span class=""><br></span></blockquote><div><br></div><div>Yes, because VMs always start with a clean state, and hypervisor is there to ensure that. We don't have this luxury in ironic :) E.g. our SNMP driver is not even aware of boot modes (or RAID, or BIOS configuration), which does not mean that a node using it cannot be in UEFI mode (have a RAID or BIOS pre-configured, etc, etc).<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This seems confusing, but it's actually very useful. Say, I have a flavor that<br>
requests UEFI boot via a trait. It will match both the nodes that are already in<br>
UEFI mode, as well as nodes that can be put in UEFI mode.<br>
</blockquote>
<br></span>
No :) It will only match nodes that have the UEFI capability. The set of providers that have the ability to be booted via UEFI is *always* a superset of the set of providers that *have been booted via UEFI*. Placement and scheduling decisions only care about that superset -- the providers with a particular capability.<span class=""><br></span></blockquote><div><br></div><div>Well, no, it will. Again, you're purely basing on the VM idea, where a VM is always *put* in UEFI mode, no matter how the hypervisor looks like. It is simply not the case for us. You have to care what state the node is, because many drivers cannot change this state.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This idea goes further with deploy templates (new concept we've been thinking<br>
about). A flavor can request something like CUSTOM_RAID_5, and it will match the<br>
nodes that already have RAID 5, or, more interestingly, the nodes on which we<br>
can build RAID 5 before deployment. The UEFI example above can be treated in a<br>
similar way.<br>
<br>
This ends up with two sources of knowledge about traits in ironic:<br>
1. Operators setting something they know about hardware ("this node is in UEFI<br>
mode"),<br>
2. Ironic drivers reporting something they<br>
2.1. know about hardware ("this node is in UEFI mode" - again)<br>
2.2. can do about hardware ("I can put this node in UEFI mode")<br>
</blockquote>
<br></span>
You're correct that both pieces of information are important. However, only the "can do about hardware" part is relevant to Placement and Nova.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
For case #1 we are planning on a new CRUD API to set/unset traits for a node.<br>
</blockquote>
<br></span>
I would *strongly* advise against this. Traits are not for state information.<br>
<br>
Instead, consider having a DB (or JSON) schema that lists state information in fields that are explicitly for that state information.<br>
<br>
For example, a schema that looks like this:<br>
<br>
{<br>
"boot": {<br>
"mode": <one of 'bios' or 'uefi'>,<br>
"params": <dict><br>
},<br>
"disk": {<br>
"raid": {<br>
"level": <int>,<br>
"controller": <one of 'sw' or 'hw'>,<br>
"driver": <string>,<br>
"params": <dict><br>
}, ...<br>
},<br>
"network": {<br>
...<br>
}<br>
}<br>
<br>
etc, etc.<br>
<br>
Don't use trait strings to represent state information.<br></blockquote><div><br></div><div>I don't see an alternative proposal that will satisfy what we have to solve.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Best,<br>
-jay<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Case #2 is more interesting. We have two options, I think:<br>
<br>
a) Operators still set traits on nodes, drivers are simply validating them. E.g.<br>
an operators sets CUSTOM_RAID_5, and the node's RAID interface checks if it is<br>
possible to do. The downside is obvious - with a lot of deploy templates<br>
available it can be a lot of manual work.<br>
<br>
b) Drivers report the traits, and they get somehow added to the traits provided<br>
by an operator. Technically, there are sub-cases again:<br>
b.1) The new traits API returns a union of operator-provided and<br>
driver-provided traits<br>
b.2) The new traits API returns only operator-provided traits; driver-provided<br>
traits are returned e.g. via a new field (node.driver_traits). Then nova will<br>
have to merge the lists itself.<br>
<br>
My personal favorite is the last option: I'd like a clear distinction between<br>
different "sources" of traits, but I'd also like to reduce manual work for<br>
operators.<br>
<br>
A valid counter-argument is: what if an operator wants to override a<br>
driver-provided trait? E.g. a node can do RAID 5, but I don't want this<br>
particular node to do it for any reason. I'm not sure if it's a valid case, and<br>
what to do about it.<br>
<br>
Let me know what you think.<br>
<br>
Dmitry<br>
</blockquote>
<br></span>
[1] <a href="http://git.openstack.org/cgit/openstack/os-traits/tree/" rel="noreferrer" target="_blank">http://git.openstack.org/cgit/<wbr>openstack/os-traits/tree/</a><br>
[2] Based on how many attached disks the node had, the presence and abilities of a hardware RAID controller, etc<div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<wbr>______________________________<wbr>______________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.op<wbr>enstack.org?subject:unsubscrib<wbr>e</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k-dev</a><br>
</div></div></blockquote></div><br></div></div></div></div></div>