mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
fix(host): run ifdown script on guest delete (#23101)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user