From bc2319995188335656586ceed2f657d10273ff3d Mon Sep 17 00:00:00 2001 From: Zexi Li Date: Wed, 15 Feb 2023 12:44:29 +0800 Subject: [PATCH] fix(baremetal): only do status probe job when host_type is hypervisor --- pkg/baremetal/manager.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/baremetal/manager.go b/pkg/baremetal/manager.go index 48d0f33d6e..ed89deeb52 100644 --- a/pkg/baremetal/manager.go +++ b/pkg/baremetal/manager.go @@ -530,10 +530,13 @@ func newBaremetalInstance(man *SBaremetalManager, desc jsonutils.JSONObject) (*S serverLock: new(sync.Mutex), } bm.cronJobs = []IBaremetalCronJob{ - NewStatusProbeJob(bm, time.Duration(o.Options.StatusProbeIntervalSeconds)*time.Second), NewLogFetchJob(bm, time.Duration(o.Options.LogFetchIntervalSeconds)*time.Second), NewSendMetricsJob(bm, time.Duration(o.Options.SendMetricsIntervalSeconds)*time.Second), } + hostType, _ := bm.desc.GetString("host_type") + if !utils.IsInStringArray(hostType, []string{api.HOST_TYPE_KVM, api.HOST_TYPE_HYPERVISOR}) { + bm.cronJobs = append(bm.cronJobs, NewStatusProbeJob(bm, time.Duration(o.Options.StatusProbeIntervalSeconds)*time.Second)) + } err := os.MkdirAll(bm.GetDir(), 0755) if err != nil { return nil, err