Part 2
Part 3
Part 4
I finally was able to do something I’ve wanted to do for quite some time, and that is automate the startup/shutdown of my lab environment. I’m a Pre-Sales Engineer so my labs tend to have more than a dozen endpoints, and I have two different environments. It’s rather tedious to have to “artisanally” hand crank this environment up every time I need it, node by node.
This is going to be a multi-page article much like my Proxmox series. The first section will go over the reasoning and prep, the following entries will go over what’s needed to pull it all together.
Let’s go over the topology before I set my project goals.
Proxmox
My SSE (Secure Service Edge) demo environment runs off my Proxmox hypervisor. The MINI-FS box this runs on is powered 24/7 so power isn’t the concern, it’s VM control. I don’t like to leave things on all the time if they aren’t being used. This lab has 9 VMs with a mix of windows and Linux.
Dell-R620
This box is my demo PNET powered SD-WAN lab server. It has almost 24 nodes on it, and is only on when I need it, so easy power management is important.
Note: PNET is a fork of EVE-NG so the process I use here should be identical.
Home Assistant
This is a local management platform for IOT devices, such as locks, lights, motion sensors, etc. It’s a fantastically powerful piece of open source software. I will be using HA to tie this all together. When I’m done, I’ll have this working:
At some point, I’ll have a different post on Home Assistant itself.
Project Goals
My primary goals are:
Remote ability to power on both environments
“Zero-Touch” spin-up, nodes will start up in a staged fashion.
Ability to keep the Dell Server completely powered off until needed. The IDRAC consumes 10 watts in standby, I don’t even want that on.
Integration with both Proxmox and PNET into Home Assistant.
Project Prep
Dell R620:
As I mentioned before, I want to be able to keep the server completely off, even the IDRAC until needed, and fire up on demand. The first step in this process is a smart plug. I chose a Third Reality Zigbee plug, that also reports power consumption information. This plug will get onboarded into Home Assistant so I can call it as a service.
The second step was the configure the server to completely power up when power is applied, and not sit in IDRAC standby mode. That part completed, let’s move onto the prep for Proxmox.
Proxmox:
For overall effort, the Promox prep is going to be far simpler than PNET. Home Assistant has many different integrations, and while Proxmox is available… there’s no gentle way to say this. It sucks. There is a different integration that can be added called HACS “Home Assistant Community Store” which is a custom integration that provides access to many other services outside the official channels.
It has a far better Proxmox add-on. VMs can be added as “entities” along with startup/shutdown/stop commands that are native to QEMU. The repo for it can be found here:
https://github.com/dougiteixeira/proxmoxve
Home Assistant:
HACS and the Proxmox integration must be installed, as well as the
Node-RED add-on. If you’ve never heard of Node-Red before it’s an amazingly versatile “visual programming” automation engine. It’s how I create all of my automations in HA. For example, here is my logic that powers the screenshot earlier in the article. We’ll go into it further when we go into the actual steps to get it working.
When we’re done here and you try this yourself, you may actually find a better way to use these tools. And I hope you do! I’m not a programmer in any way, shape, or form and this is what I managed to come up with,
In part two, I’ll go over the integration steps needed to bring it all together for each system.
Until next time!