You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per title, would it be possible to filter machines by power address (BMC, iLO, iDRAC, etc.)?
In case anybody else wants this feature and comes across this request, at the moment, I can think of a couple of workarounds (of varying suitability):
Use tags. It isn't possible to partially match a tag (e.g. tag "192.168.1.10" won't be matched by a search for "192"), so it makes most sense to implement some sort of tagging scheme to achieve this, e.g. if you have a BMC network of 192.168.1.0/24 and a machine with a power address of 192.168.1.10, you could have "power:192.168.1.0/24" and "power:192.168.1.10" as tags for that machine.
Use jq in the CLI. This was thrown together quickly, but the following could be used to return the power parameters and "system_id" of every machine managed by MAAS:
for i in $(maas "$MAAS_USER" machines read | jq -r '.[].system_id'); do maas <LOGIN> machine power-parameters "$i" | jq ". + {\"system_id\": \"$i\"}"; done | jq -s
Alternatively, to filter by particular attributes, such as "power_type":
for i in $(maas "$MAAS_USER" machines read | jq -r '.[] | select(.power_type == "moonshot") | .system_id'); do maas <LOGIN> machine power-parameters "$i" | jq ". + {\"system_id\": \"$i\"}"; done | jq -s
Which can then further be filtered with jq. Of course, given that a power-parameters query is made for every MAAS machine, this is slow. Additionally, "system_id" is not a particularly human-readable attribute; including "fqdn", for example, would be much more useful. However, this is beyond the scope here.
Bug originally filed by jmcvaughn at https://bugs.launchpad.net/bugs/1938927
This comes from a customer request.
As per title, would it be possible to filter machines by power address (BMC, iLO, iDRAC, etc.)?
In case anybody else wants this feature and comes across this request, at the moment, I can think of a couple of workarounds (of varying suitability):
Use tags. It isn't possible to partially match a tag (e.g. tag "192.168.1.10" won't be matched by a search for "192"), so it makes most sense to implement some sort of tagging scheme to achieve this, e.g. if you have a BMC network of 192.168.1.0/24 and a machine with a power address of 192.168.1.10, you could have "power:192.168.1.0/24" and "power:192.168.1.10" as tags for that machine.
Use
jq
in the CLI. This was thrown together quickly, but the following could be used to return the power parameters and "system_id" of every machine managed by MAAS:Alternatively, to filter by particular attributes, such as "power_type":
These would return:
Which can then further be filtered with
jq
. Of course, given that apower-parameters
query is made for every MAAS machine, this is slow. Additionally, "system_id" is not a particularly human-readable attribute; including "fqdn", for example, would be much more useful. However, this is beyond the scope here.Reference to a case link: https://canonical.lightning.force.com/lightning/r/Case/5004K000009Vg1LQAS/view
The text was updated successfully, but these errors were encountered: