Skip to content

Commit

Permalink
address @gjcolombo's feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Jun 5, 2024
1 parent 7c95a23 commit ff808c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions nexus/db-model/src/vmm_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ impl From<VmmState> for omicron_common::api::external::InstanceState {
VmmState::Starting => Output::Starting,
VmmState::Running => Output::Running,
VmmState::Stopping => Output::Stopping,
VmmState::Stopped => Output::Stopped,
VmmState::Stopped | VmmState::SagaUnwound => Output::Stopped,
VmmState::Rebooting => Output::Rebooting,
VmmState::Migrating => Output::Migrating,
VmmState::Failed => Output::Failed,
VmmState::Destroyed | VmmState::SagaUnwound => Output::Destroyed,
VmmState::Destroyed => Output::Destroyed,
}
}
}
7 changes: 2 additions & 5 deletions nexus/src/app/sagas/instance_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ pub async fn instance_ip_get_instance_state(
// - starting: see below.
match (found_instance_state, found_vmm_state) {
// If there's no VMM, the instance is definitely not on any sled.
(InstanceState::NoVmm, _) => {
(InstanceState::NoVmm, _) | (_, Some(VmmState::SagaUnwound)) => {
sled_id = None;
}

Expand Down Expand Up @@ -329,10 +329,7 @@ pub async fn instance_ip_get_instance_state(
),
)));
}
(
InstanceState::Vmm,
Some(VmmState::Destroyed | VmmState::SagaUnwound),
) => {
(InstanceState::Vmm, Some(VmmState::Destroyed)) => {
return Err(ActionError::action_failed(Error::internal_error(
&format!(
"instance {} points to destroyed VMM",
Expand Down

0 comments on commit ff808c1

Please sign in to comment.