fix(host): run ifdown script on guest delete (#23102)

This commit is contained in:
wanyaoqi
2025-08-22 09:03:54 +08:00
committed by GitHub
parent 66587b4e52
commit f1f01ea823
+8
View File
@@ -2012,6 +2012,14 @@ func (s *SKVMGuestInstance) StartDelete(ctx context.Context, migrated bool) erro
s.ForceStop()
time.Sleep(time.Second * 1)
}
// ensure interface down
for i := range s.Desc.Nics {
scriptPath := s.getNicDownScriptPath(s.Desc.Nics[i])
out, err := procutils.NewRemoteCommandAsFarAsPossible("bash", scriptPath).Output()
if err != nil {
log.Errorf("failed run nic down script %s: %s", out, err)
}
}
return s.Delete(ctx, migrated, false)
}