Installing a New DaDesktop Server

Deploying a DD Node on GTHost / Hetzner Servers

The following notes will assist you in setting up a DaDesktop Node (Server) on bare metal Linux servers like those from GTHost, Hetzner, or similar providers. Keep in mind, these instructions may evolve as the installation and deployment script is updated.


We assume you've already purchased a server and will install Ubuntu Jammy 22.04 on it. If you have ample disk space with two or more disks, you can leverage RAID0 (striping) to enhance disk access speeds. When using Hetzner, configure this via the 'installimage' process while in Rescue mode. 
 

Preparation, install of OS if using GTHost / Hetzner Server
 

Hetzner install
  1. Start by establishing an SSH connection using the provided root credentials. Run 'apt update' and 'apt upgrade' to bring all packages up to date, then execute 'apt autoremove' to clear out any outdated packages before proceeding further.
  2. If you're on Hetzner, the server will boot into rescue mode. At that point, you'll need to define the distribution requirements, software RAID settings (including mdm, xfs, IPv4), and other parameters prior to rebooting and upgrading. Typically, you can accept the defaults for the small /boot and /boot/esp partitions—format them with ext4 instead of xfs, and skip the swap partition as it's unnecessary. Set the root (/) partition to use xfs and allocate the remaining disk space to it.
  3. When using LeaseWeb or another provider, you'll need to switch the main / filesystem from ext4 or btrfs to xfs. The notes below offer a rough guide, but converting the / partition to xfs is trickier than simply designating /bigdisk as xfs because any filesystem modifications must be performed outside the running OS; altering the filesystem type of the root partition while it's mounted isn't straightforward or safe.
  4. To create an xfs filesystem, rely on the provider's tool if available—it's much simpler. Otherwise, from a rescue system you can use a command like:
    mkfs.xfs -f /dev/mdx (this formats / with xfs, with -f forcing the overwrite). 
    Note that we no longer set up /bigdisk as a separate partition; it's now just a directory under /.
  5. Mount the xfs partition outside the OS, for example with 'mount -t xfs /dev/mdX /', or use the system portal to achieve this.
  6. If you do have a /bigdisk partition (which is now uncommon), add 'defaults,nofail 0 0' in /etc/fstab to ensure the system can still boot even if that partition fails to mount.
  7. Run 'systemctl daemon-reload' to have systemd reread /etc/fstab.
  8. Execute 'mount -a' to verify that all partitions are created as expected, and double-check with 'df -T'.
  9. Reboot.

     

Running the DaDesktop Installation Script

 

  1. SSH into the server, e.g., svr@xxxxxxxxx
  2. Begin the installation using the DaDesktop install script. Specifically,
  3. Download the script using curl: http://npg.io/d > d
  4. At this stage, the base operating system should be upgraded from Ubuntu 22.04 to the latest version—currently 23.10 (Mantic) and soon to be 24.04 (Noble).
  5. The easiest way to do this is by running the update-os script found at /apps/dadesktop_npnode_deploy/modules/00-upgrade-os. This script handles the upgrade far more smoothly than performing dist-upgrades manually: it replaces the apt sources from jammy to mantic (nautic) so that the entire upgrade can be done in a single pass. Although jumping two releases at once is generally not recommended, the minimal set of installed packages makes it quite safe.
  6. If DNS stops working during the distro upgrade—we saw this once—you can fix it by removing the old resolv.conf and setting a public nameserver:
    rm /etc/resolv.conf ; echo "nameserver 8.8.8.8" > /etc/resolv.conf
  7. Optionally, assign a custom hostname (e.g., lo33uk.npg.io) if you'd like the DD node to have a specific name, maybe one you've used before. Reboot afterwards to apply the hostname if needed.
  8. Now run the main script to install the DD Node. To guard against a broken SSH connection during the upgrade, consider using tmux. From the directory where you downloaded the script, execute 'bash d'.
  9. Monitor the on-screen logs for any errors. The script will automatically add the server's IP to the NP access list, but it might take a couple of minutes for the whitelist cron to update before you can proceed.
  10. Keep an eye on the script's progress, and address or report any issues that pop up.
  11. Execute the cleanup script located at /apps/dadesktop_npnode_deploy/modules/00-cleanup. It removes many unused packages and downgrades others.
  12. Run /apps/zabbix-agent/services/test-all.sh to check for any remaining problems.
  13. For any unmaintained packages, use 'apt purge xxx, yyy' to remove them, and delete any broken links that are reported.
  14. After a reboot, test the operation.
     

Testing the DD Node After Installation

  1. In the DaDesktop GUI, verify the new DD server entry and test it using tools like test TPAPI.
  2. Set the server's start and expiry dates in DaDesktop, and assign it to a datacenter if needed.
  3. Check the server's status in Zabbix; fix any anomalies that appear.
  4. Add a Standalone to the server and run it to confirm everything works.
  5. If required, place the server within a datacenter.
  6. Optionally, set up billing rules for the new server.
  7. Copy operating system templates to the server as needed.
  8. If a specific course will use this server, notify the trainer or coordinator to make use of it.

 Enjoy!