QNAP Virtual Station for openhab?

I’m running my house on openhab for 2 years already on RPI3 and all is fine, but every upgrade is quite a stress.
I have a backup RPI3 with the same SD card image just in case something craps out, and 2.0->2.1 was quite a problematic since the behavior of my main relay binding Tinkerforge changed. Also recovering from an SD backup makes me loose a lot of archived persistence data. And there is plenty that I want to compare year to year.

My OH2 setup is quite mission critical now with all the light switches and central heating relay on it in 100%.

So with imminent upgrade to 2.2 I wanted to make my setup bullet proof. I’m now convinced that a powerful QNAP NAS would be a good solution to virtualize my openhab. I could also put on separate machines an NVR for CCTV and Controler for the UBNT WiFI and POE switches. I would fold 3 machines into single QNAP.
An obvious advantage are constant backups of the VM and ability to bring it back at will if the upgrade goes bad.
One challenge would be using a Z-wave dongle I use for the shutters and some extra light switches that I forgot about when designing wiring. But I think it can be done with port mapping.

Did anyone tried that? Is there some trap that I do not see now? Before I spill 1.5K Euro on hardware.
Any thoughts are welcome.
TIA Maciej

My only thoughts are:

  • if you lose a significant amount of persistence data when you have to do a restore your backup procedure is insufficient; you will need to make this better even if you do move to a QNAP

  • the upgrade process has improved significantly for 2.2, though I can’t guarantee that all the bindings you use remain the same

  • there are QNAP installation instructions but I also know from forum postings installation is not always pain-free

  • the QNAP is not going to make the upgrade process any easier

Yes - I’m using a TVS-671 with the following VM, all running standard Ubuntu:

  • Openhab - Current live system, stable 2.2

  • Openhab Test enviroment, was mainly used for migrating from OH 1 to OH2

  • InfluxDB and Grafana

  • Ubiquity Controller

I’ve also had another VM with Zoneminder, however I deleted that as I never got it to work - I’m using a bunch of Raspberries now with local motion dection, uploading the recorded videos to the QNAP and from there to the cloud - works better than zoneminder for me. From time to time I also add other VM for testing purposes, never had any performance issues. Openhab installation is as easy as apt-get openhab once you have the repository configured, somewhere is a guide on how to do that - no issues at all with this. You can even switch between stable/testing/nightly build with this, however don’t try this on your live system as I did - You might encounter some bugs :slight_smile:

Issues I had were mainly my own stupidity - I’ve lost a bunch of Unix scripts to interface to my Zipato controller as I deleted my OH 1 VM without moving these to the new system. Furthermore I was too lazy to move all my old persistence data from rrdj4 to InfluxDB when I did that migration, unfortunately someone published a migration tutorial somewhere here almost exactly after I deleted my old OH 1 VM with the rrd4j data again…

It is possible to connect physical USB ports to VM during startup of the VM, with this I’m using a zwave stick and a plugwise stick without issues. Sometimes in the past the sticks were not automatically connected during boot but this got either fixed or it was my own stupidity as I was switching between two VM for openhab. CORRECTION: As you can see in the screenshot below the USB ports were not corrected - It seems after rebooting the QNAP you have to manually map them again, rebooting the VM itself will keep the mapping - I did a upgrade of the QNAP earlier today and rebooted it.

Mine has an Intel Core i5 with 16GB of RAM, utilization of the VM is really good - I had all VM configured with 2 kernels and 4GB of RAM before but reduced them recently. I also think of moving my Plex server from the QNAP itself to another VM on the same system due to maintainability.

1 Like

Max, Many thanks for solidifying my idea that QNAP Nas is a good idea.

Did you install Ubuntu from scratch on every VM or used some premade running image?
I also will separate the DB VM from openhab VM as that comes almost at no cost if you have a VM environment setup.

I don’t have a QNAP but I do have a Synology. There seems to be a lot more support for that side.
That said, I run everything out of my Syno. Cameras, plex, usenet stuff, OH, and probably a dozen other things. Sometimes I get nervous relying on one machine for everything but I’m so tired of maintaining a ton of machines and all the power they eat up. I’ve been relying on Synology mostly in this manner for probably 4+ years though so I suppose I need to relax.

Good luck, i think you’re on the right track.

Why don’t you just use container? There’s OH2.2 containers, just need to make sure you keep everything you want from the default container into a new container using “docker run” such as ttyUSB, network configuration etc. Once you’re happy with the setup you basically image it then you can put it up and pull it down whenever you like.

Just remember that permissions on ttyUSB are default administrator when you reboot. I get around this by running a startup script on the NAS itself to chmod it every single time

