vgijssel / setup

Workstation and server setup
MIT License
8 stars 0 forks source link

feat: Setup HAOS using Kubevirt #637

Closed mvgijssel closed 8 months ago

mvgijssel commented 9 months ago

ref #632

TODO

mvgijssel commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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

mvgijssel commented 9 months ago

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

mvgijssel commented 9 months ago

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

mvgijssel commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago
mvgijssel commented 9 months ago

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

IMG_8456

mvgijssel commented 8 months ago

Ideas to improve thread performance:

Articles