From 8955cd8e1d52adecc35c39ae509c8c868ffbd54d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Tue, 19 Dec 2023 13:28:22 +0800 Subject: [PATCH] fix(region): add log for skiped pending deleted vm (#19050) --- pkg/compute/models/guests.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/compute/models/guests.go b/pkg/compute/models/guests.go index 2a4a790d5d..6f83a854db 100644 --- a/pkg/compute/models/guests.go +++ b/pkg/compute/models/guests.go @@ -5553,6 +5553,9 @@ func (manager *SGuestManager) CleanPendingDeleteServers(ctx context.Context, use if len(guests[i].GetExternalId()) > 0 { iVm, err := guests[i].GetIVM(ctx) if err == nil && iVm.GetStatus() == api.VM_RUNNING { + if guests[i].Status != api.VM_DELETE_FAIL { + guests[i].SetStatus(userCred, api.VM_DELETE_FAIL, "vm status is running") + } continue } }