Closed kvaps closed 4 years ago
This could possibly be implemented as a filter to the list command on the client side, but will have roughly O(n*m) time and space complexity for n objects with m properties (like the list command if all properties are included), since object properties were not designed to serve as an index for looking up the objects they are associated with. Implementing it on the controller side would serve little purpose, since the disadvantages of doing that outweigh any advantages this would have.
Anyway, this function would be quite usable for us, we're separating our nodes by roles and availability zones using aux-properties, it would be nice to have an ability to list all the nodes in one availability zone
BTW here is an example how to get at least somehow grepable output:
linstor -m n l | jq -rc '.[].nodes[] | "\(.name) \([ (.props[] | select(.key | contains("Aux"))) ] | from_entries)"' | sed -e 's/\([{}"]\|Aux\/\)//g' | tr : =
example output:
m1c4 side=a,moonshot=1
m1c5 side=a,moonshot=1
m1c6 side=a,hosting=true,moonshot=1
m1c7 side=b,hosting=true,moonshot=1
m1c8 side=b,hosting=true,moonshot=1
m1c9 side=b,hosting=true,moonshot=1
pve1
pve2
pve3
This could be very useful in many production cases. Multi-DC, fault domains etc.
Yes, it would be nice to have this this feature!
--props
and --show-aux-properties
was added with release 1.7.0 and 1.1.0
The same way like kubectl is working with kubernetes labels:
Get all nodes with
Aux/cluster
set:Get all nodes with
Aux/cluster=1
Show all aux properties for all nodes: