diff --git a/src/admin/server.rs b/src/admin/server.rs index 74d7551..1c02fda 100644 --- a/src/admin/server.rs +++ b/src/admin/server.rs @@ -224,6 +224,10 @@ impl AdminServiceImpl { } pub async fn handle_error(&self, entry: RegistryEntry) -> anyhow::Result<()> { + info!( + "Handling error for {} vm type {} service type {}", + entry.name, entry.r#type.vm, entry.r#type.service + ); match (entry.r#type.vm, entry.r#type.service) { (VmType::AppVM, ServiceType::App) => { if entry.status.is_exitted() { @@ -233,10 +237,11 @@ impl AdminServiceImpl { Ok(()) } (VmType::AppVM, ServiceType::Mgr) | (VmType::SysVM, ServiceType::Mgr) => { - let name = parse_service_name(&entry.name)?; - self.start_vm(name) - .await - .with_context(|| format!("handing error, by restart VM {}", entry.name))?; + if let Placement::Managed { vm: vm_name, .. } = entry.placement { + self.start_vm(&vm_name) + .await + .with_context(|| format!("handing error, by restart VM {}", entry.name))?; + } Ok(()) // FIXME: should use `?` from line above, why it didn't work? } (x, y) => {