diff --git a/pkg/compute/models/hosts.go b/pkg/compute/models/hosts.go index 4d41e39bd2..d284d7291d 100644 --- a/pkg/compute/models/hosts.go +++ b/pkg/compute/models/hosts.go @@ -4038,6 +4038,9 @@ func (self *SHost) StartSyncAllGuestsStatusTask(ctx context.Context, userCred mc } func (self *SHost) PerformPing(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.SHostPingInput) (jsonutils.JSONObject, error) { + if self.HostType == api.HOST_TYPE_BAREMETAL { + return nil, httperrors.NewNotSupportedError("ping host type %s not support", self.HostType) + } if input.WithData { // piggyback storage stats info log.Debugf("host ping %s", jsonutils.Marshal(input))