tritonadm cn traits
tritonadm cn traits reads and changes a compute node's placement traits. A compute
node (CN) with traits takes only requests whose trait keys are exactly its own.
Execution context
Every command is an HTTP call against tritond, from any host with a configured
tritonadm. <CN> is a hostname, UUID, or UUID prefix. Changes need fleet-operator
rights.
Synopsis
tritonadm cn traits show <CN>
tritonadm cn traits set <CN> <KEY=VALUE>...
tritonadm cn traits unset <CN> <KEY>...
tritonadm cn traits show
Prints server_uuid, traits (as key=value pairs, or (none)), and labels.
tritonadm cn list and tritonadm cn show also print each CN's traits.
tritonadm cn traits set
Merges the pairs into the CN's traits. Other traits stay. Give at least one pair.
Value syntax
| Form | Stored as | Example |
|---|---|---|
true or false | Bool | sandbox=true |
[a,b], or JSON ["a","b"] | List of strings. Items are trimmed. [] is refused. | pool=[vm,sandbox] |
| A JSON string in double quotes | That string | kind='"true"' stores the string true |
| Anything else | String | gpu=a100 |
Output quotes a string that would read back as another type, so printed values round-trip.
Limits
tritonadm refuses a malformed pair before it sends anything: a pair with no =, a
key outside the key rule, or a value outside the value rules. The server checks the
merged map, and refuses a 33rd trait with traits: at most 32 traits.
| Limit | Value |
|---|---|
| Traits per CN | 32 |
| Key | 1 to 64 characters: letters, digits, -, _, ., :, / |
| String value | 1 to 128 bytes, no control characters |
| List value | 1 to 32 strings |
A CN can carry cpu-class and disk-class as traits. A CN for an nvme package
carries disk-class=nvme.
tritonadm cn traits unset
Removes traits by key. Give at least one key. A CN with no traits left takes only requests with no traits.
Matching rule
Placement uses the legacy Triton exact-key rule:
- A CN takes a request only when the CN's trait keys are exactly the request's keys, and every value matches.
- A request with no traits goes only to a CN with no traits.
| Request value | CN value | Match when |
|---|---|---|
| Bool | Bool | Equal |
| Bool | String or list | Never |
| String | String | Equal |
| String | List | The list holds the string |
| List | String | The request list holds the CN's string |
| List | List | The two lists share a member |
| String or list | Bool | Never. Refused as an unsupported combination. |
Where request traits come from
| Request | Traits |
|---|---|
| Instance or sandbox with a package | The traits of the package version it was made with |
Operator instance create with traits | Those traits, which replace the package's whole |
| VM with no package traits | placement.default_vm_traits |
| Platform zones: NAT gateways, SSH relays, load balancers, NAS gateways | placement.default_vm_traits |
A package's cpu_class and disk_class, when not generic, add the keys cpu-class
and disk-class to the request.
Only a fleet operator can send traits on an instance create, through the admin API.
Anyone else gets traits can be set only by an operator; choose a package instead. No
tritonadm or tritonctl flag sets them. A request may hold at most 30 traits, and
may not name cpu-class or disk-class.
A package update makes a new version. Existing instances keep the traits of the version they were made with.
Exceptions
- A migration to a target CN that a fleet operator names skips the trait check. A target that a tenant names does not.
- An operator create pinned to a CN with
?cn=does not skip the check. Give it traits that the CN takes.
Refusal reasons
A refused placement names the trait in the explain report, under the filter
cn-traits-match. The reasons follow the legacy wording. A key mismatch reads:
the request has no traits but the CN has {...}
the request needs traits {...} but the CN has {...}
A value mismatch reads <KEY> comparison failed: <REASON>, where <REASON> is one of:
| Reason | Request value | CN value |
|---|---|---|
undefined property | Any | Key missing |
boolean did not match | Bool | Another bool, a string, or a list |
strings did not match | String | String |
server trait array did not contain trait | String | List |
server trait was not in requested trait array | List | String |
server and requested trait arrays do not intersect | List | List |
unsupported combination of property types | String or list | Bool |