diff --git a/config/msft-rdma.json b/config/msft-rdma.json new file mode 100644 index 0000000..af5b4f7 --- /dev/null +++ b/config/msft-rdma.json @@ -0,0 +1,13 @@ +{ + "PreTask": "", + "ExtraRepositories": [ + { + "Name": "MSFT-RDMA-REPO", + "Uri": "https://drivers.suse.com/microsoft/Microsoft-LIS-RDMA/sle-12/updates" + } + ], + "PackageNames": [ + "msft-rdma-drivers" + ], + "PostTask": "" +} \ No newline at end of file diff --git a/config/waagent.conf b/config/waagent.conf index 37ded96..e5f9aa7 100644 --- a/config/waagent.conf +++ b/config/waagent.conf @@ -88,4 +88,5 @@ OS.OpensslPath=None OS.UpdateRdmaDriver=n OS.CheckRdmaDriver=n OS.RdmaRepository=https://drivers.suse.com/microsoft/Microsoft-LIS-RDMA/sle-12/updates -# Host.NdDriverVersion=142.0, this is used for the test hook of the nd driver version in kvp \ No newline at end of file +# Host.NdDriverVersion=142, this is used for the test hook of the nd driver version in kvp +# OS.PackageExtraConfig=/etc/msft-rdma.json, this is used for the extra package installation. \ No newline at end of file diff --git a/waagent b/waagent index c51ea07..3b77c87 100644 --- a/waagent +++ b/waagent @@ -693,7 +693,7 @@ class AbstractDistro(object): Run("/sbin/route add -net " + net + " netmask " + mask + " gw " + gateway, chk_err=False) - def rdmaUpdate(self,updateRdmaRepository=None): + def rdmaUpdate(self, updateRdmaRepository=None): # give some time for the hv_hvp_daemon to start up. time.sleep(10) check_install_result = self.checkInstallKVPDaemon() @@ -6376,16 +6376,22 @@ class Agent(Util): try: updateRdmaDriverConfigured = Config.yes("OS.UpdateRdmaDriver") updateRdmaRepository = Config.get("OS.RdmaRepository") + rdmaExtraConfigFile = Config.get("OS.RdmaExtraConfig") + if(rdmaExtraConfigFile is not None and os.path.exists(rdmaExtraConfigFile)): + extraConfigContent = GetFileContents(rdmaExtraConfigFile) + extraConfigJson = json.loads(extraConfigContent) + preTask = extraConfigJson['PreTask'] + postTask = extraConfigJson['PostTask'] if(updateRdmaDriverConfigured): MyDistro.rdmaUpdate(updateRdmaRepository) else: - Log("OS.UpdateRdmaDriver configured to "+str(updateRdmaDriverConfigured)+" so skip the rdma update.") + Log("OS.UpdateRdmaDriver configured to " + str(updateRdmaDriverConfigured) + " so skip the rdma update.") checkRdmaDriverConfigured = Config.yes("OS.CheckRdmaDriver") if(checkRdmaDriverConfigured): checkRdmaResult = MyDistro.checkRDMA() Log("Rdma check result is " + str(checkRdmaResult)) else: - Log("OS.CheckRdmaDriver configured to "+str(checkRdmaDriverConfigured)+" so skip the rdma check.") + Log("OS.CheckRdmaDriver configured to " + str(checkRdmaDriverConfigured) + " so skip the rdma check.") except Exception as e: errMsg = 'check or update Rdma driver failed with error: %s, stack trace: %s' % (str(e), traceback.format_exc()) Error(errMsg)