This is an automated email from the ASF dual-hosted git repository.

pearl11594 pushed a commit to branch 4.20
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.20 by this push:
     new 6b4adbb20a3 Preview-Experimental Support EL10 as Management Server and 
KVM host (#10496)
6b4adbb20a3 is described below

commit 6b4adbb20a3099467b5b69ee7586a5975194a428
Author: Rohit Yadav <[email protected]>
AuthorDate: Wed Mar 26 20:53:35 2025 +0530

    Preview-Experimental Support EL10 as Management Server and KVM host (#10496)
    
    * cloudstack: add support for EL10
    This adds support for Fedora 40 and (upcoming) EL10 distro to be used
    as mgmt/usage server, mysql/nfs & KVM host. Python3 version has changed
    to 3.12.9 which isn't automatically determining the python-path.
    * python: WIP code, this fails right now
    Need to discuss/check if we can skip this code. Where/how is cgroup
    setup used with KVM agent.
    * prep cloudutils to be EL10 ready
    Fixes issue for Fedora, it was running old EL6 hooks which isn't
    applicable for modern Fedora version that are closer to EL8/9/10
---
 agent/bindir/cloud-setup-agent.in       | 13 +++++++++++++
 agent/bindir/libvirtqemuhook.in         | 13 +++++++++++++
 client/bindir/cloud-setup-management.in | 14 ++++++++++++++
 python/lib/cloudutils/syscfg.py         |  7 ++++---
 python/lib/cloudutils/utilities.py      |  4 ++++
 5 files changed, 48 insertions(+), 3 deletions(-)

diff --git a/agent/bindir/cloud-setup-agent.in 
b/agent/bindir/cloud-setup-agent.in
index 18de64089ed..9927c22eebc 100755
--- a/agent/bindir/cloud-setup-agent.in
+++ b/agent/bindir/cloud-setup-agent.in
@@ -20,6 +20,19 @@ import os
 import logging
 import sys
 import socket
+
+# ---- This snippet of code adds the sources path and the waf configured 
PYTHONDIR to the Python path ----
+# ---- We do this so cloud_utils can be looked up in the following order:
+# ---- 1) Sources directory
+# ---- 2) waf configured PYTHONDIR
+# ---- 3) System Python path
+for pythonpath in (
+        "@PYTHONDIR@",
+        
os.path.join(os.path.dirname(__file__),os.path.pardir,os.path.pardir,"python","lib"),
+    ):
+        if os.path.isdir(pythonpath): sys.path.insert(0,pythonpath)
+# ---- End snippet of code ----
+
 from cloudutils.cloudException import CloudRuntimeException, 
CloudInternalException
 from cloudutils.utilities import initLoging, bash
 from cloudutils.configFileOps import  configFileOps
diff --git a/agent/bindir/libvirtqemuhook.in b/agent/bindir/libvirtqemuhook.in
index e17944d8353..4cc6ed7a1d2 100755
--- a/agent/bindir/libvirtqemuhook.in
+++ b/agent/bindir/libvirtqemuhook.in
@@ -20,6 +20,19 @@ import sys
 import os
 import subprocess
 from threading import Timer
+
+# ---- This snippet of code adds the sources path and the waf configured 
PYTHONDIR to the Python path ----
+# ---- We do this so cloud_utils can be looked up in the following order:
+# ---- 1) Sources directory
+# ---- 2) waf configured PYTHONDIR
+# ---- 3) System Python path
+for pythonpath in (
+        "@PYTHONDIR@",
+        
os.path.join(os.path.dirname(__file__),os.path.pardir,os.path.pardir,"python","lib"),
+    ):
+        if os.path.isdir(pythonpath): sys.path.insert(0,pythonpath)
+# ---- End snippet of code ----
+
 from xml.dom.minidom import parse
 from cloudutils.configFileOps import configFileOps
 from cloudutils.networkConfig import networkConfig
diff --git a/client/bindir/cloud-setup-management.in 
b/client/bindir/cloud-setup-management.in
index 70e727b40b2..84c87ae2e44 100755
--- a/client/bindir/cloud-setup-management.in
+++ b/client/bindir/cloud-setup-management.in
@@ -16,13 +16,27 @@
 # specific language governing permissions and limitations
 # under the License.
 
+import os
 import sys
+# ---- This snippet of code adds the sources path and the waf configured 
PYTHONDIR to the Python path ----
+# ---- We do this so cloud_utils can be looked up in the following order:
+# ---- 1) Sources directory
+# ---- 2) waf configured PYTHONDIR
+# ---- 3) System Python path
+for pythonpath in (
+        "@PYTHONDIR@",
+        
os.path.join(os.path.dirname(__file__),os.path.pardir,os.path.pardir,"python","lib"),
+    ):
+        if os.path.isdir(pythonpath): sys.path.insert(0,pythonpath)
+# ---- End snippet of code ----
+
 from cloudutils.syscfg import sysConfigFactory
 from cloudutils.utilities import initLoging, UnknownSystemException
 from cloudutils.cloudException import CloudRuntimeException, 
CloudInternalException
 from cloudutils.globalEnv import globalEnv
 from cloudutils.serviceConfigServer import cloudManagementConfig
 from optparse import OptionParser
+
 if __name__ == '__main__':
     initLoging("@MSLOGDIR@/setupManagement.log")
     glbEnv = globalEnv()
diff --git a/python/lib/cloudutils/syscfg.py b/python/lib/cloudutils/syscfg.py
index fe68b02dfe8..78cd58bfbd4 100755
--- a/python/lib/cloudutils/syscfg.py
+++ b/python/lib/cloudutils/syscfg.py
@@ -39,11 +39,11 @@ class sysConfigAgentFactory:
             return sysConfigAgentUbuntu(glbEnv)
         elif distribution == "CentOS" or distribution == "RHEL5":
             return sysConfigEL5(glbEnv)
-        elif distribution == "Fedora" or distribution == "RHEL6":
+        elif distribution == "RHEL6":
             return sysConfigEL6(glbEnv)
         elif distribution == "RHEL7":
             return sysConfigEL7(glbEnv)
-        elif distribution in ["RHEL8", "RHEL9"]:
+        elif distribution in ["Fedora", "RHEL8", "RHEL9", "RHEL10"]:
             return sysConfigEL(glbEnv)
         elif distribution == "SUSE":
             return sysConfigSUSE(glbEnv)
@@ -183,9 +183,10 @@ class sysConfigEL5(sysConfigAgentRedhatBase):
                          networkConfigRedhat(self),
                          libvirtConfigRedhat(self),
                          firewallConfigAgent(self),
+                         nfsConfig(self),
                          cloudAgentConfig(self)]
 
-#it covers RHEL6/Fedora13/Fedora14
+#it covers RHEL6
 class sysConfigEL6(sysConfigAgentRedhatBase):
     def __init__(self, glbEnv):
         super(sysConfigEL6, self).__init__(glbEnv)
diff --git a/python/lib/cloudutils/utilities.py 
b/python/lib/cloudutils/utilities.py
index 5b07ff1eff6..ce50516193e 100755
--- a/python/lib/cloudutils/utilities.py
+++ b/python/lib/cloudutils/utilities.py
@@ -124,6 +124,10 @@ class Distribution:
                 version.find("Red Hat Enterprise Linux release 9") != -1 or 
version.find("Linux release 9.") != -1 or
                 version.find("Linux release 9") != -1):
                 self.distro = "RHEL9"
+            elif (version.find("Red Hat Enterprise Linux Server release 10") 
!= -1 or version.find("Scientific Linux release 10") != -1 or
+                version.find("Red Hat Enterprise Linux release 10") != -1 or 
version.find("Linux release 10.") != -1 or
+                version.find("Linux release 10") != -1):
+                self.distro = "RHEL10"
             elif version.find("CentOS") != -1:
                 self.distro = "CentOS"
             else:

Reply via email to