zone-setup
service could be more helpful in the switch zone
#6157
Labels
Sled Agent
Related to the Per-Sled Configuration and Management
As part of #6149 and the fix in #6152, I spent a lot of time looking at the
zone-setup
binary and the relatedzone-network-setup
SMF service. This code, specifically thezone-setup common-networking
subcommand, runs in all the zones at startup, and does a few things:/etc/hosts
with a few convenience addressesThis works for most zones because we know all their networking information when they start. For example, for CockroachDB zones, the sled-agent does not launch the zone until we already have the static underlay address that it's server needs to listen on.
The switch zone is different. It's required for bootstrapping the rest of the control plane. In this case, the
zone-setup
service is provided with only the static address::1
, and so cannot create the underlay IP address inside the zone. In fact, it currently requires that the sled-agentzlogin
to the zone later to add that underlay IP address in order to complete -- theroute add
command will retry until that's done, because it will fail since the sled-agent's underlay IP isn't on a directly-connected network (i.e., the same sled `/64).So in the case of the switch zone, there's an inherent overlap in the responsibilities of the
zone-network-setup
service and the sled-agent. It would be nice to sort these out a bit more, and in the spirit of the big thread of work to make the zones self-assembling, completely remove the need for the sled-agent tozlogin
into the zone to create the underlay address.I'm sure there are many ways to do this. One approach would be to have a different
zone-setup
subcommand that runs in the switch zone, which is (more) persistent rather than one-shot. For example, instead of logging into the zone, the sled-agent could add the underlay address to the SMF properties and then refresh the service. Thezone-setup
binary could watch for this refresh, reread its SMF properties, and ensure that whatever new values it gets are applied. Note that the sled agent currently adds the same default route as thezone-setup
binary -- this would be removed in this proposal, since thezone-setup
binary's attempt to add a default route cannot work until it has that address anyway.The text was updated successfully, but these errors were encountered: