diff --git a/pkg/compute/models/hosts.go b/pkg/compute/models/hosts.go index 4c5d1b6610..b0f2554da7 100644 --- a/pkg/compute/models/hosts.go +++ b/pkg/compute/models/hosts.go @@ -1118,8 +1118,7 @@ func (self *SHost) GetSpec(statusCheck bool) *jsonutils.JSONDict { if !self.GetEnabled() { return nil } - if utils.IsInStringArray(self.Status, []string{api.BAREMETAL_INIT, api.BAREMETAL_PREPARE_FAIL, api.BAREMETAL_PREPARE}) || - self.GetBaremetalServer() != nil { + if self.Status != api.BAREMETAL_RUNNING || self.GetBaremetalServer() != nil || self.IsMaintenance { return nil } if self.MemSize == 0 || self.CpuCount == 0 {