Skip to content

Commit

Permalink
gotta actually put the instance in the NoVmm state
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Jul 2, 2024
1 parent 3253447 commit d023a3b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nexus/src/app/sagas/instance_update/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use crate::app::db::datastore::InstanceSnapshot;
use crate::app::db::lookup::LookupPath;
use crate::app::db::model::Generation;
use crate::app::db::model::InstanceRuntimeState;
use crate::app::db::model::InstanceState;
use crate::app::db::model::MigrationState;
use crate::app::db::model::VmmState;
use crate::app::sagas::declare_saga_actions;
Expand Down Expand Up @@ -97,6 +98,7 @@ impl UpdatesRequired {
// handles migration updates, will set this to the new VMM's ID,
// instead.
new_runtime.propolis_id = None;
new_runtime.nexus_state = InstanceState::NoVmm;
update_required = true;
network_config = Some(NetworkConfigUpdate::Delete);
Some(PropolisUuid::from_untyped_uuid(active_vmm.id))
Expand Down Expand Up @@ -167,6 +169,10 @@ impl UpdatesRequired {
),
));
new_runtime.propolis_id = Some(migration.target_propolis_id);
// Even if the active VMM was destroyed (and we set the
// instance's state to `NoVmm` above), it has successfully
// migrated, so leave it in the VMM state.
new_runtime.nexus_state = InstanceState::Vmm;
let _prev_target_id = new_runtime.dst_propolis_id.take();
debug_assert_eq!(
_prev_target_id,
Expand Down

0 comments on commit d023a3b

Please sign in to comment.