Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add information about virtual machines #4274

Merged
merged 7 commits into from
May 21, 2024
Merged

Conversation

BraidenPsiuk
Copy link
Collaborator

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.

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.

Signed-off-by: Braiden Psiuk <[email protected]>
@szaimen szaimen added this to the next milestone Feb 25, 2024
@szaimen szaimen added 3. to review Waiting for reviews documentation Improvements or additions to documentation labels Feb 25, 2024
This fixes a few typos, including one that failed the "Check spelling" action, and removes ambiguity about which ports are expected to be open.

Signed-off-by: Braiden Psiuk <[email protected]>
Copy link
Collaborator

@szaimen szaimen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for these nice instructions! I have some remarks below.

And sorry that it took so long to review this!

multiple-instances.md Show resolved Hide resolved
multiple-instances.md Outdated Show resolved Hide resolved
multiple-instances.md Outdated Show resolved Hide resolved
This flips the two guides for better readability.

Signed-off-by: Braiden Psiuk <[email protected]>
@BraidenPsiuk
Copy link
Collaborator Author

BraidenPsiuk commented Apr 6, 2024

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

@szaimen
Copy link
Collaborator

szaimen commented Apr 8, 2024

  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 szaimen modified the milestones: v8.2.0, next Apr 16, 2024
@szaimen szaimen added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Apr 23, 2024
@szaimen szaimen modified the milestones: v8.2.1, next Apr 26, 2024
@szaimen
Copy link
Collaborator

szaimen commented May 14, 2024

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

@BraidenPsiuk
Copy link
Collaborator Author

BraidenPsiuk commented May 19, 2024

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.

Changes:
- Split guide into Ubuntu Server/Debian-specific sections
- Added explicit Talk port configuration (with instructions to increment this value for each VM/AIO instance)
- Split commands apart for readability and transparency (and to match the rest of the AIO docs)
- Added a tip for creating manual borg backups
- Included a few more QEMU-related prerequisite packages to install on the host physical machine
- Changed virt-install commands to use UEFI instead of default BIOS, in order to support potential future expansion of disk past 2TB
- Changed command for deleting a VM, so that it now prompts for confirmation before deleting. It also now works for both UEFI/BIOS boot types.
- Included a mention that commands are expected to be run as root
- Replaced occurrences of "physical host machine" with "host physical machine" to match Red Hat docs
- Other small functional/grammatical/spelling tweaks

Signed-off-by: Braiden Psiuk <[email protected]>
@BraidenPsiuk
Copy link
Collaborator Author

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

multiple-instances.md Outdated Show resolved Hide resolved
Signed-off-by: Simon L <[email protected]>

Signed-off-by: Simon L. <[email protected]>
Copy link
Collaborator

@szaimen szaimen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank you very much! :)

@szaimen szaimen added 3. to review Waiting for reviews and removed 2. developing Work in progress labels May 21, 2024
@szaimen szaimen merged commit 4794d51 into nextcloud:main May 21, 2024
2 checks passed
@szaimen
Copy link
Collaborator

szaimen commented May 21, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants