provision-vm: log the old guest out of the tailnet before the wipe, so an ephemeral reprovision keeps its plain name #76
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/nexus#76
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Dev VMs join the tailnet as ephemeral nodes, so a stale record is meant to disappear on its own. Measured today: a reprovision still lands the new machine as
<name>-1.provision-vmkexecs the running guest into the installer, so tailscaled never exits cleanly and never logs out; control then keeps the old ephemeral record for its normal 30 to 60 minutes of inactivity (Tailscale docs, "Ephemeral nodes", FAQ), which is longer than a reprovision takes. The new node registers while the old name is still held and gets the suffix. A cleansystemctl restart tailscaledon a running node keeps its identity and IP, so this is specific to the wipe path.Proposed change
Before
nixos-anywhere, when the old guest still answers over SSH,provision-vmrunstailscale logouton it. The docs state this removes an ephemeral node immediately, and the module's identity unit is the only joiner, so nothing on the old guest will re-join in the seconds before the wipe. Best effort: an unreachable guest (first provision, dead machine) skips the step with one printed line; a logout that errors (control already dropped the record, or the node is not ephemeral) is reported and ignored, since the wipe proceeds either way.Keep the step out of
rebuild-vm: a rebuild keeps tailscaled's state and never creates a new node.Done
Closing: the owner accepts the -1 suffix after a reprovision as cosmetic (the stale ephemeral record ages out on its own, and nothing keys on the node name). Reopen if a plain name after reprovision becomes a requirement.
i think it's still an issue we should solve
Closing as cosmetic again, this time with the fact the first close was missing.
The
<name>-1suffix is temporary, not permanent. Tailscale drops a stale ephemeral record after 30 to 60 minutes of inactivity, and the next join takes the plain name back — nix-dev reads as plainnix-devtoday. When this was reopened the expiry had not yet been observed, so the suffix looked like a lasting rename. It is not, and the ACL matches the tag rather than the node name, so the pre-wipe logout would buy tidiness for one window after a reprovision rather than fix anything that stays wrong.Nothing was built: master carries no
tailscalereference inscripts/, and there is no branch and no pull request.To reclaim a plain name by hand in the meantime: wait for the stale record to disappear,
sudo tailscale logout, then restarttailnet-identity.service.Two corrections to the body, for whoever reads this next:
provision-vmkexecs the running guest. It does not — kexec is excluded (scripts/provision-vm:137-138); the old guest is hard-killed bynew-vm --replace, which runsvirsh destroyand thenvirsh undefine(scripts/new-vm:207-211). The diagnosis is unaffected: tailscaled never exits cleanly on either path, so it never logs out.--replace, does not fix this. A clean tailscaled exit leaves the node registered, which is the same reason asystemctl restart tailscaledkeeps a node's identity and IP.Reopen if a plain name immediately after a reprovision becomes a requirement.
Closed as not planned.