diff --git a/cmd/climc/shell/compute/hosts.go b/cmd/climc/shell/compute/hosts.go index 6d8ee85bbb..f0043333e2 100644 --- a/cmd/climc/shell/compute/hosts.go +++ b/cmd/climc/shell/compute/hosts.go @@ -419,6 +419,7 @@ func init() { AccessWire string `help:"Access wire"` NoProbe bool `help:"just save the record, do not probe"` + NoBMC bool `help:"No BMC hardware"` NoPrepare bool `help:"just probe, do not reboot baremetal to prepare"` DisablePxeBoot bool `help:"set enable_pxe_boot to false, which is true by default"` @@ -460,6 +461,9 @@ func init() { if args.NoPrepare { params.Add(jsonutils.JSONTrue, "no_prepare") } + if args.NoBMC { + params.Add(jsonutils.JSONTrue, "no_bmc") + } if args.DisablePxeBoot { params.Add(jsonutils.JSONFalse, "enable_pxe_boot") } diff --git a/pkg/apis/compute/host.go b/pkg/apis/compute/host.go index e1f218424c..c972a496ca 100644 --- a/pkg/apis/compute/host.go +++ b/pkg/apis/compute/host.go @@ -413,6 +413,9 @@ type HostCreateInput struct { // 新建带IPMI信息的物理机时不进行IPMI信息探测 NoProbe *bool `json:"no_probe"` + // 物理机不带 BMC 控制器 + NoBMC bool `json:"no_bmc"` + // host uuid Uuid string `json:"uuid"` diff --git a/pkg/compute/models/hosts.go b/pkg/compute/models/hosts.go index 855a48e067..98fedbaa9b 100644 --- a/pkg/compute/models/hosts.go +++ b/pkg/compute/models/hosts.go @@ -3524,7 +3524,7 @@ func (manager *SHostManager) ValidateCreateData( input.ZoneId = zoneObj.GetId() // data.Set("zone_id", jsonutils.NewString(zoneObj.GetId())) } - if !noProbe { + if !noProbe || input.NoBMC { var accessNet *SNetwork accessIpAddr := input.AccessIp // tString("access_ip") if len(accessIpAddr) > 0 {