# Is it possible to add a KVM host running SLES 15 to OpenNebula?

**URL:** <https://forum.opennebula.io/t/is-it-possible-to-add-a-kvm-host-running-sles-15-to-opennebula/13953>\
**Category:** Installation & Configuration\
**Created:** [July 2, 2025, 4:22pm UTC](https://forum.opennebula.io/t/is-it-possible-to-add-a-kvm-host-running-sles-15-to-opennebula/13953 "2025-07-02T16:22:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![matheussantos972](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@matheussantos972](https://forum.opennebula.io/u/matheussantos972)\
**Post date:** [July 2, 2025, 4:22pm UTC](https://forum.opennebula.io/t/is-it-possible-to-add-a-kvm-host-running-sles-15-to-opennebula/13953/1 "2025-07-02T16:22:00Z")

</div>

I’m evaluating the setup of a virtualization environment using KVM and OpenNebula. Our bare metal servers are licensed with SLES 15+. I noticed that there’s no official `opennebula-node-kvm` package for SUSE, but some forums — although not very detailed — mention that it’s possible to add a host manually.

I’d like to confirm: **is it truly possible to add a host manually, or is SLES 15 incompatible with OpenNebula?**

I sincerely thank you in advance and apologize for my lack of familiarity with the tool.

Note: I extracted the `opennebula-node-kvm` package and reviewed the installation process. It seemed relatively generic, suggesting it could be adapted to other distributions. The only incompatibility I found was the dependency on two specific `opennebula-common` packages.

---

<div class="post-metadata">

**Author:** ![dclavijo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dclavijo/32/5265_2.png) [@dclavijo](https://forum.opennebula.io/u/dclavijo)\
**Post date:** [July 2, 2025, 5:03pm UTC](https://forum.opennebula.io/t/is-it-possible-to-add-a-kvm-host-running-sles-15-to-opennebula/13953/2 "2025-07-02T17:03:08Z")

</div>

The `opennebula-node-kvm` purpose is to guarantee that the host that it will be installed on will have all of the required dependencies that the KVM driver requires. Essentially what it does is

- install all of the libvirt + related storage and network components required to create KVM VMs managed through libvirt with many possible networking and storage configurations,
  - plus the required ruby runtime to run the drivers

- besides this it sets up the oneadmin user, which is the administrator user in OpenNebula, so that the control plane can properly issue operations

You can do all of this yourself without requiring packages by installing equivalent dependencies and running the install scripts shipped on the package with probably some modifications.

The main issue is that since we don’t test KVM nodes in SLES 15+ at all, hence why there are no packages. Therefore we can’t guarantee (nor we know) if the node will work properly. It is not necessarily **incompatible** , it is simply not certified.

If you want to give it a go, after setting up the node with the dependencies and the oneadmin user. Follow the [KVM node creation guide](https://docs.opennebula.io/7.0/software/installation_process/manual_installation/kvm_node_installation/) and look for possible monitoring errors in `/var/log/one/monitor.log` on the OpenNebula frontend. If the host shows up as ON, then good news, proceed to try VM operations.

---

<div class="post-metadata">

**Author:** ![matheussantos972](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@matheussantos972](https://forum.opennebula.io/u/matheussantos972)\
**Post date:** [July 4, 2025, 11:56am UTC](https://forum.opennebula.io/t/is-it-possible-to-add-a-kvm-host-running-sles-15-to-opennebula/13953/3 "2025-07-04T11:56:00Z")

</div>

I’ve put together this step-by-step guide, which is currently working as expected. In your opinion, does this configuration, as it stands, have the security and stability potential to be used in a production environment?

* * *

> Run **all** commands as `root`. Replace `&lt;NODE&gt;` with the hostname or IP of the SLES host.

* * *

## 1 — Install the SUSE KVM Stack

```auto
zypper ref && zypper up -y

zypper in -t pattern kvm_server

zypper install -y qemu qemu-tools qemu-guest-agent libvirt libvirt-daemon libvirt-client augeas augeas-lenses bridge-utils dnsmasq iptables rsync ruby2.5-rubygem-sqlite3 dmidecode lshw ruby2.5-rubygem-rexml augeas cronie ipset iptables libnbd libvirt libxml2 nfs-utils nftables openssh pciutils qemu rsync ruby tar

systemctl enable --now libvirtd

```

* * *

## 2 — Create **oneadmin** User and Directories

```auto
groupadd -g 9860 oneadmin

useradd -u 9860 -g oneadmin -m -d /var/lib/one -s /bin/bash oneadmin

usermod -aG libvirt oneadmin # access to RW socket

mkdir -p /var/{lib,run,log}/one

chown -R oneadmin:oneadmin /var/{lib,run,log}/one

```

* * *

## 3 — Apply Bridge Netfilter _sysctl_

Create **/etc/sysctl.d/bridge-nf-call.conf** with:

```auto
net.bridge.bridge-nf-call-arptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1

```

Apply immediately:

```auto
sysctl --system

```

* * *

## 4 — Polkit Rule for libvirt

```auto
cat >/etc/polkit-1/localauthority/50-local.d/50-org.libvirt.unix.manage-opennebula.pkla <<'EOF'
[OpenNebula libvirt manage]
Identity=unix-group:oneadmin
Action=org.libvirt.unix.manage
ResultAny=no
ResultInactive=no
ResultActive=yes
EOF

```

* * *

## 5 — Minimalist **sudo** Permissions

```auto
cat >/etc/sudoers.d/opennebula <<'EOF'
Defaults:oneadmin !requiretty
oneadmin ALL = (root) NOPASSWD: \
/usr/bin/virsh *, /usr/bin/qemu-img *, \
/usr/sbin/iptables *, /usr/sbin/ebtables *, \
/usr/sbin/arping, /usr/sbin/brctl *
EOF

visudo -cf /etc/sudoers.d/opennebula

```

* * *

## 6 — `qemu-kvm-one-gen` systemd Generator

Copy the file extracted from the RPM and set executable permission:

```auto
install -m 755 qemu-kvm-one-gen /usr/lib/systemd/system-generators/

systemctl daemon-reload

```

> This generator creates _qemu-kvm@\*\*.service_ units automatically during **live migration**.

* * *

## 7 — (Optional) `opennebula-node` Script

Optional, for reference:

```auto
install -m 755 opennebula-node /usr/sbin/

```

* * *

## 8 — Fine-tune libvirt

```auto
cat >/etc/libvirt/libvirtd.conf.d/opennebula.conf <<'EOF'
unix_sock_group = "libvirt"
unix_sock_rw_perms = "0770"
auth_unix_rw = "none"
EOF

systemctl restart libvirtd

```

* * *

## 9 — Copy _remotes_ from the Front-end

On the OpenNebula **Front-end** :

```auto
sudo -u oneadmin rsync -az --delete \
/var/lib/one/remotes/ oneadmin@<NODE>:/var/lib/one/remotes/

```

* * *

## 10 — Configure Passwordless SSH

Still on the Front-end, as _oneadmin_:

```auto
ssh-keygen -t ed25519 # if not already created

ssh-copy-id oneadmin@<NODE>

```

* * *

## 11 — Open _live migration_ Ports

Ensure the firewall allows TCP range **49152–49215**.

* * *

## 12 — Add Host to OpenNebula

On the Front-end:

```auto
onehost create <NODE> --im kvm --vm kvm --net dummy

onehost list

```

In a few seconds, the state should change from **INIT** to **ON**.

* * *

## 13 — Post-installation Adjustment Script (Standalone)

If you prefer to apply the same changes as the RPM _postinstall_ **separately** , create the script below at **/usr/local/sbin/opennebula-postconf.sh** and run it **after** all previous steps.

```auto
#!/bin/bash

# opennebula-postconf.sh — replicates the RPM postinstall on SLES 15
# Author: Infra Team — July/2025

set -euo pipefail

backup_cfg() {
  local f="$1"
  [[-f "$f"]] || return 0
  cp -f "$f" "${f}.$(date +'%Y-%m-%d_%H:%M:%S')"
}

# 1. Backup original files
backup_cfg /etc/libvirt/qemu.conf
backup_cfg /etc/libvirt/libvirtd.conf

# 2. Apply changes with Augeas
command -v augtool >/dev/null || {
  echo "Error: augeas/augeas-lenses packages missing." >&2
  exit 1
}

augtool -A <<'EOF'
set /augeas/load/Libvirtd_qemu/lens Libvirtd_qemu.lns
set /augeas/load/Libvirtd_qemu/incl /etc/libvirt/qemu.conf
set /augeas/load/Libvirtd/lens Libvirtd.lns
set /augeas/load/Libvirtd/incl /etc/libvirt/libvirtd.conf
load
set /files/etc/libvirt/qemu.conf/user oneadmin
set /files/etc/libvirt/qemu.conf/group oneadmin
set /files/etc/libvirt/qemu.conf/dynamic_ownership 0
set /files/etc/libvirt/libvirtd.conf/auth_unix_ro none
set /files/etc/libvirt/libvirtd.conf/auth_unix_rw none
set /files/etc/libvirt/libvirtd.conf/unix_sock_group oneadmin
set /files/etc/libvirt/libvirtd.conf/unix_sock_ro_perms 0770
set /files/etc/libvirt/libvirtd.conf/unix_sock_rw_perms 0770
save
EOF

# 3. Generate (or update) generic symlink qemu-kvm-one
/usr/bin/qemu-kvm-one-gen || true

# 4. Restart libvirtd only if changes occurred
systemctl try-restart libvirtd || true

echo "✓ Post-installation adjustments applied successfully."

```

> **Usage:**

> ```auto
> chmod +x /usr/local/sbin/opennebula-postconf.sh
> 
> /usr/local/sbin/opennebula-postconf.sh
> 
> ```

* * *

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/1/14d66f1130b9cd292905f575da9b68a9f574dd03.png) [@system](https://forum.opennebula.io/u/system)\
**Post date:** [July 7, 2025, 4:03pm UTC](https://forum.opennebula.io/t/is-it-possible-to-add-a-kvm-host-running-sles-15-to-opennebula/13953/4 "2025-07-07T16:03:35Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
