Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Setup HAOS using Kubevirt #637

Merged
merged 56 commits into from
Jan 14, 2024
Merged

feat: Setup HAOS using Kubevirt #637

merged 56 commits into from
Jan 14, 2024

Conversation

mvgijssel
Copy link
Member

@mvgijssel mvgijssel commented Dec 27, 2023

ref #632

TODO

  • Install multus
  • Add haos vm to the lan
  • Figure out a way to store haos disk image on zfs
  • Setup haos
  • Install matter server
  • Add static ip to haos vm
  • Install esphome
  • Connect Skyconnect to server
  • Fix ZFS version suddenly being lower resulting in error. Might be related to how we update nixos (from macOS). See Pinning nixpkgs in configuration.nix? NixOS/nixpkgs#62832:
   pool: new_data
     id: 2724641472561338930
  state: UNAVAIL
status: The pool uses the following feature(s) not supported on this system:
	com.klarasystems:vdev_zaps_v2
action: The pool cannot be imported. Access the pool on a system that supports
	the required feature(s), or recreate the pool from backup.

@mvgijssel
Copy link
Member Author

mvgijssel commented Dec 27, 2023

Create zfs dataset for the k3s kubevirt storage

systemctl stop k3s
zfs create new_data/apps/k3s_storage
cat /var/lib/rancher/k3s/server/manifests/local-storage.yaml # find the storage location
zfs set mountpoint=/var/lib/rancher/k3s/storage new_data/apps/k3s_storage
systemctl start k3s

@mvgijssel mvgijssel changed the title add prod list user Setup HAOS using Kubevirt Dec 30, 2023
@mvgijssel
Copy link
Member Author

mvgijssel commented Dec 30, 2023

The vm boots, but doesn't get an IP and using virtctl console testvm does not result in anything. Maybe try using VNC? Or try enable more debug logs for kubevirt. Try using strace to debug!

@mvgijssel
Copy link
Member Author

Good article for debugging https://groups.google.com/g/kubevirt-dev/c/Ezd3ZtxcxLI. Maybe the qcow is for uefi?

@mvgijssel
Copy link
Member Author

Find the Skyconnect USB dongle running usb-devices inside the hypervisor.

@mvgijssel
Copy link
Member Author

Pin nixpkgs version in nixos by using a flake https://gist.github.com/m1cr0man/8cae16037d6e779befa898bfefd36627

@mvgijssel
Copy link
Member Author

mvgijssel commented Jan 2, 2024

Upgrade to version 1.1.1 (pre-release according to https://github.com/kubevirt/kubevirt/releases)

export VERSION=v1.1.1
kubectl apply -f https://github.com/kubevirt/kubevirt/releases/download/${VERSION}/kubevirt-operator.yaml
kubectl apply -f https://github.com/kubevirt/kubevirt/releases/download/${VERSION}/kubevirt-cr.yaml
kubectl get all -n kubevirt # poll until ready
kubectl apply -f kubevirt_cr.yml

@mvgijssel
Copy link
Member Author

Using this script from https://www.reddit.com/r/homeassistant/comments/11pkmpu/obtain_apple_thread_network_credentials/ to create TLV to make the Apple border router the default network.

import python_otbr_api
from python_otbr_api import PENDING_DATASET_DELAY_TIMER, tlv_parser
from python_otbr_api.pskc import compute_pskc
from python_otbr_api.tlv_parser import MeshcopTLVType, MeshcopTLVItem

# Apple
CHANNEL = <Channel Number>
PANID = "<YourPanID>"
EXTPANID = "<YourExtPanID>"
NETWORK_KEY = "<Your Network Key>"
TIMESTAMP = b'\x00\x00\x00\x00\x00\x03\x00\x00'

channel = MeshcopTLVItem(tag=0, data=CHANNEL.to_bytes(length=3, byteorder='big'))
pan_id= MeshcopTLVItem(tag=1, data=bytes.fromhex(PANID))
ext_pan_id = MeshcopTLVItem(tag=2, data=bytes.fromhex(EXTPANID))
network_key = MeshcopTLVItem(tag=5, data=bytes.fromhex(NETWORK_KEY))
timestamp = MeshcopTLVItem(tag=14, data=TIMESTAMP)

tlv_new = {0: channel, 1: pan_id, 2:ext_pan_id, 4: network_key, 14: timestamp}
tlv  = tlv_parser.encode_tlv(tlv_new)
print(tlv)

Afterwards merge the Apple and Skyconnect border routers and wait for 5 minutes.

@mvgijssel
Copy link
Member Author

mvgijssel commented Jan 9, 2024

To improve Thread + Matter performance and potentially fix Apple Home Hub not responding updated the following network settings in Unify:

Updated Unify WAN settings to enable IPv6 for WAN with delegation size from Ziggo (https://community.ziggo.nl/t5/Archief/Eindelijk-IPv6-in-Bridge-modus/td-p/869035)

image

Updated LAN settings (https://community.ziggo.nl/t5/Internet/IPV6-Ziggo-Zakelijk-icm-Unifi-USG/td-p/894411)

image

Updated WiFi settings to include multicast enhancement:

image

@mvgijssel
Copy link
Member Author

mvgijssel commented Jan 9, 2024

  • Setup static ips for the Apple TVs
  • Restart Apple TV Woonkamer
  • Remove from homekit and add back in
  • Sign back into iCloud (apparently this was necessary when opening the TV+ app?)

@mvgijssel
Copy link
Member Author

mvgijssel commented Jan 10, 2024

Waiting a couple of hours has recovered the home hub and associated sensors.

IMG_8456

@mvgijssel
Copy link
Member Author

mvgijssel commented Jan 12, 2024

Ideas to improve thread performance:

  • Enabled IGMP snooping done, didn't help
  • Disable home hub slaapkamer tv done, didn't help
  • Disable mDNS in Unifi and disable multicast enhancements done, didn't help
  • Checking the Unifi logs it seems that the hypervisor is disconnecting really often, maybe fix this first?
    • started a screen session on provisioner, let's see what that does
  • disable mDNS esphome devices
  • Try using a separate pci / usb network dongle for haos
  • Turn off haos and see responsiveness thread network
  • Turn of Apple tv and see responsiveness thread network
  • Use Skyconnect in USB only mode
  • Disable skyconnect in home assistant

Articles

@mvgijssel mvgijssel enabled auto-merge (squash) January 14, 2024 18:05
@mvgijssel mvgijssel merged commit 566ae15 into master Jan 14, 2024
3 checks passed
@mvgijssel mvgijssel deleted the mg/632/setup-haos branch January 14, 2024 18:14
@mvgijssel mvgijssel changed the title Setup HAOS using Kubevirt feat: Setup HAOS using Kubevirt Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant