Ovswitch: No tap device found for nic 0

Hi,
My Opennebula setup:
Frontend + Node : Rocky Linux 8.6 + OpenNebula 6.4.0 + KVM + ovswitch 2.17
ovswitch is configured correctly (I can receive and send traffic from/to Internet)

Trying to start any VM (for instance Rocky Linux 8 from MarketPlace) I obtain this error:
“DEPLOY: ovswitch: No tap device found for nic 0 ExitCode: 1”

The started VM remains in state RUNNING but I can’t connect because opennebula doesn’t create a new port in the ovswitch bridge. However opennebula can create a new interface in the system (ip address).

Thanks in advance.

[root@localhost ~]# ovs-vsctl show
6f6d3911-b12a-43d2-b0e9-880369a896e8
Bridge ovsbr0
Port enp0s8
Interface enp0s8
Port ovsbr0
Interface ovsbr0
type: internal
Port enp0s3
Interface enp0s3
ovs_version: “2.17.3”

Virtual Network template:
BRIDGE = “ovsbr0”
BRIDGE_TYPE = “linux”
DESCRIPTION = “A private network for VM inter-communication”
DNS = “”
GATEWAY = “192.168.1.1”
NAME = “Private Network”
NETWORK_ADDRESS = “192.168.1.0”
NETWORK_MASK = “255.255.255.0”
OUTER_VLAN_ID = “”
PHYDEV = “enp0s3”
SEARCH_DOMAIN = “”
SECURITY_GROUPS = “0”
VLAN_ID = “”
VN_MAD = “ovswitch”

