Skip to content

Instantly share code, notes, and snippets.

@caius
Created August 18, 2018 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caius/6d485d11deafca4ef1633874d8c82acd to your computer and use it in GitHub Desktop.
Save caius/6d485d11deafca4ef1633874d8c82acd to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
exit 1 # don't run as a script y'idiot
# Bootstraps an ubuntu server on HP microserver to run lxd/terraform
# Expects to be run as root by hand. Copy/paste yo!
apt update
apt dist-upgrade -y
/usr/bin/apt install -y linux-headers-$(uname -r)
/usr/bin/apt install -y zfs-dkms zfsutils-linux
/sbin/modprobe zfs
/bin/systemctl restart zfs-import-cache
/bin/systemctl restart zfs-import-scan
/bin/systemctl restart zfs-mount
/bin/systemctl restart zfs-share
# Create the zpool using your disks if you want to
# Not doing automatically so we don't wipe data out
# $ zpool create -o ashift=12 zones mirror /dev/sdX /dev/sdX mirror /dev/sdX /dev/sdX
# Bring up lxd
lxd init
# YAML preseed is:
# config:
# core.https_address: '[::]:8443'
# core.trust_password: harcourt
# cluster: null
# networks: []
# storage_pools:
# - config:
# source: zones
# description: ""
# name: default
# driver: zfs
# profiles:
# - config: {}
# description: ""
# devices:
# eth0:
# name: eth0
# nictype: macvlan
# parent: eno1
# type: nic
# root:
# path: /
# pool: default
# type: disk
# name: default
#
# Don't use a local network bridge, we'll shove everything on the internal trusted network
#
lxc profile show default # Check it shows it using the zpool
zpool list # check it has the lxd datasets added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment