Actualización de Ubuntu y migración de LXD a Incus
servidor
Published: 2024-10-06

Introducción

Notas sobre la migración de Ubuntu 22.04 a 24.04 y la migración de LXD a Incus.

Actualización de Ubuntu 22.04 a 24.04

  • Primero, ejecutar la actualización

    # sudo apt update && sudo apt upgrade -y
    
  • Actualización a 24.04

    # sudo do-release-upgrade
    
    • Si no se encuentra do-release-upgrade, instale con el siguiente comando
      # sudo apt install ubuntu-release-upgrader-core
      

Migración a Incus

  • Instalación de Incus

    # sudo apt install incus incus-tools
    
  • Verificar que incus y lxd se pueden ejecutar

    # incus info
    # lxc info
    
  • Migración de LXD a Incus

    # sudo lxd-to-incus
    => Looking for source server
    ==> Detected: snap package
    => Looking for target server
    ==> Detected: systemd
    => Connecting to source server
    => Connecting to the target server
    => Checking server versions
    ==> Source version: 5.21.2
    ==> Target version: 6.0.0
    => Validating version compatibility
    => Checking that the source server isn't empty
    => Checking that the target server is empty
    => Validating source server configuration
    
    The migration is now ready to proceed.
    At this point, the source server and all its instances will be stopped.
    Instances will come back online once the migration is complete.
    Proceed with the migration? [default=no]: yes
    => Stopping the source server
    => Stopping the target server
    => Wiping the target server
    => Migrating the data
    => Migrating database
    => Writing database patch
    => Cleaning up target paths
    => Starting the target server
    => Checking the target server
    Uninstall the LXD package? [default=no]: yes
    => Uninstalling the source server
    
    • Si la versión de lxd es demasiado nueva, la migración fallará
      # lxd-to-incus
      => Looking for source server
      ==> Detected: snap package
      => Looking for target server
      ==> Detected: systemd
      => Connecting to source server
      => Connecting to the target server
      => Checking server versions
      ==> Source version: 6.1
      ==> Target version: 6.0.0
      => Validating version compatibility
      Error: LXD version is newer than maximum version "5.21.99"
      
      • En este caso, reduzca la versión de lxd (se recomienda hacer una copia de seguridad)
        # sudo snap refresh lxd --channel=5.21/stable
        
    • También puede fallar la migración si hay configuraciones no soportadas
      # lxd-to-incus
      => Looking for source server
      ==> Detected: snap package
      => Looking for target server
      ==> Detected: systemd
      => Connecting to source server
      
      The source server (LXD) has the following configuration keys that are incompatible with Incus:
       - core.trust_password
      
      The present migration tool cannot properly connect to the LXD server with those configuration keys present.
      Please unset those configuration keys through the lxc config unset command and retry lxd-to-incus.
      
      Error: Unable to interact with the source server
      
      • En este caso, cambie la configuración de lxd
        # lxc config unset core.trust_password 
        
  • Verificación después de la migración

    # incus list
    
  • Configurar alias

    # cat << _EOF_ >> ~/.bashrc
    alias lxc='incus'
    alias lxd='incus'
    _EOF_
    
    • Si no se hace esto, puede que por costumbre se ejecute el comando lxc o lxd, lo que resultará en una reinstalación automática a través de snap.

Conclusión

  • Se pudo actualizar de Ubuntu 22.04 a 24.04 usando do-release-upgrade.
  • La migración de LXD a Incus se realizó fácilmente con lxd-to-incus.
  • A partir de 24.04, se puede instalar incus con apt.