[TUTORIAL] Proxmox and education: Virtualizing a two-node Proxmox cluster with Qemu/KVM

livios2023

New Member
May 11, 2023
2
0
1
Perhaps the most interesting part of this short paper is the tools I used to write the text. The content of a purely descriptive nature (Background), where the topics are already covered extensively in the literature, and on which it is practically impossible to add something new and original, I entrusted them to the work of Artificial Intelligence. They were in fact generated by resorting to Simplified's AI Writing (https://www.dropbox.com/s/sancpmqyziu7uvq/AIWriting.png?dl=0). I then took away the boring and repetitive part (the AI cleverly packages the already said, what is known, adapting it to the context described by the user) to concentrate on the creative part (at least that's how it seemed to me :D) : the writing of the procedure to implement the cluster, which is entirely my own creation. The organization of the text I entrusted to Joplin.

The quality of intellectual work has radically changed with the introduction of these technologies. Those who do intellectual work are required to be as creative and original in their thinking as possible, if they are not to be replaced by the "machine" and cut off traumatically from the world of work. It is good for schools to take this into account by trying to stimulate the creative side of learning.



Background

Proxmox is a virtualization software used mainly in business, but it can also be used in education. Here are some possible uses:

- Virtual lab environment: Proxmox allows you to create virtual machines (VMs) with different operating systems, enabling you to simulate a computer lab environment. For example, one can create VMs with different Linux and Windows operating systems, set up virtual networks, test security configurations, and so on.
- Remote learning environment: VMs with pre-installed development environments (e.g., Eclipse, Visual Studio) can be created and used as a remote learning environment. In this way, students can work on computer projects from their own homes, without having to install anything on their own computers.
- Legacy hardware: Proxmox allows you to virtualize old operating systems that cannot run on modern hardware. For example, VMs can be created with Windows XP or 98, using old educational programs that do not run on modern operating systems.
- Development platform for teachers: Proxmox can also be used as a development platform for teachers, who wish to create their own teaching tools. For example, VMs can be created based on Moodle, a learning management system, or on e-learning platforms such as Open edX, and so on.

This will provide teachers with a flexible and customizable development environment to create and test their own teaching tools, without necessarily having to rely on external platforms that are limited in their potential. In addition, with the centralized VM management offered by Proxmox, teachers will be able to easily manage and control all their teaching resources, ensuring a more effective and organized learning experience for their students.

This means that teachers will be able to monitor VM usage, manage VM permissions, and access student data safely and securely. This will also make it easier to keep track of student progress and adapt their teaching approach more precisely.

Using Proxmox as an instructional development environment will thus be able to significantly improve teaching effectiveness and make learning more interesting and engaging for students. In addition, access to customized teaching resources and the freedom to develop creative and innovative tools will make teachers' work more challenging and meaningful.

Students will be able to experiment on a wide range of platforms and configurations, without having to invest in expensive hardware or risk causing damage to physical machines. Proxmox's virtualization environment allows students to consolidate their knowledge of operating systems, networking, security, and server administration without having to worry about compromising physical devices or asking for access to limited resources.

The Proxmox-based pedagogical approach also allows for the inclusion of multiple learning strategies, such as guided labs, labs, and skill-oriented projects. Students can work collaboratively on complex projects, tackling real challenges and developing problem solving, time management and teamwork skills. In addition, teachers can monitor and evaluate student activities more effectively, providing immediate feedback and supporting students in their explorations.

Finally, using Proxmox as an instructional development environment enables educational institutions to create personalized and flexible learning environments that can be tailored to the needs and preferences of students and teachers. In this way, technology becomes a tool that amplifies teaching and learning, enabling students and teachers to build meaningful and lasting knowledge.

Procedure

As mentioned in the introduction, Proxmox is virtualization software that allows you to easily manage multiple virtual machines within a single system. In addition, you can install it on a physical server or virtualize it with Qemu/KVM.

I report the procedure I followed to virtualize a Proxmox cluster with two nodes, using Qemu/KVM.

Description of the host used:

Software:

- Linuxmint distributor
- Description: Linux Mint 21.1
- Version: 21.1
- Codename: Vera

Hardware:

- RAM: 24GiB
- Processor: Intel(R) Core(TM) i7-6700HQ CPU
- Video card: GM107M [GeForce GTX 950M]

Steps:

