Skip to content

Commit ce08db6

Browse files
committed
Remove manual kernel module loading
Remove unnecessary manual loading of KVM and OpenvSwitch kernel modules during host setup. These modules are automatically loaded by their respective systemd services (libvirt and openvswitch) when they start. Changes: - Remove load_kvm_module() and load_ovs_module() functions from common.sh - Remove module loading calls from setup-host.sh - Update QUICKSTART.md to reflect that services are enabled and started (modules are loaded automatically) - Remove modprobe reference from require_root error message This simplifies the setup process and relies on proper systemd service dependencies rather than manually managing kernel modules. Assisted-By: Claude Code - claude-4.5-sonnet Signed-off-by: Harald Jensås <hjensas@redhat.com>
1 parent 6cb98fa commit ce08db6

File tree

3 files changed

+1
-83
lines changed

3 files changed

+1
-83
lines changed

devsetup/hotstack-os/QUICKSTART.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ sudo make setup
2121

2222
This performs complete host setup:
2323
- Installs required packages (`openvswitch`, `libvirt`, `nfs-utils`, etc.)
24-
- Starts required services (`openvswitch`, `libvirt`, `nfs-server`)
25-
- Loads kernel modules (`kvm_intel`/`kvm_amd`, `openvswitch`)
24+
- Enables and starts required services (`openvswitch`, `libvirt`, `nfs-server`)
2625
- Verifies KVM support (`/dev/kvm` exists)
2726
- Creates system directories for Nova instances with proper ownership
2827
- Sets up NFS server for Cinder volumes (exported to localhost)

devsetup/hotstack-os/scripts/common.sh

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -319,66 +319,6 @@ wait_for_container() {
319319
return 1
320320
}
321321

322-
# ============================================================================
323-
# Kernel Module Functions
324-
# ============================================================================
325-
326-
# Load KVM kernel module (Intel or AMD)
327-
# Usage: load_kvm_module
328-
# Returns: 0 on success, 1 on failure
329-
load_kvm_module() {
330-
if lsmod | grep -q "^kvm_intel"; then
331-
echo -e "${GREEN}${NC} Kernel module kvm_intel is already loaded"
332-
return 0
333-
elif lsmod | grep -q "^kvm_amd"; then
334-
echo -e "${GREEN}${NC} Kernel module kvm_amd is already loaded"
335-
return 0
336-
else
337-
# Try to detect CPU vendor and load appropriate module
338-
if grep -q "vendor_id.*GenuineIntel" /proc/cpuinfo; then
339-
echo -e "${YELLOW}${NC} Loading kvm_intel module..."
340-
if modprobe kvm_intel; then
341-
lsmod | grep -q "^kvm_intel" && echo -e "${GREEN}${NC} kvm_intel module loaded"
342-
return 0
343-
else
344-
echo -e "${RED}${NC} Failed to load kvm_intel module"
345-
return 1
346-
fi
347-
elif grep -q "vendor_id.*AuthenticAMD" /proc/cpuinfo; then
348-
echo -e "${YELLOW}${NC} Loading kvm_amd module..."
349-
if modprobe kvm_amd; then
350-
lsmod | grep -q "^kvm_amd" && echo -e "${GREEN}${NC} kvm_amd module loaded"
351-
return 0
352-
else
353-
echo -e "${RED}${NC} Failed to load kvm_amd module"
354-
return 1
355-
fi
356-
else
357-
echo -e "${RED}${NC} Cannot detect CPU vendor for KVM module"
358-
return 1
359-
fi
360-
fi
361-
}
362-
363-
# Load OpenvSwitch kernel module
364-
# Usage: load_ovs_module
365-
# Returns: 0 on success, 1 on failure
366-
load_ovs_module() {
367-
if lsmod | grep -q "^openvswitch"; then
368-
echo -e "${GREEN}${NC} Kernel module openvswitch is already loaded"
369-
return 0
370-
else
371-
echo -e "${YELLOW}${NC} Loading openvswitch module..."
372-
if modprobe openvswitch; then
373-
lsmod | grep -q "^openvswitch" && echo -e "${GREEN}${NC} openvswitch module loaded"
374-
return 0
375-
else
376-
echo -e "${RED}${NC} Failed to load openvswitch module"
377-
return 1
378-
fi
379-
fi
380-
}
381-
382322
# ============================================================================
383323
# System Services Functions
384324
# ============================================================================
@@ -397,21 +337,6 @@ verify_libvirt() {
397337
fi
398338
}
399339

400-
# Verify KVM support
401-
# Usage: verify_kvm
402-
# Returns: 0 if available, 1 otherwise
403-
verify_kvm() {
404-
echo "Checking KVM support..."
405-
if [ -e /dev/kvm ]; then
406-
echo -e "${GREEN}${NC} /dev/kvm exists"
407-
return 0
408-
else
409-
echo -e "${RED}${NC} /dev/kvm does not exist - KVM not available"
410-
echo " Enable virtualization in BIOS/UEFI"
411-
return 1
412-
fi
413-
}
414-
415340
# Setup OpenvSwitch service
416341
# Usage: setup_openvswitch_service
417342
setup_openvswitch_service() {
@@ -617,7 +542,6 @@ require_root() {
617542
echo "This script requires root privileges to:"
618543
echo " - Install system packages (dnf install)"
619544
echo " - Start/enable system services (systemctl)"
620-
echo " - Load kernel modules (modprobe)"
621545
echo " - Configure firewall (firewall-cmd)"
622546
echo " - Create system directories (/var/lib/nova/instances)"
623547
echo " - Setup NFS server for Cinder (exportfs, nfs-server)"

devsetup/hotstack-os/scripts/setup-host.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ fi
5757

5858
install_queued_packages
5959

60-
# Load kernel modules
61-
echo "Loading kernel modules..."
62-
load_kvm_module || exit 1
63-
load_ovs_module || exit 1
64-
6560
# Check for network subnet conflicts
6661
echo -n "Checking network availability... "
6762
SUBNET_IN_USE=0

0 commit comments

Comments
 (0)