all-in-one icon indicating copy to clipboard operation
all-in-one copied to clipboard

Add information about virtual machines

Open BraidenPsiuk opened this issue 1 year ago • 2 comments

This change adds a guide for provisioning multiple VMs to run their own AIO instances. My idea is to provide a thorough guide that is easy to follow and gets readers up and running quickly, but without going too deep, unless the reader seeks to delve into advanced configuration. I wrote this because I tried going through this process myself, and spent hours struggling to piece everything together.

If the guide is too long or does not fit in with the rest of the material I am happy to provide changes. I also hope that somebody with more knowledge can provide better info for getting Nextcloud Talk to work.

BraidenPsiuk avatar Feb 25 '24 09:02 BraidenPsiuk

This is my first "real" review process, so please feel free to correct me if I do anything that doesn't seem conventional.

No problem about the wait! It's actually good. I've been testing this setup with two VMs/AIO instances in a small business office network (static IP, daily file downloads from a small number of customers via web shares, etc.) for the past month, and these instances have been running very smoothly, including the auto backups/updates. So it's given some time to make sure no weird issues pop up. It also has felt pretty easy to manage this setup.

Despite it mostly going well, I do have a few thoughts/decisions for the guide that I've been struggling to decide on my own. I'll list them and maybe you could help decide?

  1. I've been testing on a physical host machine with a 4TB SSD. One of my two VMs is very storage-heavy and makes use of ~1.5TB (the other VM only uses ~200GB). I initially allocated 1.7TB to the larger VM, but recently decided it was time to expand this above 2TB. So I tried growing the root partition to something like 2.5TB, but found I was unable to, because the Debian installer initially made the decision to use MBR as the partitioning scheme (and MBR doesn't allow >2TB. GPT seems to be necessary for this).

    I learned that if you initially allocate >=2TB to the VM before running the Debian installer, the installer will use the GPT scheme. But I have a feeling many people will not start off with quite that much storage, but may expand to that at a later point (for example, by adding more drives to their volume group if they used LVM or similar). I also learned that the only way to "force" the installer to use GPT (without initially allocating >=2TB) is to boot the VM in UEFI mode, which requires 1 extra package on the host, ovmf, and 1 extra flag, --boot uefi, added to the virt-install VM creation command (more info). Unfortunately there's no easy option to just set this in the installer. It's apparently possible to change from MBR to GPT after the initial setup, but it's very risky, and when I tried it left me with an unbootable VM- so not good to recommend this approach.

    TL;DR: Most readers following the guide currently will not be able grow above 2TB if they didn't already set it up that way. If they store their files in the default docker volume, this will give them trouble if they ever want to grow past 2TB. The use of Virtualization is nice since we can mostly add/remove resources whenever we need, so it would be unfortunate to run into this storage limitation. Changing the guide to include UEFI boot seems to fix this.

    Therefore: Should the guide use UEFI mode by default when creating VMs? I have no idea what the average amount of storage self-hosting NC admins usually allocate is. So I don't know how many people this may potentially help. And using UEFI doesn't seem to have any downsides, but I'd rather be 100% certain. Maybe instead, this info should just go in the "extra tips" section. But it's one of those things you don't know you need, until you really need it. For me, I had to migrate my large instance to a new VM with UEFI/GPT and now it's working great. Sorry this point is so long but I feel it deserves the most consideration.

  2. I addressed the TALK port stuff in your review comments and will add this. But as far as actually testing Talk with my instances I haven't found the time lately for getting that working. I haven't looked into what is needed to bridge the VMs yet and want to learn more about this first. The company I'm running these instances in will benefit from me enabling Talk though, so I do hope to get that working over the next few weeks, and will gladly write the docs for that part too unless someone beats me to it. Do you want this PR to remain open until Talk is fully finished being documented?

  3. I used long, chained commands for convenience and readability of the guide as a whole, especially since the reader is expected to repeat steps and the commands are explained in better detail on the main README. But I know most people prefer the multiline commands for safety and better understanding. Should I switch to multiline commands? Also any security concerns for the "dl.cloudsmith.io" URL?

  4. Does Debian still seem good as the example distro or is there perhaps a more suitable one?

  5. Is it okay to still recommend enabling SSH in the installer? The alternative would be just suggesting virsh console and leaving SSH up to the reader to decide to install later. (I've been using virsh console lately to manage mine, but sometimes you get bad graphical "tearing" with long commands, also lacks text color).

Other small changes I want to do, just making sure they sound good as well:

  1. Replace all uses of term "physical host machine" with "host physical machine" - To follow what Red Hat docs use, especially since we're using virsh
  2. Small mention (somewhere around the top) that all commands are expected to be run as root
  3. Include, after VM setup instructions, that Ctrl + ] lets reader detach from console session once they're done configuring a VM

BraidenPsiuk avatar Apr 06 '24 05:04 BraidenPsiuk

  1. Should the guide use UEFI mode by default when creating VMs?

I guess this makes sense, yes

2. Do you want this PR to remain open until Talk is fully finished being documented?

No, feel free to create a follow-up PR

3. Should I switch to multiline commands?

Yes, this would be great!

Also any security concerns for the "dl.cloudsmith.io" URL?

The cloudsmith.io is from the official caddy docs so should be fine

4. Does Debian still seem good as the example distro

I would usually recommend Ubuntu Server LTS

5. Is it okay to still recommend enabling SSH in the installer?

Yes, I'd say so

  • Replace all uses of term "physical host machine" with "host physical machine" - To follow what Red Hat docs use, especially since we're using virsh
  • Small mention (somewhere around the top) that all commands are expected to be run as root
  • Include, after VM setup instructions, that Ctrl + ] lets reader detach from console session once they're done configuring a VM

Yes, sounds good to me 👍

szaimen avatar Apr 08 '24 03:04 szaimen

Hi @BraidenPsiuk do you have any update here? :)

szaimen avatar May 14 '24 13:05 szaimen

Hi @BraidenPsiuk do you have any update here? :)

Yes! Sorry for the long delay. Was finishing up a data structures/algorithms course that took a lot of my time :) Anyway, Here's a preview of my changes which I'll still be rapidly updating tonight. I'll have it finished and those changes pushed here for review within the next ~~8~~ ~~14~~ 18 hours.

I added specific instructions for Ubuntu Server and I'm testing that on hardware to make sure everything works as expected.

BraidenPsiuk avatar May 19 '24 23:05 BraidenPsiuk

Hi again, just letting you know that I've submitted the updated version of the guide. Any/all feedback welcome!

BraidenPsiuk avatar May 20 '24 18:05 BraidenPsiuk

btw, @BraidenPsiuk I just invited you to the repo :)

szaimen avatar May 21 '24 09:05 szaimen