Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Usage

  • Update the pillar if migrating from LXD to Incus:

    • Rename top level key from lxd to incus
    • Rename pillar file and change top.sls if needed
    • Remove password key - Incus doesn't support password authentication
  • Add needed pillar to the target server, see pillar.example.

  • ... state.apply incus.install - to install or update incus without initializing it

  • Sometimes downgrade of LXD is needed, for example when lxd-to-incus (Error: LXD version is newer than maximum version "5.21.99")

    • snap stop --disable lxd
    • snap refresh lxd --channel=5.21/stable
    • snap start --enable lxd
  • Make migration from LXD manually if needed right after after install and before incus init: https://linuxcontainers.org/incus/docs/main/howto/server_migrate_lxd/

    • Stop containers and VMs manually, sometimes there are issues on stopping them
    • lxc config unset core.trust_password
    • lxd-to-incus, if not found: wget https://dl.stgraber.org/lxd-to-incus; chmod +x lxd-to-incus
    • incus ls to check if all containers and VMs are migrated
    • Remove snapd optionally:
      • apt autoremove --purge snapd
      • rm -rf ~/snap /var/cache/snapd/
      • apt-mark hold snapd
  • ... state.apply incus.settings - to initialize Incus and apply settings, update images and profiles

  • Add storage manually and make it default:

    • incus storage create vg_mdX lvm source=vg_mdX lvm.use_thinpool=false - thinpool is not recommended for prod, but can be used for dev.
    • incus profile device remove default root
    • incus storage delete default
    • incus profile device add default root disk path=/ pool=vg_mdX type=disk size=10GB - you can set root disk size only after container init, so we need to set default root size in default profile withith created storage pool. This volume will be resized after pillar apply and it should contain enough space to contain base OS image.
  • Apply only specific instances

... state.apply incus.instances pillar='{incus: {only: {"instance1.example.com"}}}'
  • The same with allowance stop and start for changes to apply
... state.apply incus.instances pillar='{incus: {only: {"instance1.example.com"}, allow_stop_start: True}}'

Notes on Windows

Notes on VMs and Ubuntu

In case an Instance is Virtual-Machine you need to grow internal root partition size:

incus stop ...
lvchange --setactivationskip n /dev/vg_md2/virtual-machines_...block
lvchange --activate y /dev/vg_md2/virtual-machines_...block
parted /dev/vg_md2/virtual-machines_...block
  resizepart 2
  100%
  q
kpartx -a /dev/vg_md2/virtual-machines_...block
e2fsck -f  /dev/mapper/vg_md2-virtual--machines_...block2
resize2fs /dev/mapper/vg_md2-virtual--machines_...block2
kpartx -d /dev/vg_md2/virtual-machines_test.block
incus start ...