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

This commit is contained in:
wanyaoqi
2025-08-16 14:49:37 +08:00
committed by GitHub
parent f0e76d18fd
commit 1ae79f45da
+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)
}