hi, I want to change the ip of a RPI HAOS installation.
long story short: I have HA running in a VM on a big server, that uses to much energy. during nighttimes i found it is sufficient to have a RPI to take care of HA. and switch back to to the big server when getting up.
i thought it would be cool to have the following:
big server (ip: .238) is on. creates backup at 9pm.
after backup is done, big server changes IP to .237
rpi (ip: .236) restores backup from big server
after backup is restored and .238 is not reachable, RPI switches IP to .238
in the morning RPI creates a backup.
after backup PRI changes IP to .236
big server restores backup from RPI
after backup is done and .238 is not reachable, IP changes from .237 to .238
I want switch from sqlite to mariadb do that historical data is maintained.
Zigbee coordinator is a zigstar poe adapter (integrated with ZHA
is my idea completly nuts?
However, I am able to change an installations IP with ha network update .... however putting this into a script in cinfiguration.yaml it is not working. The command works within the ssh & terminal addon just fine. Anyone might have an idea to accomplish what i want?! or even did a similar setup?
The backups are stored in a nextcloud instance that is locally attached with smb.
I hope someone can help me out because other approaches like HAHA are not what i am looking for, unfortunately.
the reason for the IP switch is simple. I wann the app to be working all the time excep the couple of minutes where the ipswitch happens.
much if not all of this can be run by virtualizing your HA instance and schedule a movement of the compute part of it at certain times. Vmware vmotion would work well, not sure what other hypervisors calls this. A Pi wont run a hypervisor but a NUC could.
Is this something you could do running a docker cluster, or perhaps kubernetes?
How much power does your server use? I have a 2U Dell, it can go as low as 150W.
Love the idea but not sure how stable and hassle free it would be doing it as you describe
I wouldn’t. As interesting as the thought is conceptually, Waaaaay too many moving parts that have to work EXACTLY RIGHT in order every time or you could have data loss. My experience is that rarely happens. Meaning you’ll spend most of your time fixing this. Which will defeat the purpose.
That said…
There’s more to name resolution and server availability than host name. A lot of stuff uses IP address to locate hosts. Yous have to have an insanely short ttl on your DNS services so that when you swap IPs everything else can find it. Until ttlnexpires and DNS flushes out the old IP things will be… Weird. (especially with HA core) id try to keep the IP address the same which means instead of changing the IP address you’re better swapping IPs in network and using reserved addresses and Dhcp to move stuff around.
It can take literally hours for a restore to happen on a Pi (ask me how many times I restored my own last week during the updates to the Appdaemon and Node Red addons) What do you plan to do once the backup completes before your pi comes up? If your server keeps going then whatever happens between backup and restore is lost.
Not too familiar with the workstations, do these have idrac like servers which you can use to power the workstation on? Like I said I love your idea, but it seems a lot of things could fail in the process. You can get cheap, not-power hungry NUCs or other mini-pcs that are compatible with hypervisors, and since you already have a network zigbee adapter you are free to move your vm around. I do the same here, not for power reasons but for maintenance. A couple of clicks and my HA is moved live from my 2U server to my NUC without losing a single ping
If I were to copy your use case to my environment it’s as simple as setting up scheduled tasks in the hypervisor to migrate the vm to the “cheap” compute, power off the main server and reverse the process when wanted.
yh that r7910 also has idrac @NathanCu is right in reg. to restore time. haven’t thought about ttl in my local dns… i might have to reconsider the idea to be fully fledged thanks so far for the hints and sticks to stumble on
That’s good, then you can integrate your idrac both to HA to get readings and also to the hypervisor to do power on / off. If you are on a power-saving mission look into the power profiles on the idrac (if those exist on workstations, not sure), you can save some watts by turning down the performance as well.
That’s the only “non-automated” part at my end, my NUC does not have a way for me to trigger it on by the hypervisor, I need to physically press the power button. I haven’t bothered connecting a screen and a keyboard to it (NUC is tucked away on my attic), to see if it has a BIOS setting to resume power I could try using a smart plug to trigger it.
The great part about doing it the virtual migration way is that you do not need to think about DNS, restore times etc. And if you are really fancy you could set up replication that kicks in if your server for some reason fails