
apnar
Members-
Posts
212 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
apnar's Achievements
-
It won’t help but I had the same issue using the hue emulator built into Home Assistant. Stood it up and the harmony didn’t detect it. I eventually gave up and just used an automation based on something else in the system turning on/off.
-
That sucks. Are you still running in mirrored mode or did you move fully to nvme?
-
What is the issue that is making you think you need to revert?
-
Home Assistant VM on eisy Error - Unsupported system - virtualization_image
apnar replied to pablohoney's topic in eisy
@tazman thanks for giving it a try. Took me a bit but I tracked down the issue. I use a significantly bigger sized virtual disk in my setup but had dropped it down to 16GB when I uploaded it to match what was in the original script. Even though the OVA file from HA is only 800MB they have it configured as a 32GB virtual disk so when it was trying to be copied to the smaller 16GB volume it errored out. Guess that's what I get for thinking a small tweak wouldn't cause any issues. As to the error on line 126, I'm not seeing that but suspect it might be related to posting the shell script on the forum. So I added some extra quoting and I'll upload it as a file here in addition to pasting it. Updated version: #!/bin/sh # Where do we want to storge VM resources (ZFS pool name and mount path) VMFILESET="storage/vms" VMDIR="/storage/vms" # Home Assistant VM name and how much resources to allocate HA_VM_NAME="homeassistant" HA_VM_CPU="2" HA_VM_MEM="1G" HA_VM_DISC="32G" # specify network interface - by default it's Ethernet re0 INTERFACE="re0" if [ $(id -u) != "0" ] then echo "Must be run with sudo" exit fi # Automatically pick the latest release from https://github.com/home-assistant/operating-system/releases/ HA_IMAGE_URL=$(curl -sL https://api.github.com/repos/home-assistant/operating-system/releases/latest | \ grep "browser_download_url.*haos_ova.*qcow2.xz" | sed -e 's/.*: "\(.*\)"/\1/') # Internal variables TMPDIR=`mktemp -d` IMAGE_NAME="${TMPDIR}/haos_ova-x86-64.img" VM_CONF=${VMDIR}/${HA_VM_NAME}/${HA_VM_NAME}.conf # make sure ifconfig_DEFAULT is not set as it causes tap0 interface issues # ensure re0 is set to DHCP sysrc -x ifconfig_DEFAULT sysrc ifconfig_re0="DHCP" echo "Make sure necessary packages are installed" pkg install -y vm-bhyve edk2-bhyve wget qemu-tools echo "Prepare /etc/rc.conf" sysrc vm_enable="YES" sysrc vm_dir="zfs:${VMFILESET}" # this makes Home Assistant VM start up automatically on boot, comment out if this is not desired sysrc vm_list=${HA_VM_NAME} echo "Create ZFS fileset for VMs and prepare templates" zfs create ${VMFILESET} vm init cp /usr/local/share/examples/vm-bhyve/*.conf ${VMDIR}/.templates/ # create VM networking (common for all VMs on the system) vm switch create public vm switch add public ${INTERFACE} echo "Downloading image" wget -O ${IMAGE_NAME}.xz ${HA_IMAGE_URL} echo "Extracting..." unxz ${IMAGE_NAME}.xz echo "Creating a VM" vm create -t linux-zvol -s ${HA_VM_DISC} ${HA_VM_NAME} echo "Image info:" qemu-img info ${IMAGE_NAME} echo echo "Copying image... (may take a bit of time)" qemu-img convert ${IMAGE_NAME} /dev/zvol/${VMFILESET}/${HA_VM_NAME}/disk0 rm -rf ${TMPDIR} GRAPHICS=0 echo -e "\n\nDo you want to enable unauthenticated VNC access to your Home Assistant virtual machine? (y/N)" read answer if [ "$answer" = "Y" ] || [ "$answer" = "y" ] then GRAPHICS=1 sysrc -f ${VM_CONF} graphics="yes" fi ## Initial setup TMPDIR=`mktemp -d` # set zvol to full so partitions are visable zfs set volmode=full ${VMFILESET}/${HA_VM_NAME}/disk0 sleep 2 # set baud rate for serial console mount -t msdosfs /dev/zvol/${VMFILESET}/${HA_VM_NAME}/disk0p1 ${TMPDIR} # add serial console to linux boot command line sed -i '' -e 's/console=ttyS0/console=ttyS0,115200/' ${TMPDIR}/cmdline.txt # umount device umount ${TMPDIR} SSH=0 echo -e "\n\nDo you want to enable SSH access to your Home Assistant virtual machine? (y/N)" read answer if [ "$answer" = "Y" ] || [ "$answer" = "y" ] then SSH=1 ## SSH Access # install ext4 fuse driver and load it pkg install -y fusefs-lkl kldload fusefs # mount vms /root/.ssh directory lklfuse -o type=ext4 /dev/zvol/${VMFILESET}/${HA_VM_NAME}/disk0p7 ${TMPDIR} sleep 5 mkdir -p ${TMPDIR}/root/.ssh chmod 700 ${TMPDIR}/root chmod 755 ${TMPDIR}/root/.ssh # create a new SSH keypair and at it as an authorized key in the VM ssh-keygen -t ed25519 -N "" -C "Access Home Assistant running on eisy on port 22222" -f /home/admin/ha-ssh-key cp /home/admin/ha-ssh-key.pub ${TMPDIR}/root/.ssh/authorized_keys # set perms so admin user can access the ssh keys chown admin:admin /home/admin/ha-ssh-key* umount ${TMPDIR} fi ## Clean up # switch zvol mode back to normal zfs set volmode=dev ${VMFILESET}/${HA_VM_NAME}/disk0 sleep 5 rmdir ${TMPDIR} sysrc -f ${VM_CONF} loader="uefi" sysrc -f ${VM_CONF} cpu=${HA_VM_CPU} sysrc -f ${VM_CONF} memory=${HA_VM_MEM} vm start ${HA_VM_NAME} vm info ${HA_VM_NAME} vm list echo -e "\n\n##########################################################################\n" echo "Please wait about 10 minutes and follow instructions at https://www.home-assistant.io/getting-started/onboarding/ to get your Home Assistant setup" echo "ISY integration: https://www.home-assistant.io/integrations/isy994/" echo -e "\nIf you need console access to the HA VM you can run \"sudo vm console ${HA_VM_NAME}\" then log in is as root. Use \"~~.\" to exit." if [ "$GRAPHICS" -eq "1" ]; then echo -e "\nYou can access your HA VM via VNC on port 5900 at your eisy's IP address." fi if [ "$SSH" -eq "1" ]; then echo -e "\nYou can access your HA VM via SSH using \"ssh -p22222 -i ha-ssh-key root@{HA VM IP}\"" fi md5 of script is 93f64d030f2531578df06c46d35c8056 create_ha_vm.sh -
Home Assistant VM on eisy Error - Unsupported system - virtualization_image
apnar replied to pablohoney's topic in eisy
I finally had a few cycles to take a look at this. I wrote up a modified script that will use the VM based Home Assistant images instead of the one meant for bare metal. I also added some other tweaks that allow you to choose to enable access to the VM via console, VNC, and SSH during install. Unfortunately there isn't an easy way to "fix" an existing install so you'll need to start from scratch or you can try backing up and restoring your HA config but no guarantees there. To start this will delete your current VM and all related configs. It will completely destroy your existing Home Assistant VM so only run this if you want to start fresh or are sure you have all the backups you need. sudo vm poweroff -f homeassistant sudo vm destroy -f homeassistant sudo vm switch destroy public sudo zfs destroy storage/vms Here is a new create_ha_vm.sh script. Save it and run it with sudo. see updated version below @Michel Kohanim it might be worth updating the blog post with this script so new installs get the proper image. -
Home Assistant VM on eisy Error - Unsupported system - virtualization_image
apnar replied to pablohoney's topic in eisy
The error is legit, but it is just a warning. The script on the blog uses the generic x64 OS image instead of one of the VM tailored images. They don’t have a FreeBSD VM image specifically but when I have some time I’ll see if I can get one of the other VM images running instead. For now it should be reasonably safe to ignore. -
Looks like the partition table on your NVME drive is corrupt somehow. You can try recreating it with: sudo gpart destroy -F nvd0 sudo gpart create -s GPT nvd0 Then reboot and retry the same commands from my message above to see if you get better results. Might also be worth trying reseating the NVME drive physically.
-
The scripts as they exist today appear to all be one way. If you want to go back to a mirror I could likely put together some commands you could run. If your drive dies support should be able to help you get the base OS back. You should be backing up your configs though.
-
What does “sudo gpart show nvd0” show? And “dmesg | grep nv”?
-
I suspect that this will be an issue for anyone with a zpool beyond the default eisy one(zudi). So folks that still boot from eMMC and add a drive, folks that mirror or boot from NVME and added an extra pool. Basically anyone that has an extra zpool (most likely called /storage). Easy enough to test, just reboot and see if /storage is there (or visible is in “zpool status”). Should be no harm in creating the directory: “sudo mkdir /etc/zfs” You may need to do a “sudo zpool export storage” then “sudo zpool import storage” to then get the correct cache file created once the directory is there.
-
@Michel Kohanim Ran into another small issue. On reboots my zfs pool /storage wasn't mounting automatically. It worked fine if I did a "zpool import storage" after boot. I tracked down the issue to a missing /etc/zfs directory which stopped the creation of the normal zpool.cache file. It's possible that it's something I missed in my manual steps recovering from the issue above but I don't see it created in any of the scripts. So I'd suggest adding a line to the scripts somewhere to creates /etc/zfs.
-
I don’t know about hot swapping but I’ve used the Zwave half with HA before and see no reason why the Zigbee half would t work as well.
-
@Michel Kohanim Just ran through the new easy way. Ran into an error which I tracked down. Sort of my own fault but I think you could improve the script a bit to avoid it. The prompt reads: Would you like to add an extra ZFS partition for your own purposes? (Y/n) As a regular *nix user I read this to be there are two choices yes or no and that yes is the default since it is capitalized. As such I just hit Enter to accept the default since that is what I wanted to do. This resulted in the following error: [: =: unexpected operator Checking the code is because the check on the result isn't properly in quotes. It also ended up giving a result opposite to what I wanted. Luckily the rest of the script continues on smoothly, just without creating the extra partition. I was able to go back, manually remove the partitions and recreate them as the script would have, just a bit of annoyance and likely outside the skill set of many. TLDR; I suggest changing line 352 in /usr/local/etc/udx.d/static/fl.ops from: if [ $answer = "Y" ] to something like: if [ "$answer" = "Y" ] || [ "$answer" = "y" ] || [ "$answer" = "" ] and while all the other questions in the script do properly quote $answer I'd be worth updating them to handle both cases as well as enter for accepting the default.
-
Micheal, Love that we now have a supported way to use NVME, thank you! I’d like to see an intermediate option between the mirror and no-mirror options, as I want the speed of the later with the protections of the former. I think this could be accomplished well with an asynchronous “mirror” that syncs a couple times a day. If my drive does fail I’d much rather have a backup from some time in the last 24 hours as opposed to nothing, especially since there aren’t a lot of changes happening on my eisy. Since you’re using ZFS this should be reasonably easy to accomplish using ZFS send/receive. At whatever scheduled time you take a snapshot of the NVME drive and send it to the eMMC, then delete the snapshot from the previous run. Could be a simple script you guys whip up or leverage something like zrepl or sanoid. Thanks for considering!
-
I’d love to be able to firmware update all my devices to ignore “all-on”. There are also a couple bugs with how KPLs turn off scene buttons when pressed that I have to work around with programs. I’d even pay money to buy an Insteon specific flasher and manually flash all my devices by hand. I suspect it’s possible but likely a customer service nightmare.