Targets and name resolution
Most commands take a target. You rarely need to say which host runs a service: moira asks every host and picks the match.
| Form | Example | Meaning |
|---|---|---|
host/stack/service |
edge/shop/shop-prod |
Fully qualified |
host/name |
nas/shop-prod |
A container name, service name or stack on that host |
host/stack/ |
edge/shop/ |
The whole stack, even when a container or service has the same name |
name |
shop-prod |
Searched on every host: container name, then service name, then stack name |
How a bare name resolves
Section titled “How a bare name resolves”-
moira fetches the container list from every server, unmanaged containers included.
-
It collects matches, trying the container name first, then the Compose service name, then the stack name.
-
For actions, service matches are grouped by host and stack. A pin narrows the matches to its host when that host has one.
-
One match left: use it.
-
Several left: if exactly one is running, use it and print which one:
→ edge/shop/shop-prodOtherwise fail and list the candidates:
shop-prod matches 2 services:edge/shop/shop-prod runningnas/shop/shop-prod exiteduse edge/shop-prod, or: moira pin shop-prod edge
Actions never choose between two running copies, not even with --yes. Use a pin or a
host prefix.
update, apply and stop ask for confirmation when the target was chosen by the “single
running copy” rule, because an exited copy elsewhere was skipped.
Unreachable hosts
Section titled “Unreachable hosts”An unpinned bare name needs every host to answer before an action can run, because the
silent host might hold another running copy. A pinned bare name can use its pinned host while
others are down. If nothing matches and any host was unreachable, resolution fails with exit
code 3.
A pin says which host a bare name means:
moira pin shop-prod edgemoira unpin shop-prodPins live in the client config and are not synced between machines.
Whole stacks
Section titled “Whole stacks”moira status edge/shop/ # every service in the stackmoira restart edge/shop/ # asks for confirmationhost/name also resolves a stack by name when no container or service matches, including a
stack with no containers yet.
Replicas and one-off containers
Section titled “Replicas and one-off containers”- Service selectors group scaled replicas by Compose service. Selecting a replica by its container name for an action affects all replicas of that service, and moira asks for confirmation.
- One-off containers (
docker compose run) are excluded from service and stack selectors. Use the exact container name, orhost/<container-name>, to see their logs or status. They have no action target.
Hiding containers
Section titled “Hiding containers”Hide rows you don’t want in moira ls and the board, such as finished migrations or appliance
apps:
moira hide nas/shop-migratemoira show nas/shop-migratemoira ls --all # include hidden rowsHidden entries are stored as exact host/container selectors in the client config.