[root@localhost ~]# ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 08:00:27:83:a4:dd txqueuelen 1000 (Ethernet)
RX packets 9154138 bytes 2175483509 (2.0 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 204229 bytes 47832133 (45.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.20.20.5 netmask 255.255.255.0 broadcast 172.20.20.255
ether 08:00:27:87:b7:26 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8491016 bytes 1556236871 (1.4 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 3392256 bytes 6689311852 (6.2 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3392256 bytes 6689311852 (6.2 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

one-24-0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::fc00:acff:fe14:1464 prefixlen 64 scopeid 0x20
ether fe:00:ac:14:14:64 txqueuelen 1000 (Ethernet)
RX packets 21 bytes 1342 (1.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 44 bytes 6431 (6.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ovsbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 1**.1**.207.125 netmask 255.255.254.0 broadcast 0.0.0.0
inet6 fe80::a00:27ff:fe83:a4dd prefixlen 64 scopeid 0x20
ether 08:00:27:83:a4:dd txqueuelen 1000 (Ethernet)
RX packets 8675198 bytes 2019424197 (1.8 GiB)
RX errors 0 dropped 16737 overruns 0 frame 0
TX packets 140308 bytes 37526462 (35.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.124.1 netmask 255.255.255.0 broadcast 192.168.124.255
ether 52:54:00:b6:c5:f2 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


My VM template:
User template
ERROR = “Thu Oct 13 09:37:20 2022: DEPLOY: ovswitch: No tap device found for nic 0 ExitCode: 1”
LXD_SECURITY_PRIVILEGED = “true”
Template
AUTOMATIC_DS_REQUIREMENTS = “("CLUSTERS/ID" @> 0)”
AUTOMATIC_NIC_REQUIREMENTS = “("CLUSTERS/ID" @> 0)”
AUTOMATIC_REQUIREMENTS = “(CLUSTER_ID = 0) & !(PUBLIC_CLOUD = YES) & !(PIN_POLICY = PINNED)”
CONTEXT = [
DISK_ID = “1”,
ETH0_DNS = “”,
ETH0_EXTERNAL = “”,
ETH0_GATEWAY = “192.168.1.1”,
ETH0_GATEWAY6 = “”,
ETH0_IP = “172.20.20.100”,
ETH0_IP6 = “”,
ETH0_IP6_GATEWAY = “”,
ETH0_IP6_METHOD = “”,
ETH0_IP6_METRIC = “”,
ETH0_IP6_PREFIX_LENGTH = “”,
ETH0_IP6_ULA = “”,
ETH0_MAC = “02:00:ac:14:14:64”,
ETH0_MASK = “255.255.255.0”,
ETH0_METHOD = “”,
ETH0_METRIC = “”,
ETH0_MTU = “”,
ETH0_NETWORK = “192.168.1.0”,
ETH0_SEARCH_DOMAIN = “”,
ETH0_VLAN_ID = “”,
ETH0_VROUTER_IP = “”,
ETH0_VROUTER_IP6 = “”,
ETH0_VROUTER_MANAGEMENT = “”,
NETWORK = “YES”,
SSH_PUBLIC_KEY = “”,
TARGET = “hda” ]
CPU = “1”
DISK = [
ALLOW_ORPHANS = “YES”,
CLONE = “YES”,
CLONE_TARGET = “SYSTEM”,
CLUSTER_ID = “0”,
DATASTORE = “default”,
DATASTORE_ID = “1”,
DEV_PREFIX = “vd”,
DISK_ID = “0”,
DISK_SNAPSHOT_TOTAL_SIZE = “0”,
DISK_TYPE = “FILE”,
DRIVER = “qcow2”,
FORMAT = “qcow2”,
IMAGE = “Rocky Linux 8”,
IMAGE_ID = “8”,
IMAGE_STATE = “2”,
LN_TARGET = “SYSTEM”,
ORIGINAL_SIZE = “4096”,
READONLY = “NO”,
SAVE = “NO”,
SIZE = “4096”,
SOURCE = “/var/lib/one//datastores/1/df30e070da2fcd2cc0f1be3e2d9a42a6”,
TARGET = “vda”,
TM_MAD = “ssh”,
TYPE = “FILE” ]
GRAPHICS = [
LISTEN = “0.0.0.0”,
PORT = “5924”,
TYPE = “vnc” ]
MEMORY = “768”
NIC = [
AR_ID = “0”,
BRIDGE = “ovsbr0”,
BRIDGE_TYPE = “openvswitch”,
CLUSTER_ID = “0”,
GATEWAY = “192.168.1.1”,
IP = “172.20.20.100”,
MAC = “02:00:ac:14:14:64”,
NAME = “NIC0”,
NETWORK = “Private Network”,
NETWORK_ID = “4”,
NIC_ID = “0”,
PHYDEV = “enp0s3”,
SECURITY_GROUPS = “0”,
SSH = “YES”,
TARGET = “one-24-0”,
VN_MAD = “ovswitch” ]
OS = [
ARCH = “x86_64”,
UUID = “3ac67a4a-421f-466a-ad9c-3b520aaa0159” ]
SECURITY_GROUP_RULE = [
PROTOCOL = “ALL”,
RULE_TYPE = “OUTBOUND”,
SECURITY_GROUP_ID = “0”,
SECURITY_GROUP_NAME = “default” ]
SECURITY_GROUP_RULE = [
PROTOCOL = “ALL”,
RULE_TYPE = “INBOUND”,
SECURITY_GROUP_ID = “0”,
SECURITY_GROUP_NAME = “default” ]
TEMPLATE_ID = “8”
TM_MAD_SYSTEM = “ssh”
VMID = “24”

My Logs:
Thu Oct 13 09:37:16 2022 [Z0][VM][I]: New state is ACTIVE
Thu Oct 13 09:37:16 2022 [Z0][VM][I]: New LCM state is PROLOG
Thu Oct 13 09:37:18 2022 [Z0][VM][I]: New LCM state is BOOT
Thu Oct 13 09:37:18 2022 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/24/deployment.0
Thu Oct 13 09:37:19 2022 [Z0][VMM][I]: Successfully execute transfer manager driver operation: tm_context.
Thu Oct 13 09:37:19 2022 [Z0][VMM][I]: ExitCode: 0
Thu Oct 13 09:37:19 2022 [Z0][VMM][I]: Successfully execute network driver operation: pre.
Thu Oct 13 09:37:19 2022 [Z0][VMM][I]: ExitCode: 0
Thu Oct 13 09:37:19 2022 [Z0][VMM][I]: Successfully execute virtualization driver operation: /bin/mkdir -p.
Thu Oct 13 09:37:19 2022 [Z0][VMM][I]: ExitCode: 0
Thu Oct 13 09:37:19 2022 [Z0][VMM][I]: Successfully execute virtualization driver operation: /bin/cat - >/var/lib/one//datastores/0/24/vm.xml.
Thu Oct 13 09:37:19 2022 [Z0][VMM][I]: ExitCode: 0
Thu Oct 13 09:37:19 2022 [Z0][VMM][I]: Successfully execute virtualization driver operation: /bin/cat - >/var/lib/one//datastores/0/24/ds.xml.
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: ExitCode: 0
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: Successfully execute virtualization driver operation: deploy.
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: Command execution fail (exit code: 1): cat << EOT | /var/tmp/one/vnm/ovswitch/post ‘/var/lib/one//datastores/0/24
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: /var/lib/one//datastores/0/24/deployment.0
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: 3ac67a4a-421f-466a-ad9c-3b520aaa0159’ ‘cabernetvm’
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: No tap device found for nic 0
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: ExitCode: 1
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: error: failed to get domain ‘/var/lib/one//datastores/0/24/var/lib/one//datastores/0/24/deployment.03ac67a4a-421f-466a-ad9c-3b520aaa0159’
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: /var/tmp/one/datastore/xpath.rb:70:in block in <main>': undefined method elements’ for nil:NilClass (NoMethodError)
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: from /var/tmp/one/datastore/xpath.rb:64:in each' Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: from /var/tmp/one/datastore/xpath.rb:64:in
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: Datastore path not found
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: ExitCode: 0
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: Successfully execute virtualization driver operation: cancel.
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: clean: Executed “sudo -n ovs-vsctl --if-exists del-port ovsbr0 one-24-0”.
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: ExitCode: 0
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: Successfully execute network driver operation: clean.
Thu Oct 13 09:37:20 2022 [Z0][VMM][I]: Failed to execute network driver operation: post.
Thu Oct 13 09:37:20 2022 [Z0][VMM][E]: DEPLOY: ovswitch: No tap device found for nic 0 ExitCode: 1
Thu Oct 13 09:37:20 2022 [Z0][VM][I]: New LCM state is BOOT_FAILURE
Thu Oct 13 09:37:22 2022 [Z0][LCM][I]: VM reported RUNNING by the drivers
Thu Oct 13 09:37:22 2022 [Z0][VM][I]: New LCM state is RUNNING

Frontend + Node : Rocky Linux 8.6 + OpenNebula 6.4.0 + KVM + ovswitch 2.17

Rocky Linux is not a supported platform on frontend and virtualization nodes. It is only supported as a Guest OS.

Now trying with Alma Linux as host and Rocky Linus as guest VM I’m getting this error:

DEPLOY: error: Failed to create domain from /var/lib/one//datastores/0/3/deployment.0 error: invalid argument: could not get preferred machine for /usr/bin/qemu-kvm-one type=kvm Could not create domain from /var/lib/one//datastores/0/3/deployment.0 ExitCode: 255

Make sure KVM is properly configured on your host. Or use LXC alternatively is KVM is unavailable.