diff --git a/pkg/hostman/hostinfo/hostbridge/ovs.go b/pkg/hostman/hostinfo/hostbridge/ovs.go index c821d79fbd..d57ae3d85b 100644 --- a/pkg/hostman/hostinfo/hostbridge/ovs.go +++ b/pkg/hostman/hostinfo/hostbridge/ovs.go @@ -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() diff --git a/pkg/hostman/hostinfo/hostinfo.go b/pkg/hostman/hostinfo/hostinfo.go index 11fd882d95..4e48d7f812 100644 --- a/pkg/hostman/hostinfo/hostinfo.go +++ b/pkg/hostman/hostinfo/hostinfo.go @@ -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) diff --git a/pkg/hostman/options/options.go b/pkg/hostman/options/options.go index 1de16348ca..f9469d2788 100644 --- a/pkg/hostman/options/options.go +++ b/pkg/hostman/options/options.go @@ -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"`