Skip to main content

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​

FormStored asExample
true or falseBoolsandbox=true
[a,b], or JSON ["a","b"]List of strings. Items are trimmed. [] is refused.pool=[vm,sandbox]
A JSON string in double quotesThat stringkind='"true"' stores the string true
Anything elseStringgpu=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.

LimitValue
Traits per CN32
Key1 to 64 characters: letters, digits, -, _, ., :, /
String value1 to 128 bytes, no control characters
List value1 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 valueCN valueMatch when
BoolBoolEqual
BoolString or listNever
StringStringEqual
StringListThe list holds the string
ListStringThe request list holds the CN's string
ListListThe two lists share a member
String or listBoolNever. Refused as an unsupported combination.

Where request traits come from​

RequestTraits
Instance or sandbox with a packageThe traits of the package version it was made with
Operator instance create with traitsThose traits, which replace the package's whole
VM with no package traitsplacement.default_vm_traits
Platform zones: NAT gateways, SSH relays, load balancers, NAS gatewaysplacement.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:

ReasonRequest valueCN value
undefined propertyAnyKey missing
boolean did not matchBoolAnother bool, a string, or a list
strings did not matchStringString
server trait array did not contain traitStringList
server trait was not in requested trait arrayListString
server and requested trait arrays do not intersectListList
unsupported combination of property typesString or listBool

See also​