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
{{ message }}
Repository navigation
Tracking issue for RFD 739 (Instance restart during live update) #11169
Add a new column on the vmm table to mark that we are stopping the VMM for an update. Instead of making it a boolean, we should use the update_disposition generation so that it's clear when this action was triggered. - [update] Marker for VMMs stopped by an update #11127
Create a new policy for the instance reincarnation background task. It should now reincarnate instances that meet these three criteria: (1) they’re in the Stopped state, (2) the reason they are stopped is due to a system update, and (3) the intended state is not Stopped. We want to make sure they are not intended to be Stopped because that would mean a user stopped them deliberately. [live-update] Modify instance reincarnation to account for sled evacuations #11504
Omdb command to be able to test functionality and operational knobs.
Have a separate "successive restarts" cooldown policy for instances that were restarted due to an update (5 mins), and the rest (1 hr)
I have a few thoughts about the 4th task in the list here (Modify the instance update saga to account for VMMs that stopped due to an update).
The first idea was to have a marker on the Instance struct to record that it is eligible for a restart that is similar to the stop_for_update_disposition_generation field on the Vmm one.
This approach has several problems:
If we set a check constraint on the table where this marker can only be set if the state is NoVmm, we can have db errors if the background task for stopping the VMMs races with sled-agent notifying Nexus to update the instance with the NoVmm state. We could integrate the logic for updating this field within the notify_vmm_updated method, but that may overcomplicate the logic there, and we also have the instance watcher background task and sled agent trying publish the new state to Nexus. There are just too many possibilities of a race here.
If we don't set the check constraint we have the same risks of adding the marker when the instance is not in the correct state.
Unlike the Vmm marker, which just stays marked once the VMM is gone, we would also have to add logic to remove that marker. And what happens if the task to "un-mark" that field fails? We can end up with all sorts of unexpected behaviour due to a borked state/marker mix.
NoVmm is part of InstanceState::NOT_INCARNATED_STATES. This constant is used to allow users to update cpu/memory and change the boot disk when the instance is in one of these states. We may want to allow users to update these parameters during an update in the future, but for now we should take small steps. During an update there are a lot of things going on, we should be conservative and disallow these changes to start with. Once we see the process running smoothly we can relax these constraints and allow users to update cpu/memory/boot disk during an update.
Other actions like disk attach/detach, deletion, NIC changes and external IP attaches allow changes when the Instance is in a NoVmm state. for the same reasons above, we want to disallow those actions during an update for now.
My second idea was to modify the NoVmm state to contain the marker within it, turn it into NoVmm { pending_reincarnation: Option<UpdateDispositionGeneration> }. With this option we avoid all of the racy implications of the previous option, but it leaves one. We would have to handle the case of making a change to the same state when a user actually stops the instance after the stopping background task has used the sled-agent/nexus machinery to set pending_reincarnation to Some(_).
The more I think about it this pending_reincarnation field feels more and more like a distinct state. We would certainly be treating it as one.
My proposal here is to create a new InstanceState::NoVmmPendingReincarnation (or some other better name) state.
The more I think about it this pending_reincarnation field feels more and more like a distinct state. We would certainly be treating it as one.
My proposal here is to create a new InstanceState::NoVmmPendingReincarnation (or some other better name) state.
@karencfv at a glance, I think the idea of a new state makes sense to me, especially because I agree that we probably want to assess what operations can be performed on instances in this state separately from those that are Stopped, as you discussed. I also think the idea of a whole new InstanceState makes sense here because I think these instances should show up in the external API as Rebooting, rather than Stopped: I think we should be communicating to the user that the instance is not running at this time but that we are going to restart it for you automatically, and I'd like it if we preserved the semantics of Stopped instances not spontaneously restarting themselves. A separate internal InstanceState variant makes mapping it to a different external API state than NoVmm easy.
Personally, I'd probably call the new internal state StoppedForEvacuation, or even just Evacuated. I think the name of the state should probably not say that it was for an update, since I imagine we might want to reuse the same behavior if we were to add an "evacuate a sled and restart its instances elsewhere in order to perform maintenance on that sled" operator action, which it sounds like some customers would like.
Activity
[reconfigurator] background task for marking VMMs to be stopped for u…
karencfv commentedon Oct 13, 2026
I have a few thoughts about the 4th task in the list here (Modify the instance update saga to account for VMMs that stopped due to an update).
The first idea was to have a marker on the
Instancestruct to record that it is eligible for a restart that is similar to thestop_for_update_disposition_generationfield on theVmmone.This approach has several problems:
NoVmm, we can have db errors if the background task for stopping the VMMs races with sled-agent notifying Nexus to update the instance with theNoVmmstate. We could integrate the logic for updating this field within thenotify_vmm_updatedmethod, but that may overcomplicate the logic there, and we also have the instance watcher background task and sled agent trying publish the new state to Nexus. There are just too many possibilities of a race here.Vmmmarker, which just stays marked once the VMM is gone, we would also have to add logic to remove that marker. And what happens if the task to "un-mark" that field fails? We can end up with all sorts of unexpected behaviour due to a borked state/marker mix.NoVmmis part ofInstanceState::NOT_INCARNATED_STATES. This constant is used to allow users to update cpu/memory and change the boot disk when the instance is in one of these states. We may want to allow users to update these parameters during an update in the future, but for now we should take small steps. During an update there are a lot of things going on, we should be conservative and disallow these changes to start with. Once we see the process running smoothly we can relax these constraints and allow users to update cpu/memory/boot disk during an update.NoVmmstate. for the same reasons above, we want to disallow those actions during an update for now.My second idea was to modify the
NoVmmstate to contain the marker within it, turn it intoNoVmm { pending_reincarnation: Option<UpdateDispositionGeneration> }. With this option we avoid all of the racy implications of the previous option, but it leaves one. We would have to handle the case of making a change to the same state when a user actually stops the instance after the stopping background task has used the sled-agent/nexus machinery to setpending_reincarnationtoSome(_).The more I think about it this
pending_reincarnationfield feels more and more like a distinct state. We would certainly be treating it as one.My proposal here is to create a new
InstanceState::NoVmmPendingReincarnation(or some other better name) state.Thoughts? @hawkw @jgallagher @davepacheco @sunshowers
hawkw commentedon Oct 13, 2026
@karencfv at a glance, I think the idea of a new state makes sense to me, especially because I agree that we probably want to assess what operations can be performed on instances in this state separately from those that are
Stopped, as you discussed. I also think the idea of a whole newInstanceStatemakes sense here because I think these instances should show up in the external API asRebooting, rather thanStopped: I think we should be communicating to the user that the instance is not running at this time but that we are going to restart it for you automatically, and I'd like it if we preserved the semantics ofStoppedinstances not spontaneously restarting themselves. A separate internalInstanceStatevariant makes mapping it to a different external API state thanNoVmmeasy.Personally, I'd probably call the new internal state
StoppedForEvacuation, or even justEvacuated. I think the name of the state should probably not say that it was for an update, since I imagine we might want to reuse the same behavior if we were to add an "evacuate a sled and restart its instances elsewhere in order to perform maintenance on that sled" operator action, which it sounds like some customers would like.[reconfigurator] background task for stopping marked VMMs (#11380)
[live-update] adapt instance update saga to account for VMMs stopped …