✉️contact@dadesktop.ca 📞+1 204 979 4447

Installing a New DaDesktop Server

Deploying a DD Node on a GTHost or Hetzner Server

The following notes are meant to assist with deploying a DaDesktop Node (Server) on a GTHost, Hetzner, or any similar bare metal Linux server. Keep in mind that these notes may change as the installation and deployment script evolves.


This assumes that a server has already been purchased and will be set up with Ubuntu Jammy 22.04. Note that using RAID0 (i.e., striping) can speed up disk access if you have ample space across two or more disks. This configuration needs to be defined in Hetzner through the 'installimage' process while in Rescue mode. 
 

Preparing and installing the OS on a GTHost or Hetzner Server
 

Hetzner install
  1. First, SSH into the server using the supplied root credentials, then run 'apt update' and 'apt upgrade' to bring all packages up to date. Afterwards, run 'apt autoremove' to remove any obsolete packages before the upgrade.
  2. If using Hetzner, you'll be booted into rescue mode, so you must define the distro requirements, software RAID (mdm, xfs, IPv4, etc.) before rebooting and upgrading. Generally, accept the defaults for the small /boot and /boot/esp partitions, using ext4 rather than xfs, and skip the swap partition since it's not needed. Allocate the remaining disk space to the / partition with xfs.
  3. If using LeaseWeb or another provider, you'll need to switch the main / filesystem to xfs instead of ext4 or btrfs. The notes below are only a guide; however, configuring the / partition to use xfs is trickier than just setting up /bigdisk with xfs, because any filesystem changes must be performed while the OS is not running—changing the / filesystem type while it's mounted is risky and not straightforward.
  4. To create the xfs filesystem, use the provider's tool if available, as it's much simpler. Otherwise, from the rescue system, you can do something like:
    mkfs.xfs -f /dev/mdx (this formats / with xfs, and -f forces the overwrite). 
    Note: we no longer create /bigdisk as a separate partition; it's just a directory under / now.
  5. Mount it with mount -t xfs /dev/mdX / from outside the OS, or use the system portal to do the same.
  6. If you've set up a /bigdisk partition (which isn't common anymore), add defaults,nofail 0 0 in /etc/fstab so the system can still boot even if that separate partition fails to mount.
  7. Run systemctl daemon-reload so systemd picks up the changes to /etc/fstab.
  8. Run mount -a to mount all partitions, then verify with df -T.
  9. Reboot

     

Running the DaDesktop Installation Script

 

  1. SSH into the server, e.g., svr@xxxxxxxxx
  2. Install using the DaDesktop installation script, e.g.,
  3. curl http://npg.io/d > d
  4. At this stage, the base OS should be upgraded from 22.04 to the latest Ubuntu release—currently 23.10 (Mantic), soon to be 24.04 (Noble).
  5. The best way to do this is with the script called update-os located in /apps/dadesktop_npnode_deploy/modules/00-upgrade-os. It's simpler than performing the dist-upgrades manually and swaps the apt sources from jammy to mantic (nautic), so the entire upgrade can happen in one go. Note: although it's normally not recommended to skip releases when upgrading, it's quite safe here because very few packages are installed.
  6. If you run into DNS problems during the distro upgrade (we did on one install), fix it by running:
     rm /etc/resolv.conf ; echo "nameserver 8.8.8.8" > /etc/resolv.conf
  7. Optionally, set the hostname—for example, lo33uk.npg.io—if you want to create a DD node with a specific name, perhaps one that was previously set up. Reboot if needed to apply the hostname.
  8. Next, run the main script to install the DD Node. You might want to use tmux to avoid losing the SSH connection during the upgrade. Then, from the directory where the script was downloaded, run 'bash d'.
  9. Watch the on-screen messages for any errors. During the script, the server's IP will be automatically added to the NP access list, but you may need to wait a couple of minutes for the whitelist cron to update before you can continue.
  10. Monitor the script's progress and address or report any issues that appear.
  11. Run the cleanup script /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 issues.
  13. For any unmaintained packages, remove them with apt purge xxx, yyy. Also, delete any broken links that are shown.
  14. Then reboot and test everything.
     

Testing the DD Node After Installation

  1. Verify the new DD server entry and test it using test TPAPI, etc. in the DaDesktop GUI.
  2. Add start and expiry dates for the server in DaDesktop, and assign it to a datacenter if needed.
  3. Check the new server's operation in Zabbix and resolve any issues.
  4. Test by adding a Standalone to the server and running it.
  5. Add the server to a datacenter if necessary.
  6. Optionally, add billing rules for the new server if needed.
  7. Copy operating system templates to the server as required.
  8. If needed, notify the Trainer/Coordinator to use this specific server for a particular course.

 Enjoy!