Score:0

What is the best way to learn how to setup and manage multiple Ubuntu Server VMs on one system?

jp flag

I am currently running several Ubuntu Server systems on independent machines and would like to explore options for running each as a virtual machine on the same server to consolidate hardware. Currently, I have each machine setup running different services, some running docker containers and others hosting web related services. I am mostly self-taught, so I apologize in advance for major holes in my knowledge.

Score:0
cn flag

Try it.

Start with a base system (Ubuntu Server). Add an LXD and/or Docker Container. Test it. Try to maintain/update it. Twiddle with the networking. Try to backup your data. Then delete the container entirely, rebuild anew, and try to restore your data on the new container.

Some services require a VM; many don't, and can be hosted in a mere Container instead. An LXD Container looks and feels like a VM for many purposes.

Stay on top of your hardware: Consolidation means that a power supply failure or disk failure will take down everything. Know how old your hardware is and which UUID refers to which disk in the case. As hardware ages, start to keep spares on hand. Backups are vital -- set up proper backups for each service as you install it (don't wait). Test how to restore from backups and write yourself a checklist that's accessible when your server is down.

You will make changes. Lots of changes. You will add and delete containers and VMs. When you create a new service, make yourself a step-by-step checklist of how to rebuild it the same way (you won't remember). When you make a change, or add new software to a service or alter a config file, update your checklist. Containers in particular are disposable -- you might be rebuilding them in a couple years from scratch.

heathdrobertson avatar
jp flag
LXD containers, great suggestion, thank you. I will start learning. LXD looks to be a cross between a VMs and Docker containers. Great admin suggestions on hardware, I also need to learn how to properly monitor and allocate system resources, I've only touched on this with Docker. I've built many docker images and containers for various reasons and have learned to comment and document everything. Gitbook and markdown files for everything.
paladin avatar
kr flag
Use btrfs as filesystem for your VM image files, it has many advantages when using VM. It would take too much to explain all features of btrfs filesystem, but you should really read about it, I guarantee, you will love it! :-) btrfs may be a bit slower in reading/writing data but that is only relevant for booting/loading your VM. Most performance depends on huge amount of RAM. it's also wise to give database VM (and other memory hungry VM) access to a real swap partition on a real drive (either enterprise SSD or a good SCSI harddisk).
heathdrobertson avatar
jp flag
LXD is great, thank you. I completed the LXC/LXD Deep Dive on A Cloud Guru, and have been switching most of my projects over to Linux containers, exactly what I was looking for.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.