mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
feat(region): no_bmc option of host create api (#15270)
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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"`
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user