fix(baremetal): disable use perccli temporarily (#14146)

This commit is contained in:
Zexi Li
2022-04-28 09:42:44 +08:00
committed by GitHub
parent 2dd1aeb8aa
commit 76ac710037
2 changed files with 19 additions and 13 deletions
+3 -2
View File
@@ -52,8 +52,9 @@ type BaremetalOptions struct {
LogFetchIntervalSeconds int `help:"interval to fetch baremetal log, default is 900 seconds" default:"900"`
SendMetricsIntervalSeconds int `help:"interval to send baremetal metrics, default is 300 seconds" default:"300"`
TftpFileMap map[string]string `help:"map of filename to real file path for tftp"`
BootLoader string `help:"PXE boot loader" default:"grub"`
TftpFileMap map[string]string `help:"map of filename to real file path for tftp"`
BootLoader string `help:"PXE boot loader" default:"grub"`
UseMegaRaidPerccli bool `help:"Use MegaRAID perccli" default:"false"`
}
const (
+16 -11
View File
@@ -19,6 +19,7 @@ import (
"yunion.io/x/pkg/errors"
"yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/baremetal/options"
"yunion.io/x/onecloud/pkg/baremetal/utils/raid"
"yunion.io/x/onecloud/pkg/compute/baremetal"
)
@@ -59,18 +60,22 @@ type sRaid struct {
}
func newRaid(term raid.IExecTerm) raid.IRaidDriver {
perccliDrv := &sRaid{
driver: newPerccliDriver(),
term: term,
adaptors: make([]*sRaidAdaptor, 0),
}
if err := perccliDrv.ParsePhyDevs(); err == nil && perccliDrv.phyDevsCnt > 0 {
log.Infof("Use perccli driver, found %d pds", perccliDrv.phyDevsCnt)
return perccliDrv
} else {
log.Warningf("perccli driver parse physical devices error: %v, %d pds, fallback to old megactl and storcli driver", err, perccliDrv.phyDevsCnt)
return NewMegaRaid(term)
if options.Options.UseMegaRaidPerccli {
perccliDrv := &sRaid{
driver: newPerccliDriver(),
term: term,
adaptors: make([]*sRaidAdaptor, 0),
}
if err := perccliDrv.ParsePhyDevs(); err == nil && perccliDrv.phyDevsCnt > 0 {
log.Infof("Use perccli driver, found %d pds", perccliDrv.phyDevsCnt)
return perccliDrv
} else {
log.Warningf("perccli driver parse physical devices error: %v, %d pds, fallback to old megactl and storcli driver", err, perccliDrv.phyDevsCnt)
return NewMegaRaid(term)
}
}
log.Infof("Not use perccli, use legacy megaraid driver")
return NewMegaRaid(term)
}
func (r *sRaid) GetName() string {