I installed ubuntu from scratch each time, not a big deal. I didnt even bother to strip it down to a minimal system or such, just a Ubuntu standard installation. There are others using docker containers too, but they were a bit behind the release cycle at least when I decided to move to VM. I’ve chosen the TVS-671 as I got a really big deal on it (exhibition sample), moving from some ReadyNAS boxes I had before (still use them for backups). There are other vendors out there as well, but I can strongly recommend QNAP and ReadyNAS.

I’m using openHAB 2.2 on a QNAP TS-453 Pro (with 16GB RAM - yes, I know that officially it supports only 8GB, but… hell! - it works and it’s using the whole 16GB!) , running in a VM, and, as persistence, I’m using the MariaDB server provided by QNAP.
Previously, I had it running on a Raspberry PI3 (persistence also on NAS) and somehow I managed to put it to its knees sometimes (lots of rules and items). So I decided to try running on the NAS.
I also tried running openHAB in a docker container and it was running smoothly, but I’m using a lot of shell scripts and python ones and I had some trouble getting those to work with the docker container.
So, I created a VM with 4 cores and 4GB RAM, installed Ubuntu Server 16.04.4 LTS and it’s running perfectly…

I just decided to go full on and ordered new TS-877 with 8 Core Ryzen7 and will move every single server in the house into it. Hope OH will be snappy on that one. Power wise it is quite a lot at 60W idle but I have TS-419 as file server (can’t run VM on that one) that will now fold into new machine + plus all those RPI’s so maybe it will not be much more. UPS shows that my house electronics now draw 142 W.

Honesty I only wish if there was a way to use an image of the sd card i now have in RPI and run on the QNAP as VM so I would not have to re install of the scripts and port config.

Ok so I’m up and running on a new QNAP and it was quite trouble less install. Got it ported by hand with all my python scripting in like 3h.

But it is not all perfect.
1st as mentioned by @Max1968 USB handling is a major PITA. If I setup daily backup of the Openhab VM it will disconect Zwave dongle for backup and will not reconect it then. Connecting it back on the go sometimes results in dongle comeing up as /dev/ttyACM1 not ACM0 and that is unxepected by OH. Requires a VM reboot to fix.

Lucky I decided to move Influx/Grafana to separate VM that has to be backed up daily so I can resort to backup the OH2 only on conf changes .

Really something needs to be done about it, we can hammer QNAP support to improve the USB handling.
But I think there could be a solution by using a USB proxy on some RPI with a dongle and proxy it to VM, Anyone has the idea?

2nd issue is rather an observation that I do not see a phenomenal increase in the responsiveness on the new setup. In fact I would say that Android APP UI is actually slower. It could be that 2.2 is slower then 2.1 but I doubt it. The VM is having 4cores and on the simple geekbench it will get 10x score of the RPI3, so I was expecting it will be a bit faster at least.

CPU is almost never the bottle neck with OH. When it is it is usually because of poorly written rules.

If the Android app is slower, it is probably most likely to be caused by network, not CPU. I can really see this being a problem when switching to a VM as now you have another layer of networking to pass through.

On memory constrained machines (512 mb or less) ram can become a problem for larger oh instances but 1 gb and above should be fine.

So no, I wouldn’t expect to see a significant speed up in a move from a RPi 3 to a VM. OH isn’t CPU constrained enough. Most of the time oh is waiting around for events to happen or waiting for io.

1 Like

Jeez, Thank you so much, that solved 2 issues in one go, as I was relying on the zwave range extender for getting from the basement server room to the ground floor where i have zwave roller shutter controllers.

Does anyone know if USB support has improved alot in QNAP? considering porting my install to a VM under Virtulisaton Station on a QNAP 880 (Xeon, 10Gbit LAN, 32GB Ram, SSD Disks)

USB support is still the same, sometimes connection gets lost after reboot (of the QNAP/virtualization station) and needs to be manually reconnected - For me this is no issue as I only reboot for updates of the QNAP.

I do install updates on the openhab VM on a weekly basis, always followed by a reboot of the VM (as I’m having some issues with open files or such), and I think i never lost USB due to this. Perhaps someone else can double check, I might be wrong with this. I don’t do regular backups of the openhab VM, only when i change config, and sometimes a snapshot. Influx is running on another VM as well and regularly backed up.

1 Like

Thanks Max, I going to put a test machine onto the QNAP and have a play around with it as I have a second USB Zwave stick and see how it goes.

For a z wave stick use the proxy on the RPI, the direct connection to QNAP will not survive the backup. But on the windows VM they fixed that already.