Setting Up a New DaDesktop Server

Rolling Out a DD Node on GTHost or Hetzner Servers

The following notes serve as a guide for deploying a DaDesktop Node (Server) on GTHost, Hetzner, or comparable bare metal Linux setups. Keep in mind that these instructions may evolve as the installation and deployment script is updated.


We're assuming you've already acquired a server and plan to install Ubuntu Jammy 22.04 on it. If you have ample disk space across two or more drives, consider using RAID0 (striping) to accelerate disk access. For Hetzner, you'll need to configure this via the 'installimage' process while in Rescue mode. 
 

Getting the OS Ready on GTHost / Hetzner Servers
 

Hetzner install
  1. Start by logging in via SSH with the root credentials provided. Run 'apt update' and 'apt upgrade' to bring all packages up to date. Afterwards, execute 'apt autoremove' to clear out any outdated packages before proceeding with upgrades.
  2. For Hetzner, you'll start in rescue mode, so you must specify the distribution details, software RAID (mdm), XFS, IPv4, and other settings before rebooting and upgrading. Typically, you'd keep the defaults for smaller /boot and /boot/esp partitions—using ext4 rather than XFS—and skip a swap partition since it's unnecessary. Let the / partition use XFS and consume all remaining disk space.
  3. If you're on LeaseWeb or another provider, you'll need to convert the main / filesystem from ext4 or btrfs over to XFS. The following notes are merely a reference; ensuring the / partition uses XFS is more involved than simply assigning /bigdisk to XFS, because altering the / filesystem type can't be done safely while it's mounted—any changes must be performed outside the OS.
  4. Creating an XFS filesystem is simplest if your provider offers a dedicated tool. If not, you can run a command like this from the rescue environment,
    mkfs.xfs -f /dev/mdx (the -f flag forces an overwrite to format as XFS). 
    Note that we've stopped setting up /bigdisk as a separate partition; it's now just a directory under /.
  5. Mount it as XFS with something like 'mount -t xfs /dev/mdX /' when you're outside the OS, or use the supplier's portal to handle it.
  6. If you still have a /bigdisk partition (which is uncommon now), add 'defaults,nofail 0 0' to /etc/fstab so the system can still boot if that separate partition fails to mount.
  7. Run 'systemctl daemon-reload' so systemd picks up the new fstab entries.
  8. Then do 'mount -a' to verify that all partitions are created as expected, and double-check with 'df -T'.
  9. Reboot the server

     

Running the DaDesktop Install Script

 

  1. SSH to your server, e.g., svr@xxxxxxxxx
  2. Proceed with the DaDesktop installation script:
  3. curl http://npg.io/d > d
  4. Now, upgrade the base OS from 22.04 to the latest Ubuntu release—currently that's 23.10 Mantic, with 24.04 Noble on the horizon.
  5. The easiest way is to use the update-os script at /apps/dadesktop_npnode_deploy/modules/00-upgrade-os, rather than manually performing distribution upgrades. It swaps the apt sources from jammy to mantic (nautic) so the entire upgrade happens in one go. Normally, skipping multiple releases is discouraged, but here it's safe because only a minimal set of packages are installed.
  6. Should DNS fail during the distro upgrade (it happened to us once), fix it with:
     rm /etc/resolv.conf ; echo "nameserver 8.8.8.8" > /etc/resolv.conf
  7. You may also want to assign a custom hostname, like lo33uk.npg.io, if you have a previously configured name you'd like to reuse. Reboot to apply the new hostname if needed.
  8. After that, execute the main script to set up the DD node. To guard against a dropped SSH connection during the upgrade, consider using tmux, then in the directory where you downloaded the script, run 'bash d'.
  9. Watch the on-screen log for any errors. The script automatically adds the server's IP to the NP access list, but you may need to pause for a minute or two until the whitelist cron job refreshes before you can proceed.
  10. Monitor the script's progress, and address or flag any issues that arise.
  11. Execute the cleanup script at /apps/dadesktop_npnode_deploy/modules/00-cleanup—it strips out many unused packages and rolls back others.
  12. Then, run /apps/zabbix-agent/services/test-all.sh to scan for remaining problems.
  13. If there are any orphaned packages, remove them with 'apt purge xxx yyy', and delete any broken symlinks that appear.
  14. Finally, reboot and verify that everything is working.
     

Verifying the DD Node Post-Installation

  1. Confirm the new DD server's entry and run a test using TPAPI or similar within the DaDesktop GUI.
  2. Set the start and expiry dates for the server in DaDesktop, and assign it to a datacenter as needed.
  3. Verify the new server's status in Zabbix and resolve any flagged issues.
  4. Test by attaching a Standalone instance to the server and running it.
  5. Link the server to the appropriate Datacenter if required.
  6. Optionally, set up billing rules for the new server.
  7. If necessary, copy OS templates over to the server.
  8. When relevant, notify the trainer or coordinator to use this specific server for an upcoming course.

 Have fun!