1. Preliminarily, it is necessary to proceed with the creation of some partitions of the host's physical disk, to which the VM disks will point. Direct access to the hardware realizes the most efficient conditions for VM read and write operations on the storage device. For experimental purposes, the VM disks will be aggregated in RAID0. It is recommended to use Gparted. Each of the 8 partitions created has the size of 128000 MiB (mega binary bytes) equal to 125 GiB and xfs filesystem. (https://www.dropbox.com/s/506s0sdzwuvocxs/gparted-1.png?dl=0) (https://www.dropbox.com/s/3n16c941euj4mcp/gparted-2.png?dl=0) (https://www.dropbox.com/s/t7d7q061ws2lj53/gparted-3.png?dl=0).

2. Download Proxmox VE iso from https://www.proxmox.com/en/downloads/item/proxmox-ve-7-4-iso-installer .

3. Verify the authenticity of the iso with GtkHash, or similar (https://www.dropbox.com/s/krfn0kq5a1q1nay/PVEhashchek.png?dl=0).

4. Create the ProxmoxVE VM with Virt VMM (https://www.dropbox.com/s/lx94xd1ke5e6miv/VM-1.png?dl=0).

5. Select Debian 11 (https://www.dropbox.com/s/hrhzpjepfo8rny1/VM-2.png?dl=0) as the operating system.

6. Assign 5120 MiB of memory (5 GiB) and 4 CPUs (these values, if necessary and consistent with available resources, can be increased later) (https://www.dropbox.com/s/xkx44v9nbndnj6p/VM-3.png?dl=0).

7. Select "custom storage" and, for direct access to the physical device, initially assign, in my case, the partition /dev/sda5 (https://www.dropbox.com/s/lflvv9w6as6i2tf/VM-4.png?dl=0).

8. Proceed with next window and assign the name of the VM of the first node, in my case PVE74a (for the second node it will be PVE74b), select the custom configuration before installation and configure the network in bridge mode: to do this I launch the command ifconfig (https://www.dropbox.com/s/dhmxcalfxx2lnkc/VM-5.png?dl=0) to locate the NIC of the host, in my case, virbr0 (https://www.dropbox.com/s/ad8exqvpg84ybp1/VM-6.png?dl=0).

9. Add three more disks that, in my case, point to partitions /dev/sda6, /dev/sda7 and /dev/sda8 (https://www.dropbox.com/s/pk4266vsjzpgf6f/VM-7.png?dl=0).

10. Proceed with the installation by clicking "Begin installation."

11. When the Proxmox screen appears, proceed with a simple enter.

12. Click on Option and select zfs (RAID0), assigning the disks previously created (https://www.dropbox.com/s/8cu1ku8j1akjuo8/VM-9.png?dl=0).

13. On the next screen select the country, the rest follows (https://www.dropbox.com/s/1ryz83agi6evras/VM-10.png?dl=0).

14. Set the password and your mailing address (https://www.dropbox.com/s/gebmwi4qu1z3eix/VM-11.png?dl=0).

15. Select the administrative network interface, if the server has multiple network cards, but this is not our case, and enter the hostname in the FQDN fomato, e.g. prox-1.test.it (https://www.dropbox.com/s/jqnyxzscm5ao53a/VM-12.png?dl=0).

16. At the summary click "install" and wait for the installation to complete(https://www.dropbox.com/s/n05oojpv56r6lj0/VM-13.png?dl=0).

17. Load the administrative page with the browser, proceeding in non-secure mode (no risk, I am on a private subnet) (https://www.dropbox.com/s/8jtl4h943dz9t01/VM-14.png?dl=0); authenticate with root user and the password previously set (https://www.dropbox.com/s/6e8hwu4axbykexr/VM-15.png?dl=0).

18. Proceed similarly for the creation of the second node.

19. After the second node installation is complete, configure /etc/hosts for local node resolution by adding the following two lines (https://www.dropbox.com/s/hgzawweihrrc9bc/hosts.png?dl=0):

192.168.122.104 prox-1

192.168.122.150 prox-2

20. For convenience, configure Remmina for SSH connection to the nodes (https://www.dropbox.com/s/xu4fl8gtr2m5d9o/remm-1.png?dl=0) (https://www.dropbox.com/s/hn97kdx3cpvb345/remm-2.png?dl=0).

21. Create from the web interface of node prox-1 the cluster named Pistis (datacenter->cluster->create cluster).

22. Add node prox-2 to the newly created cluster.

23. From prox-1 copy the Join information, then on prox-2 go to datacenter->cluster->Join cluster and paste the association data to the Pistis cluster, completing with the root password.(https://www.dropbox.com/s/0lezbmwe6sqhr60/clu-2.png?dl=0) (https://www.dropbox.com/s/3e47amhpos0yz1p/clu-4.png?dl=0).

24. Connect via SSH to the two nodes (https://www.dropbox.com/s/dpwxnts8ap61cxl/remm-3.png?dl=0).

25. Remove and regenerate certificates from shell with the commands rm /etc/pve/priv/pve-root-ca.key /etc/pve/pve-root-ca.pem and pvecm updatecerts -f on both nodes.

26. Restart the administration web page.

27. DONE!!! (https://www.dropbox.com/s/1dgg87ns7aczxcb/pistis2.png?dl=0).

PS. You may want to monitor resource allocation with htop ([https://www.dropbox.com/s/7yggmkr3amxr99c/Screenshot from 2023-05-03 20-02-27.png?dl=0](https://www.dropbox.com/s/7yggmkr3amxr99c/Screenshot%20from%202023-05-03%2020-02-27.png?dl=0)).
 
Nice article, but I thing about your hardware. I don't know how many students you have but I will share my experience.

My classroom labs:
Proxmox cluster with two servers HP ProLiant DL380 Gen9 2U with: 2xE5-2680 V4 (2x14 core), 64 GB RAM, disks: SSD and HDD, network: 4x1Gb, 2x10Gb and 2x20/40Gb (cluster network). Summary: 56 core/108 threads, 128 GB RAM DDR4, 4TB SSD, 16TB HDD.
16 x PC in classroom
Switch (24x1Gb, 2x10Gb - connected with cluster)

I have no problem to run 8-16 VM at one time with W2K16 Server, Ubuntu Server etc.
Sometimes I need 32 VM with W2K16 and a throat appears with SSD disks. 16 servers promote domain and we can go play cards;) On the next 16 servers we run sysprep and I have 15-20 min for theory or cards;)

Surely there will be experts here who will advise me which is better: clone or link clone. I like link clone - few minutes and I have 8 or more VMs running.
 
Summary: 56 core/108 threads, 128 GB RAM DDR4, 4TB SSD, 16TB HDD.
Are those SSDs enterprise grade SSDs? In what configuration?

And why do you have so little RAM. 10 years ago, we had clusters with 6-core CPUs that had more RAM than this. This seems sooo little to run a 8-16 Windows VMs on it.
 
Are those SSDs enterprise grade SSDs? In what configuration?
Unfortunately, the drives are not enterprise grade. Configuration: ZFS, raid level: single disk.

Code:
przemo@pve1:~# zpool status ssd.pool
  pool: ssd.pool
 state: ONLINE
  scan: scrub repaired 0B in 00:02:36 with 0 errors on Sun May 14 00:26:40 2023
config:

        NAME        STATE     READ WRITE CKSUM
        ssd.pool    ONLINE       0     0     0
          sda       ONLINE       0     0     0
          sdb       ONLINE       0     0     0

And why do you have so little RAM. 10 years ago, we had clusters with 6-core CPUs that had more RAM than this. This seems sooo little to run a 8-16 Windows VMs on it.
Sad but true. Polish schools (high school level) have a very low budget. More RAMs and SSDs enterprise they remain my dream this year.
 
Unfortunately, the drives are not enterprise grade. Configuration: ZFS, raid level: single disk.
That's sad. Enterprise grade SSDs perform much better than consumer grade.

Sad but true. Polish schools (high school level) have a very low budget. More RAMs and SSDs enterprise they remain my dream this year.
Those beefy CPUs you have are costly, therefore I asked. Normally it's best to optimize CPU and RAM, but the if you have to choose, get more RAM than better CPUs.

We often recommend to buy used hardware, which is MUCH cheaper than new hardware and you can still get support with a after-market vendor support if you like, of just buy more of the same hardware to have 1:1 replacements ready if you need to.
 
Nice article, but I thing about your hardware. I don't know how many students you have but I will share my experience.

My classroom labs:
Proxmox cluster with two servers HP ProLiant DL380 Gen9 2U with: 2xE5-2680 V4 (2x14 core), 64 GB RAM, disks: SSD and HDD, network: 4x1Gb, 2x10Gb and 2x20/40Gb (cluster network). Summary: 56 core/108 threads, 128 GB RAM DDR4, 4TB SSD, 16TB HDD.
16 x PC in classroom
Switch (24x1Gb, 2x10Gb - connected with cluster)

I have no problem to run 8-16 VM at one time with W2K16 Server, Ubuntu Server etc.
Sometimes I need 32 VM with W2K16 and a throat appears with SSD disks. 16 servers promote domain and we can go play cards;) On the next 16 servers we run sysprep and I have 15-20 min for theory or cards;)

Surely there will be experts here who will advise me which is better: clone or link clone. I like link clone - few minutes and I have 8 or more VMs running.
Right. I tried to describe a posiible individual student experience on their personal computer, on their laptop for example.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!