I’m enabling a .top file that maps specific qube names to states (e.g. user: ‘myqube’: - mystate). I expect to run a single command (e.g. qubesctl --all state.highstate or state.show_highstate) that reads the enabled tops and only targets the qubes listed there.
Instead, qubesctl --all (and show_highstate) launches a mgmt VM for every non‑dom0 qube, even though the top file explicitly names which qubes should get states. Is there a way to have qubesctl evaluate the enabled top files in dom0 and only start mgmt VMs for qubes that the top actually matches i.e., target based on the top file without spinning up all VMs? If not, is there a recommended way to do this without explicitly having to write on the command line which qubes to target?
That should be the case normally. Are you sure you don’t have some states assigned to other qubes too? Maybe something targeting * or something, even a no-op state will cause target vm to be started, only qubes that don’t have any states assigned are skipped.
You can debug it by showing top for a given target, for example:
Running the command sudo qubectl --all state.highstate does skip all the ones that are not targeted. Only mgmt VMs for qubes targeted in my test.top are started.
However sudo qubectl --all state.show_highstate still starts a mgmt VM for every qube on the system which is what I was running previously to test targeting.
All in all I found the solution to my question as state.highstate does what I wanted despite targeting --all.