Difference between revisions of "Lxd prep"
Jump to navigation
Jump to search
(Created page with "``` sudo apt update && sudo apt upgrade sudo apt install zfsutils-linux sudo zpool create -f tank mirror nvme0n1 nvme1n1 nvme2n1 nvme3n1 lxd init ``` /etc/netplan/00-custom.y...") |
|||
| (8 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| + | We set logical block addressing to 4k instead of 512b for improved performance. This is best for VMs. 512 is still used for OS boot compatibility issues. | ||
| + | |||
``` | ``` | ||
sudo apt update && sudo apt upgrade | sudo apt update && sudo apt upgrade | ||
| − | sudo apt install zfsutils-linux | + | sudo apt install zfsutils-linux ipmitool smartmontools nvme-cli |
| + | nvme list | ||
| + | for i in {0..3}; do | ||
| + | sudo nvme id-ns -H /dev/nvme${i}n1 | grep "LBA Format" | ||
| + | sudo nvme format --lbaf=1 /dev/nvme${i}n1 -f | ||
| + | sudo nvme id-ns -H /dev/nvme${i}n1 | grep "LBA Format" | ||
| + | done | ||
| + | |||
sudo zpool create -f tank mirror nvme0n1 nvme1n1 nvme2n1 nvme3n1 | sudo zpool create -f tank mirror nvme0n1 nvme1n1 nvme2n1 nvme3n1 | ||
lxd init | lxd init | ||
| Line 50: | Line 59: | ||
eno4: {} | eno4: {} | ||
version: 2 | version: 2 | ||
| + | ``` | ||
| + | |||
| + | lxd init --dump | ||
| + | ``` | ||
| + | config: | ||
| + | core.https_address: '[::]:8443' | ||
| + | core.trust_password: true | ||
| + | networks: [] | ||
| + | storage_pools: | ||
| + | - config: | ||
| + | source: tank | ||
| + | volatile.initial_source: tank | ||
| + | zfs.pool_name: tank | ||
| + | description: "" | ||
| + | name: default | ||
| + | driver: zfs | ||
| + | profiles: | ||
| + | - config: {} | ||
| + | description: Default LXD profile | ||
| + | devices: | ||
| + | eth0: | ||
| + | name: eth0 | ||
| + | nictype: bridged | ||
| + | parent: vlan3 | ||
| + | type: nic | ||
| + | root: | ||
| + | path: / | ||
| + | pool: default | ||
| + | type: disk | ||
| + | name: default | ||
| + | projects: | ||
| + | - config: | ||
| + | features.images: "true" | ||
| + | features.networks: "true" | ||
| + | features.profiles: "true" | ||
| + | features.storage.volumes: "true" | ||
| + | description: Default LXD project | ||
| + | name: default | ||
| + | ``` | ||
| + | |||
| + | |||
| + | ``` | ||
| + | lxc config set core.https_address "10.x.4.11:8443" | ||
| + | lxc cluster enable lxd1 | ||
| + | lxc cluster add | ||
| + | |||
| + | |||
| + | lxd init | ||
| + | lxc init ubuntu:22.04 microceph1 --vm -c limits.cpu=24 -c limits.memory=64GB | ||
| + | lxc config device override microceph4 root size=64GB | ||
| + | ``` | ||
| + | |||
| + | |||
| + | ``` | ||
| + | sudo smartctl -a /dev/nvme1n1p1 | ||
``` | ``` | ||
Latest revision as of 14:50, 26 November 2023
We set logical block addressing to 4k instead of 512b for improved performance. This is best for VMs. 512 is still used for OS boot compatibility issues.
sudo apt update && sudo apt upgrade
sudo apt install zfsutils-linux ipmitool smartmontools nvme-cli
nvme list
for i in {0..3}; do
sudo nvme id-ns -H /dev/nvme${i}n1 | grep "LBA Format"
sudo nvme format --lbaf=1 /dev/nvme${i}n1 -f
sudo nvme id-ns -H /dev/nvme${i}n1 | grep "LBA Format"
done
sudo zpool create -f tank mirror nvme0n1 nvme1n1 nvme2n1 nvme3n1
lxd init
/etc/netplan/00-custom.yaml
# This is the network config written by 'subiquity'
network:
bonds:
bond0:
dhcp4: no
dhcp6: no
interfaces:
- eno1
- eno2
- eno3
- eno4
parameters:
lacp-rate: slow
mode: 802.3ad
transmit-hash-policy: layer2+3
bridges:
vlan3:
interfaces: [ bond0.3 ]
vlans:
bond0.3:
link: bond0
id: 3
accept-ra: no
bond0.2:
link: bond0
id: 2
accept-ra: no
addresses:
- 10.x.4.12/22
routes:
- to: default
via: 10.x.4.1
metric: 100
nameservers:
addresses: [10.x.4.1]
search: []
ethernets:
eno1: {}
eno2: {}
eno3: {}
eno4: {}
version: 2
lxd init --dump
config:
core.https_address: '[::]:8443'
core.trust_password: true
networks: []
storage_pools:
- config:
source: tank
volatile.initial_source: tank
zfs.pool_name: tank
description: ""
name: default
driver: zfs
profiles:
- config: {}
description: Default LXD profile
devices:
eth0:
name: eth0
nictype: bridged
parent: vlan3
type: nic
root:
path: /
pool: default
type: disk
name: default
projects:
- config:
features.images: "true"
features.networks: "true"
features.profiles: "true"
features.storage.volumes: "true"
description: Default LXD project
name: default
lxc config set core.https_address "10.x.4.11:8443" lxc cluster enable lxd1 lxc cluster add lxd init lxc init ubuntu:22.04 microceph1 --vm -c limits.cpu=24 -c limits.memory=64GB lxc config device override microceph4 root size=64GB
sudo smartctl -a /dev/nvme1n1p1