mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-20 08:03:53 +08:00
fix(host): support skip check kernel mod (#24217)
This commit is contained in:
@@ -284,9 +284,11 @@ func OVSPrepare() error {
|
||||
ovs := system_service.GetService("openvswitch")
|
||||
if !ovs.IsInstalled() || !ovs.IsActive() {
|
||||
// no openvswitch service found, first try load openvswitch kernel modules, then try ovs-vsctl command, if success, return nil
|
||||
err := procutils.NewRemoteCommandAsFarAsPossible("modprobe", "openvswitch").Run()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Failed to load openvswitch kernel modules")
|
||||
if !utils.IsInStringArray("openvswitch", options.HostOptions.SkipCheckKernelMods) {
|
||||
err := procutils.NewRemoteCommandAsFarAsPossible("modprobe", "openvswitch").Run()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Failed to load openvswitch kernel modules")
|
||||
}
|
||||
}
|
||||
// wait for the ovs-vswitchd to start
|
||||
startProbe := time.Now()
|
||||
|
||||
@@ -517,10 +517,13 @@ func (h *SHostInfo) prepareEnv() error {
|
||||
fileutils2.ChangeSsdBlkdevsParams(ioParams)
|
||||
}
|
||||
|
||||
_, err = procutils.NewRemoteCommandAsFarAsPossible("modprobe", "tun").Output()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Failed to activate tun/tap device")
|
||||
if !utils.IsInStringArray("tun", options.HostOptions.SkipCheckKernelMods) {
|
||||
_, err = procutils.NewRemoteCommandAsFarAsPossible("modprobe", "tun").Output()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Failed to activate tun/tap device")
|
||||
}
|
||||
}
|
||||
|
||||
output, err := procutils.NewRemoteCommandAsFarAsPossible("modprobe", "vhost_net").Output()
|
||||
if err != nil {
|
||||
log.Warningf("modprobe vhost_net error: %s", output)
|
||||
|
||||
@@ -259,6 +259,8 @@ type SHostOptions struct {
|
||||
CudaMPSLogDirectory string `help:"cuda mps log dir" default:"/tmp/nvidia-mps/log"`
|
||||
CudaMPSReplicas int `help:"cuda mps replicas" default:"10"`
|
||||
|
||||
SkipCheckKernelMods []string `help:"skip check kernel modules"`
|
||||
|
||||
EnableContainerAscendNPU bool `help:"enable container npu" default:"false"`
|
||||
|
||||
EnableDirtyRecoverySeconds int `help:"Seconds to delay enable dirty guests recovery feature, default 15 minutes" default:"900"`
|
||||
|
||||
Reference in New Issue
Block a user