Server/inber: Unterschied zwischen den Versionen
Eri! (Diskussion | Beiträge) K (→Device mapping) |
(Änderung 31646 von Winzlieb (Diskussion) rückgängig gemacht.) |
||
(4 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
{{Vorlage:anachronistisch}} | |||
{{beinhaltet Redundanz|Server/inbert|übertragen}} | |||
== Entscheidung == | == Entscheidung == | ||
Zeile 216: | Zeile 219: | ||
=== Vorbereitung === | === Vorbereitung === | ||
<syntaxhighlight lang="bash">cat <EOT >> /boot/loader.conf</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
vmm_load="YES" | vmm_load="YES" | ||
nmdm_load="YES" | nmdm_load="YES" | ||
Zeile 224: | Zeile 228: | ||
==== Hostnetz ==== | ==== Hostnetz ==== | ||
==== TAP ==== | ==== TAP ==== | ||
: <strong>WE DO NOT USE THIS</strong> | : <strong>WE DO NOT USE THIS</strong> | ||
<syntaxhighlight lang="bash"> | |||
ifconfig tap0 create | <syntaxhighlight lang="bash">ifconfig tap0 create</syntaxhighlight> | ||
sysctl net.link.tap.up_on_open=1 class=0x020000 card=0x22be103c chip=0x165714e4 rev=0x01 hdr=0x00 | |||
ifconfig bridge0 create | <syntaxhighlight lang="bash">sysctl net.link.tap.up_on_open=1 class=0x020000 card=0x22be103c chip=0x165714e4 rev=0x01 hdr=0x00</syntaxhighlight> | ||
ifconfig bridge0 addm bge0 addm tap0 | |||
ifconfig bridge0 up | <syntaxhighlight lang="bash">ifconfig bridge0 create</syntaxhighlight> | ||
</syntaxhighlight> | |||
<syntaxhighlight lang="bash">ifconfig bridge0 addm bge0 addm tap0</syntaxhighlight> | |||
<syntaxhighlight lang="bash">ifconfig bridge0 up</syntaxhighlight> | |||
===== PCI Passthru ===== | ===== PCI Passthru ===== | ||
HowTo: [[freebsd:bhyve/pci_passthru]] | |||
; HowTo: [[freebsd:bhyve/pci_passthru]] | |||
Mit <code>pciconf -v -l</code> findet man herraus welchen Slot der Netzwerk-Controller hat. | Mit <code>pciconf -v -l</code> findet man herraus welchen Slot der Netzwerk-Controller hat. | ||
<syntaxhighlight lang="bash">pciconf -v -l</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
bge0@pci0:2:0:0: | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Diesen überträgt man in die ''/boot/loader.conf'' | Diesen überträgt man in die ''/boot/loader.conf'' | ||
<syntaxhighlight lang="bash">cat <EOF >> /boot/loader.conf</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
pptdevs="2/0/0" | pptdevs="2/0/0" | ||
EOF | EOF | ||
</syntaxhighlight> | </syntaxhighlight> | ||
pptdev ist ein String und kann auch die anderen Netzwerk-Controller über die gleiche | pptdev ist ein String und kann auch die anderen Netzwerk-Controller über die gleiche Art markieren. | ||
<pre> | <pre> | ||
pptdev="2/0/0 2/0/1" | pptdev="2/0/0 2/0/1" | ||
Zeile 259: | Zeile 268: | ||
als Ergebis zeigt einem | als Ergebis zeigt einem | ||
<syntaxhighlight lang="bash">pciconf -v -l | grep -O ^.*pci0:2:0:0:</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
ppt0@pci0:2:0:0: | ppt0@pci0:2:0:0: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Zeile 267: | Zeile 276: | ||
=== Debian runterladen === | === Debian runterladen === | ||
<syntaxhighlight lang="bash"> | |||
wget -O /root/debian-testing-amd64-netinst.iso http://cdimage.debian.org/cdimage/weekly-builds/amd64/iso-cd/debian-testing-amd64-netinst.iso | <syntaxhighlight lang="bash">wget -O /root/debian-testing-amd64-netinst.iso http://cdimage.debian.org/cdimage/weekly-builds/amd64/iso-cd/debian-testing-amd64-netinst.iso</syntaxhighlight> | ||
</syntaxhighlight> | |||
=== Dataset anlegen === | === Dataset anlegen === | ||
<syntaxhighlight lang="bash"> | |||
zfs create -V32G -o volmode=dev zroot/inber | <syntaxhighlight lang="bash">zfs create -V32G -o volmode=dev zroot/inber</syntaxhighlight> | ||
</syntaxhighlight> | |||
=== Device mapping === | === Device mapping === | ||
<syntaxhighlight lang="bash">cat <EOF >> device.map</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
(hd0) /dev/zvol/zroot/inber | (hd0) /dev/zvol/zroot/inber | ||
(cd0) /root/debian-testing-amd64-netinst.iso | (cd0) /root/debian-testing-amd64-netinst.iso | ||
Zeile 285: | Zeile 293: | ||
=== Debian Installieren === | === Debian Installieren === | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash">grub-bhyve -m device.map -r cd0 -M 32678M inber</syntaxhighlight> | ||
bhyve -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 -s 3:0,virtio-blk,/dev/zvol/zroot/inber -s 4:0,ahci-cd,./debian-8.7.1-amd64-netinst.iso -l com1,stdio -c 8 -m 32768M inber | Installation wählen | ||
</syntaxhighlight> | |||
<syntaxhighlight lang="bash">bhyve -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 -s 3:0,virtio-blk,/dev/zvol/zroot/inber -s 4:0,ahci-cd,./debian-8.7.1-amd64-netinst.iso -l com1,stdio -c 8 -m 32768M inber</syntaxhighlight> | |||
Installation durchführen | |||
=== Reset von vmm === | === Reset von vmm === | ||
An diesem Punkt muss die VM gelöscht werden. Der Progress bleibt im Dataset erhalten. | An diesem Punkt muss die VM gelöscht werden. Der Progress bleibt im Dataset erhalten. | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash">bhyvectl --destroy --vm=inber</syntaxhighlight> | ||
bhyvectl --destroy --vm=inber | |||
</syntaxhighlight> | |||
=== Debian starten === | === Debian starten === | ||
==== Boot ==== | ==== Boot ==== | ||
<syntaxhighlight lang="bash"> | |||
grub-bhyve -m device.map -M 32678M -r hd0,msdos1 inber | <syntaxhighlight lang="bash">grub-bhyve -m device.map -M 32678M -r hd0,msdos1 inber</syntaxhighlight> | ||
</syntaxhighlight> | |||
==== VM starten ==== | ==== VM starten ==== | ||
===== mit tap ===== | ===== mit tap ===== | ||
<syntaxhighlight lang="bash"> | |||
bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 -s 3:0,virtio-blk,/dev/zvol/zroot/inber -l com1,/dev/nmdm0A -c 12 -m 32678M inber | <syntaxhighlight lang="bash">bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 -s 3:0,virtio-blk,/dev/zvol/zroot/inber -l com1,/dev/nmdm0A -c 12 -m 32678M inber</syntaxhighlight> | ||
</syntaxhighlight> | |||
===== mit ppt ===== | ===== mit ppt ===== | ||
muss die VM etwas anders gestartet werden. | muss die VM etwas anders gestartet werden. | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash">bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,passthru,2/0/0 -s 3:0,virtio-blk,/dev/zvol/zroot/inber -l com1,/dev/nmdm0A -c 12 -m 32678M inber</syntaxhighlight> | ||
bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,passthru,2/0/0 -s 3:0,virtio-blk,/dev/zvol/zroot/inber -l com1,/dev/nmdm0A -c 12 -m 32678M inber | |||
</syntaxhighlight> | |||
=== Login === | === Login === | ||
<syntaxhighlight lang="bash"> | |||
cu -l /dev/nmdm0B -s 9600 | <syntaxhighlight lang="bash">cu -l /dev/nmdm0B -s 9600</syntaxhighlight> | ||
</syntaxhighlight> | |||
[[Kategorie:Projekt]] | [[Kategorie:Projekt]] | ||
[[Kategorie:Server]] | [[Kategorie:Server]] | ||
[[Kategorie:Infrastruktur]] | [[Kategorie:Infrastruktur]] | ||
[[Kategorie:FreeBSD]] |
Aktuelle Version vom 23. September 2020, 04:31 Uhr
Achtung! Anachronistisch! |
---|
Dieser Artikel enthält keine relevanten Informationen zu den aktuellen Verhältnissen. Ferner handelt es sich um einen archivierten Artikel. |
obsolete
Hinweis! Redundanz! |
---|
Es besteht Redundanz mit dem Artikel Server/inbert.
Inhalte von diesem Artikel sollten in den Artikel Server/inbert übertragen werden. |
Entscheidung
Grundlage | Frage | Antwort | Gründe |
---|---|---|---|
faktisch | Welches Betriebssystem wird installiert? | FreeBSD | |
offen | Wie ist die Bezeichnung (Ruf- und Hostname)? | ? | |
Bezeichnung
Es gibt noch keine "finale" Bezeichnung. Innerhalb der ersten 10 Tage war #inber die wohl gängigste Bezeichnung vom Projekt.
LOIC
- in Anlehnung an wikipedia:de:Low Orbit Ion Cannon
inber
- in Anlehnung an das Leben IN-Berlin
Zweck
- Ersatz von wetu
- Betreiben von eigener Hardware (Server) des C3D2 in ein einer wikipedia:de:Colocation
Einrichtung
Einrichtung vom Massenspeicher
nachträgliche Verschlüsslung vom Massenspeicher fürs Puffern
- cache encryption
- aka Verschlüsslung
Bei der Installation wurde die Massenspeicher fürs Puffern (caching) dem Pool zugeordnet. Der Massenspeicher (für ZFS Intent Log (ZIL) und L2ARC (Cache)) wurde dabei nicht verschlüsselt. Das ist mittlerweile umgesetzt mehr.
Plan
- #caches ausbinden
- #geli auf den partitionen einrichten
- #crypted partitions wieder einbinden
- #profit!
Implementierung
caches ausbinden
zpool status zroot
pool: zroot
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
da0p5.eli ONLINE 0 0 0
da1p5.eli ONLINE 0 0 0
da2p5.eli ONLINE 0 0 0
da3p5.eli ONLINE 0 0 0
logs
mirror-1 ONLINE 0 0 0
gpt/log0 ONLINE 0 0 0
gpt/log1 ONLINE 0 0 0
cache
gpt/cache0 ONLINE 0 0 0
gpt/cache1 ONLINE 0 0 0
errors: No known data errors
zpool remove zroot gpt/cache0
zpool remove zroot gpt/cache1
geli auf den partitionen einrichten
geli init -b -s 4096 /dev/da4p2
Enter new passphrase:
Reenter new passphrase:
Metadata backup can be found in /var/backups/da4p2.eli and
can be restored with the following command:
geli restore /var/backups/da4p2.eli /dev/da4p2
geli init -b -s 4096 /dev/da5p2
crypted partitions wieder einbinden
geli attach /dev/da4p2
Enter passphrase:
geli attach /dev/da5p2
Enter passphrase:
zpool status zroot
pool: zroot
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
da0p5.eli ONLINE 0 0 0
da1p5.eli ONLINE 0 0 0
da2p5.eli ONLINE 0 0 0
da3p5.eli ONLINE 0 0 0
logs
mirror-1 ONLINE 0 0 0
gpt/log0 ONLINE 0 0 0
gpt/log1 ONLINE 0 0 0
errors: No known data errors
zpool add zroot cache /dev/da4p2.eli
zpool add zroot cache /dev/da5p2.eli
profit!
zpool status zroot
pool: zroot
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
da0p5.eli ONLINE 0 0 0
da1p5.eli ONLINE 0 0 0
da2p5.eli ONLINE 0 0 0
da3p5.eli ONLINE 0 0 0
logs
mirror-1 ONLINE 0 0 0
gpt/log0 ONLINE 0 0 0
gpt/log1 ONLINE 0 0 0
cache
da4p2.eli ONLINE 0 0 0
da5p2.eli ONLINE 0 0 0
errors: No known data errors
zil
zpool remove zroot mirror-1
geli init -b -s 4096 /dev/da4p1
[... passwordfoo]
geli init -b -s 4096 /dev/da5p1
[... passwordfoo]
geli attach /dev/da4p1
[... password bla]
geli attach /dev/da5p1
[... passwordfoo]
zpool add zroot log mirror da4p1.eli da5p1.eli
zpool status zroot
pool: zroot
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
da0p5.eli ONLINE 0 0 0
da1p5.eli ONLINE 0 0 0
da2p5.eli ONLINE 0 0 0
da3p5.eli ONLINE 0 0 0
logs
mirror-1 ONLINE 0 0 0
da4p1.eli ONLINE 0 0 0
da5p1.eli ONLINE 0 0 0
cache
da4p2.eli ONLINE 0 0 0
da5p2.eli ONLINE 0 0 0
errors: No known data errors
Debian mit Bhyve
Grob gesagt man braucht sich lediglich an die Anleitung im FreeBSD-Handbuch halten.
Die folgenden Abschnitte handeln von Debian virtualisiert von byhve angepasst für unseren Anwendungsfall.
Wir sollten vermutlich noch mal über die Bezeichnungen reden.
Vorbereitung
cat <EOT >> /boot/loader.conf
vmm_load="YES"
nmdm_load="YES"
EOT
Hostnetz
TAP
- WE DO NOT USE THIS
ifconfig tap0 create
sysctl net.link.tap.up_on_open=1 class=0x020000 card=0x22be103c chip=0x165714e4 rev=0x01 hdr=0x00
ifconfig bridge0 create
ifconfig bridge0 addm bge0 addm tap0
ifconfig bridge0 up
PCI Passthru
Mit pciconf -v -l
findet man herraus welchen Slot der Netzwerk-Controller hat.
pciconf -v -l
bge0@pci0:2:0:0:
Diesen überträgt man in die /boot/loader.conf
cat <EOF >> /boot/loader.conf
pptdevs="2/0/0"
EOF
pptdev ist ein String und kann auch die anderen Netzwerk-Controller über die gleiche Art markieren.
pptdev="2/0/0 2/0/1"
als Ergebis zeigt einem
pciconf -v -l | grep -O ^.*pci0:2:0:0:
ppt0@pci0:2:0:0:
Weiter geht damit dann in die VM.
Debian runterladen
wget -O /root/debian-testing-amd64-netinst.iso http://cdimage.debian.org/cdimage/weekly-builds/amd64/iso-cd/debian-testing-amd64-netinst.iso
Dataset anlegen
zfs create -V32G -o volmode=dev zroot/inber
Device mapping
cat <EOF >> device.map
(hd0) /dev/zvol/zroot/inber
(cd0) /root/debian-testing-amd64-netinst.iso
EOF
Debian Installieren
grub-bhyve -m device.map -r cd0 -M 32678M inber
Installation wählen
bhyve -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 -s 3:0,virtio-blk,/dev/zvol/zroot/inber -s 4:0,ahci-cd,./debian-8.7.1-amd64-netinst.iso -l com1,stdio -c 8 -m 32768M inber
Installation durchführen
Reset von vmm
An diesem Punkt muss die VM gelöscht werden. Der Progress bleibt im Dataset erhalten.
bhyvectl --destroy --vm=inber
Debian starten
Boot
grub-bhyve -m device.map -M 32678M -r hd0,msdos1 inber
VM starten
mit tap
bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 -s 3:0,virtio-blk,/dev/zvol/zroot/inber -l com1,/dev/nmdm0A -c 12 -m 32678M inber
mit ppt
muss die VM etwas anders gestartet werden.
bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,passthru,2/0/0 -s 3:0,virtio-blk,/dev/zvol/zroot/inber -l com1,/dev/nmdm0A -c 12 -m 32678M inber
Login
cu -l /dev/nmdm0B -s 9600