CoreOS installeren op Proxmox

Download de ISO, maak een VM aan, en start op.

Genereer een wachtwoord-hash en sla op in cloud-config.yml, want dat is straks makkelijker met editten:

$ echo 'supersecret' | openssl passwd -stdin -1 > cloud-config.yml

Pas het bestand aan zodat het er ongeveer zo uit ziet:

cloud-config
 hostname: coreos
 coreos:  
   units:
     - name: static.network
       runtime: true
       content: |
         [Match]
         Name=ens18

         [Network]
         Address=192.168.20.11/24
         Gateway=192.168.20.1
         DNS=8.8.8.8
 users:
   - name: core
     passwd: $1$9dAhmWIT$v4wuO7t3r1tjg8gDZtkyi1
     groups:
       - sudo
       - docker 

Pas deze configuratie toe, want je hebt netwerk nodig:

$ sudo coreos-cloudinit -from-file cloud-config.yml

Installeer CoreOS op de virtuele hard-disk:

$ sudo coreos-install -d /dev/vda -c cloud-config.yml

Disk vervangen ZFS RAID-Z2

Oh jee, er is een disk stuk gegaan op mijn Proxmox server:

root@host2:~# zpool status
pool: rpool
state: DEGRADED
status: One or more devices could not be used because the label is missing or invalid. Sufficient replicas exist for the pool to continue functioning in a degraded state.
action: Replace the device using 'zpool replace'.
see: http://zfsonlinux.org/msg/ZFS-8000-4J
scan: resilvered 8.73G in 0h8m with 0 errors on Fri Apr 5 15:26:14 2019
config:
NAME STATE READ WRITE CKSUM
rpool DEGRADED 0 0 0
raidz2-0 DEGRADED 0 0 0
sda3 UNAVAIL 0 0 0
sdb3 ONLINE 0 0 0
sdc3 ONLINE 0 0 0
sdd3 ONLINE 0 0 0
errors: No known data errors

Disk vervangen door een ‘nieuwe’. Partitietabel kopiëren van een andere disk:

root@host2:~# sgdisk --replicate=/dev/sda /dev/sdb
The operation has completed successfully.
root@host2:~# fdisk -l /dev/sda
Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 728ECA41-74BD-442B-A35A-1D71A5CD3F8D
Device Start End Sectors Size Type
/dev/sda1 34 2047 2014 1007K BIOS boot
/dev/sda2 2048 1050623 1048576 512M EFI System
/dev/sda3 1050624 3907029134 3905978511 1.8T Solaris /usr & Apple ZFS

ZFS vertellen dat ze partitie 3 van de nieuwe disk mag gaan gebruiken:

root@host2:~# zpool replace rpool /dev/sda3
Make sure to wait until resilver is done before rebooting.

Af en toe eens kijken hoe de vlag er bij hangt:

root@host2:~# zpool status
pool: rpool
state: DEGRADED
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scan: resilver in progress since Mon Apr 8 07:50:19 2019
9.52G scanned out of 47.7G at 99.4M/s, 0h6m to go
1.67G resilvered, 19.93% done
config:
NAME STATE READ WRITE CKSUM
rpool DEGRADED 0 0 0
raidz2-0 DEGRADED 0 0 0
replacing-0 DEGRADED 0 0 0
old UNAVAIL 0 0 0
sda3 ONLINE 0 0 0 (resilvering)
sdb3 ONLINE 0 0 0
sdc3 ONLINE 0 0 0
sdd3 ONLINE 0 0 0
errors: No known data errors