# Failed to adding a KVM Host to OpenNebula

**URL:** <https://forum.opennebula.io/t/failed-to-adding-a-kvm-host-to-opennebula/7126>\
**Category:** Operations\
**Created:** [April 9, 2019, 8:55am UTC](https://forum.opennebula.io/t/failed-to-adding-a-kvm-host-to-opennebula/7126 "2019-04-09T08:55:48Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mvisser](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@mvisser](https://forum.opennebula.io/u/mvisser)\
**Post date:** [April 9, 2019, 8:55am UTC](https://forum.opennebula.io/t/failed-to-adding-a-kvm-host-to-opennebula/7126/1 "2019-04-09T08:55:48Z")

</div>

My use case is:

- 1 node (xffhyp4d) is installed as frontend server, as described [here](http://docs.opennebula.org/5.8/deployment/opennebula_installation/frontend_installation.html):
- 2 nodes (xffhyp5d and xffhyp6d) are installed as KVM node, as described [here](http://docs.opennebula.org/5.8/deployment/node_installation/kvm_node_installation.html)
- Installation on top of RHEL7.6
- I can successfully SSH without a password to the other 2 nodes (from all machines) based on their short hostname, with the user oneadmin.

When I am in Step 7 Adding a Host to OpenNebula, I get a failure with the following error message from the logs:

Frontend (xffhyp4d) oned.log:

> Tue Apr 9 10:51:10 2019 [Z0][ReM][D]: Req:6096 UID:0 IP:127.0.0.1 one.zone.raftstatus invoked  
> Tue Apr 9 10:51:10 2019 [Z0][ReM][D]: Req:6096 UID:0 one.zone.raftstatus result SUCCESS, “\<SERVER\_ID\>-1\<…”  
> Tue Apr 9 10:51:10 2019 [Z0][ReM][D]: Req:7648 UID:0 IP:127.0.0.1 one.vmpool.info invoked , -2, -1, -1, -1  
> Tue Apr 9 10:51:10 2019 [Z0][ReM][D]: Req:7648 UID:0 one.vmpool.info result SUCCESS, “\<VM\_POOL\>\</VM\_POOL\>”  
> Tue Apr 9 10:51:10 2019 [Z0][ReM][D]: Req:8608 UID:0 IP:127.0.0.1 one.vmpool.info invoked , -2, -1, -1, -1  
> Tue Apr 9 10:51:10 2019 [Z0][ReM][D]: Req:8608 UID:0 one.vmpool.info result SUCCESS, “\<VM\_POOL\>\</VM\_POOL\>”  
> Tue Apr 9 10:51:12 2019 [Z0][AuM][D]: Message received: AUTHENTICATE SUCCESS 21 -
> 
> Tue Apr 9 10:51:12 2019 [Z0][ReM][D]: Req:3840 UID:0 IP:127.0.0.1 one.host.allocate invoked , “xffhyp6d”, “kvm”, “kvm”, 0  
> Tue Apr 9 10:51:12 2019 [Z0][ReM][D]: Req:3840 UID:0 one.host.allocate result SUCCESS, 16  
> Tue Apr 9 10:51:12 2019 [Z0][ReM][D]: Req:8400 UID:0 IP:127.0.0.1 one.host.update invoked , 16, “NAME=“xffhyp6d”  
> VM\_M…”, 1  
> Tue Apr 9 10:51:12 2019 [Z0][ReM][D]: Req:8400 UID:0 one.host.update result SUCCESS, 16  
> Tue Apr 9 10:51:12 2019 [Z0][ReM][D]: Req:1200 UID:0 IP:127.0.0.1 one.host.info invoked , 16  
> Tue Apr 9 10:51:12 2019 [Z0][ReM][D]: Req:1200 UID:0 one.host.info result SUCCESS, “16\<NA…”  
> Tue Apr 9 10:51:12 2019 [Z0][ReM][D]: Req:4400 UID:0 IP:127.0.0.1 one.hostpool.info invoked  
> Tue Apr 9 10:51:12 2019 [Z0][ReM][D]: Req:4400 UID:0 one.hostpool.info result SUCCESS, “\<HOST\_POOL\>\<ID…”  
> Tue Apr 9 10:51:12 2019 [Z0][ReM][D]: Req:9024 UID:0 IP:127.0.0.1 one.user.info invoked , 0  
> Tue Apr 9 10:51:12 2019 [Z0][ReM][D]: Req:9024 UID:0 one.user.info result SUCCESS, “0\<GID…”  
> Tue Apr 9 10:51:22 2019 [Z0][InM][D]: Monitoring host xffhyp6d (16)  
> Tue Apr 9 10:51:24 2019 [Z0][InM][I]: Command execution failed (exit code: 42): ‘if [-x “/var/tmp/one/im/run\_probes”]; then /var/tmp/one/im/run\_probes kvm /var/lib/one//datastores 4124 60 16 xffhyp6d; else exit 42; fi’  
> Tue Apr 9 10:51:24 2019 [Z0][InM][I]: Remote worker node files not found  
> Tue Apr 9 10:51:24 2019 [Z0][InM][I]: Updating remotes  
> Tue Apr 9 10:51:26 2019 [Z0][InM][I]: Command execution failed (exit code: 42): ‘if [-x “/var/tmp/one/im/run\_probes”]; then /var/tmp/one/im/run\_probes kvm /var/lib/one//datastores 4124 60 16 xffhyp6d; else exit 42; fi’  
> Tue Apr 9 10:51:26 2019 [Z0][InM][I]: Remote worker node files not found  
> Tue Apr 9 10:51:26 2019 [Z0][InM][I]: Updating remotes  
> Tue Apr 9 10:51:29 2019 [Z0][InM][I]: Command execution failed (exit code: 42): ‘if [-x “/var/tmp/one/im/run\_probes”]; then /var/tmp/one/im/run\_probes kvm /var/lib/one//datastores 4124 60 16 xffhyp6d; else exit 42; fi’  
> Tue Apr 9 10:51:29 2019 [Z0][InM][I]: Remote worker node files not found  
> Tue Apr 9 10:51:29 2019 [Z0][InM][I]: Updating remotes  
> Tue Apr 9 10:51:32 2019 [Z0][InM][I]: Command execution failed (exit code: 42): ‘if [-x “/var/tmp/one/im/run\_probes”]; then /var/tmp/one/im/run\_probes kvm /var/lib/one//datastores 4124 60 16 xffhyp6d; else exit 42; fi’  
> Tue Apr 9 10:51:32 2019 [Z0][ONE][E]: Error monitoring Host xffhyp6d (16): -  
> Tue Apr 9 10:51:34 2019 [Z0][DBM][I]: Purging obsolete LogDB records: 0 records purged. Log state: 0,0 - 0,0  
> Tue Apr 9 10:51:34 2019 [Z0][DBM][I]: Purging obsolete federated LogDB records: 0 records purged. Federated log size: 0  
> Tue Apr 9 10:51:40 2019 [Z0][ReM][D]: Req:5232 UID:0 IP:127.0.0.1 one.zone.raftstatus invoked  
> Tue Apr 9 10:51:40 2019 [Z0][ReM][D]: Req:5232 UID:0 one.zone.raftstatus result SUCCESS, “\<SERVER\_ID\>-1\<…”  
> Tue Apr 9 10:51:40 2019 [Z0][ReM][D]: Req:4800 UID:0 IP:127.0.0.1 one.vmpool.info invoked , -2, -1, -1, -1  
> Tue Apr 9 10:51:40 2019 [Z0][ReM][D]: Req:4800 UID:0 one.vmpool.info result SUCCESS, “\<VM\_POOL\>\</VM\_POOL\>”  
> Tue Apr 9 10:51:40 2019 [Z0][ReM][D]: Req:4480 UID:0 IP:127.0.0.1 one.vmpool.info invoked , -2, -1, -1, -1  
> Tue Apr 9 10:51:40 2019 [Z0][ReM][D]: Req:4480 UID:0 one.vmpool.info result SUCCESS, “\<VM\_POOL\>\</VM\_POOL\>”

KVM host (xffhyp6d) logs:

> ==\> /var/log/messages \<==  
> Apr 9 10:51:31 xffhyp6d systemd-logind: Removed session 207.  
> Apr 9 10:51:31 xffhyp6d systemd: Removed slice User Slice of oneadmin.
> 
> ==\> /var/log/secure \<==  
> Apr 9 10:51:32 xffhyp6d sshd[21660]: Accepted publickey for oneadmin from 172.25.252.65 port 44750 ssh2: RSA SHA256:COkhwHK2KghRVtG9P43lwTHdwUV3O33Enu2OwrCDQdI
> 
> ==\> /var/log/messages \<==  
> Apr 9 10:51:32 xffhyp6d systemd: Created slice User Slice of oneadmin.  
> Apr 9 10:51:32 xffhyp6d systemd-logind: New session 208 of user oneadmin.  
> Apr 9 10:51:32 xffhyp6d systemd: Started Session 208 of user oneadmin.
> 
> ==\> /var/log/secure \<==  
> Apr 9 10:51:32 xffhyp6d sshd[21660]: pam\_unix(sshd:session): session opened for user oneadmin by (uid=0)  
> Apr 9 10:51:32 xffhyp6d sshd[21663]: Received disconnect from 172.25.252.65 port 44750:11: disconnected by user  
> Apr 9 10:51:32 xffhyp6d sshd[21663]: Disconnected from 172.25.252.65 port 44750  
> Apr 9 10:51:32 xffhyp6d sshd[21660]: pam\_unix(sshd:session): session closed for user oneadmin

How can I resolve this error?

---

<div class="post-metadata">

**Author:** ![jorel](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jorel/32/6552_2.png) [@jorel](https://forum.opennebula.io/u/jorel)\
**Post date:** [April 9, 2019, 9:20am UTC](https://forum.opennebula.io/t/failed-to-adding-a-kvm-host-to-opennebula/7126/2 "2019-04-09T09:20:57Z")

</div>

Hello,

could you check following?

- you can also `scp` some blank file as oneadmin from the frontend to the host you are adding? (without password and host verification)?
- you are running opennebula frontend under `oneadmin` user?

Thanks, Jan

---

<div class="post-metadata">

**Author:** ![mvisser](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@mvisser](https://forum.opennebula.io/u/mvisser)\
**Post date:** [April 9, 2019, 9:30am UTC](https://forum.opennebula.io/t/failed-to-adding-a-kvm-host-to-opennebula/7126/3 "2019-04-09T09:30:20Z")

</div>

Frontend server:

> [oneadmin@xffhyp4d ~]$ touch testfile  
> [oneadmin@xffhyp4d ~]$ scp testfile xffhyp6d:~/  
> testfile 100% 0 0.0KB/s 00:00  
> [root@xffhyp4d ~]# ps aux | grep oned  
> oneadmin 8539 0.1 0.0 2106408 15712 ? Ssl Apr08 1:43 /usr/bin/oned -f

KVM node:

> ==\> /var/log/secure \<==  
> Apr 9 11:28:09 xffhyp6d sshd[24149]: Accepted publickey for oneadmin from 172.25.252.65 port 45412 ssh2: RSA SHA256:COkhwHK2KghRVtG9P43lwTHdwUV3O33Enu2OwrCDQdI

---

<div class="post-metadata">

**Author:** ![jorel](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jorel/32/6552_2.png) [@jorel](https://forum.opennebula.io/u/jorel)\
**Post date:** [April 9, 2019, 9:57am UTC](https://forum.opennebula.io/t/failed-to-adding-a-kvm-host-to-opennebula/7126/4 "2019-04-09T09:57:18Z")

</div>

- SELinux is turned off?
- could you run " /var/tmp/one/im/run\_probes kvm /var/lib/one//datastores 4124 60 16 xffhyp6d" on xffhyp6d (onedmin) and paste the output?

---

<div class="post-metadata">

**Author:** ![jorel](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jorel/32/6552_2.png) [@jorel](https://forum.opennebula.io/u/jorel)\
**Post date:** [April 9, 2019, 11:45am UTC](https://forum.opennebula.io/t/failed-to-adding-a-kvm-host-to-opennebula/7126/5 "2019-04-09T11:45:49Z")

</div>

Also, what OpenNebula version do you install?

---

<div class="post-metadata">

**Author:** ![mvisser](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@mvisser](https://forum.opennebula.io/u/mvisser)\
**Post date:** [April 10, 2019, 6:33am UTC](https://forum.opennebula.io/t/failed-to-adding-a-kvm-host-to-opennebula/7126/6 "2019-04-10T06:33:44Z")

</div>

SElinux is off indeed.

There is no such directory “/var/tmp/one”:

> [oneadmin@xffhyp4d ~]$ /var/tmp/one/im/run\_probes kvm /var/lib/one//datastores 4124 60 16 xffhyp6d  
> -bash: /var/tmp/one/im/run\_probes: No such file or directory  
> [oneadmin@xffhyp4d ~]$ ls /var/tmp/  
> systemd-private-77f4d229d5c34589a7eb767a6280c2c9-arpwatch.service-Tbo0hr  
> systemd-private-77f4d229d5c34589a7eb767a6280c2c9-mariadb.service-zZnzLN  
> systemd-private-77f4d229d5c34589a7eb767a6280c2c9-ntpd.service-HcMLOP

Opennebula version is 5.8.0.

---

<div class="post-metadata">

**Author:** ![jorel](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jorel/32/6552_2.png) [@jorel](https://forum.opennebula.io/u/jorel)\
**Post date:** [April 10, 2019, 8:12am UTC](https://forum.opennebula.io/t/failed-to-adding-a-kvm-host-to-opennebula/7126/7 "2019-04-10T08:12:09Z")

</div>

Still looks to me like ssh keys issue. Anyway, could you run that command on **xffhyp6d** as oneadmin?  
`/var/tmp/one/im/run_probes kvm /var/lib/one//datastores 4124 60 16 xffhyp6d`

And also can you try this on frontend:  
`onehost sync --force`  
and  
`onehost sync --force --rsync`?

---

<div class="post-metadata">

**Author:** ![mvisser](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@mvisser](https://forum.opennebula.io/u/mvisser)\
**Post date:** [April 10, 2019, 8:36am UTC](https://forum.opennebula.io/t/failed-to-adding-a-kvm-host-to-opennebula/7126/8 "2019-04-10T08:36:37Z")

</div>

> [oneadmin@xffhyp6d ~]$ /var/tmp/one/im/run\_probes kvm /var/lib/one//datastores 4124 60 16 xffhyp6d  
> -bash: /var/tmp/one/im/run\_probes: Permission denied  
> [oneadmin@xffhyp6d ~]$ ls -lah /var/tmp/one/im/run\_probes  
> -rwxr-xr-x. 1 oneadmin oneadmin 1.9K Feb 25 17:45 /var/tmp/one/im/run\_probes  
> [oneadmin@xffhyp6d ~]$ ls -lah /var/lib/one//datastores  
> ls: cannot access /var/lib/one//datastores: No such file or directory  
> [oneadmin@xffhyp6d ~]$ ls -lah /var/lib/one/  
> total 24K  
> drwxr-xr-x. 3 oneadmin oneadmin 127 Apr 9 11:25 .  
> drwxr-xr-x. 39 root root 4.0K Apr 5 11:28 …  
> -rw-------. 1 oneadmin oneadmin 626 Apr 9 12:01 .bash\_history  
> -rw-r–r–. 1 oneadmin oneadmin 18 Apr 5 11:28 .bash\_logout  
> -rw-r–r–. 1 oneadmin oneadmin 193 Apr 5 11:28 .bash\_profile  
> -rw-r–r–. 1 oneadmin oneadmin 231 Apr 5 11:28 .bashrc  
> drwx------. 2 oneadmin oneadmin 94 Apr 5 16:26 .ssh  
> -rw-r-----. 1 oneadmin oneadmin 0 Apr 9 11:28 testfile  
> -rw-------. 1 oneadmin oneadmin 2.0K Apr 5 16:26 .viminfo

> [oneadmin@xffhyp4d ~]$ onehost sync --force
> 
> - Adding xffhyp6d to upgrade  
> [========================================] 1/1 xffhyp6d  
> All hosts updated successfully.  
> [oneadmin@xffhyp4d ~]$ onehost sync --force --rsync
> - Adding xffhyp6d to upgrade  
> [========================================] 1/1 xffhyp6d  
> All hosts updated successfully.  
> [oneadmin@xffhyp4d ~]$ onehost list  
> ID NAME CLUSTER TVM ALLOCATED\_CPU ALLOCATED\_MEM STAT  
> 16 xffhyp6d default 0 - - err

What exactly should I be able to ssh?  
from oneadmin@xffhyp4d to oneadmin@xffhyp5d/xffhyp6d  
from oneadmin@xffhyp5d/xffhyp6d to oneadmin@xffhyp4d  
This works without password…

---

<div class="post-metadata">

**Author:** ![jorel](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jorel/32/6552_2.png) [@jorel](https://forum.opennebula.io/u/jorel)\
**Post date:** [April 10, 2019, 10:53am UTC](https://forum.opennebula.io/t/failed-to-adding-a-kvm-host-to-opennebula/7126/9 "2019-04-10T10:53:19Z")

</div>

Well, ssh looks OK, but it seems you have mounted /var/tmp with noexec, could it be the case?

Can you remount with:  
`mount -o remount,exec /var/tmp`  
on xffhyp5d/xffhyp6d and try again?

---

<div class="post-metadata">

**Author:** ![mvisser](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@mvisser](https://forum.opennebula.io/u/mvisser)\
**Post date:** [April 10, 2019, 11:04am UTC](https://forum.opennebula.io/t/failed-to-adding-a-kvm-host-to-opennebula/7126/10 "2019-04-10T11:04:00Z")

</div>

You got it!  
/var/tmp and /tmp is mounted (nodev,noexec,nosuid), accordingly to the CIS hardening standards.

Thanks for your help. We will continue our Proof of Concept.
