KVM & OpenVZ Virtualization And Cloud Computing With Proxmox VE - Page 2
3 Creating A Cluster By Adding A Slave (server2.example.com) (Optional)
(You can skip this chapter if you want to run Proxmox on just one host.)
You can create a cluster or computing cloud by adding one or multiple slave servers to the Proxmox master (server1.example.com). Such a cloud allows you to create and manage virtual machines on remote hosts from the Proxmox control panel, and you can even do live migration of virtual machines from one host to another.
I will now show you how to add a second host, server2.example.com, and create a cluster.
Install Proxmox on server2.example.com, just as you did on server1. When you come to the networking section, fill in server2.example.com and make sure you use a different IP (e.g. 192.168.0.101):
After the installation has finished, and the system has successfully rebooted, log in on the command line (e.g. using PuTTY) on both server1 and server2.
On server1, run the following command:
server1:
pveca -c
server1:~# pveca -c
Generating public/private rsa key pair.
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
ce:bf:a2:cd:69:23:e4:78:fc:05:db:fc:55:ef:52:1d root@server1
cluster master successfully created
server1:~#
Then check the state of the cluster:
server1:
pveca -l
server1:~# pveca -l
CID----IPADDRESS----ROLE-STATE--------UPTIME---LOAD----MEM---ROOT---DATA
1 : 192.168.0.100 M A 00:14 0.00 5% 1% 0%
server1:~#
On server2, do the following:
server2:
pveca -a -h 192.168.0.100
server2:~# pveca -a -h 192.168.0.100
Generating public/private rsa key pair.
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
ea:ad:21:fc:5d:9b:af:ab:fb:0d:72:72:c7:94:23:ca root@server2
The authenticity of host '192.168.0.100 (192.168.0.100)' can't be established.
RSA key fingerprint is 7c:17:8c:35:9c:be:60:6b:56:97:2a:0b:72:60:57:09.
Are you sure you want to continue connecting (yes/no)? <-- yes
Warning: Permanently added '192.168.0.100' (RSA) to the list of known hosts.
[email protected]'s password: <-- root password of server1.example.com
cluster node successfully created
server2:~#
That's it, you've just created a cluster. You can check that by running:
server2:
pveca -l
This should display both servers in the output:
server2:~# pveca -l
CID----IPADDRESS----ROLE-STATE--------UPTIME---LOAD----MEM---ROOT---DATA
1 : 192.168.0.100 M S 00:15 0.00 5% 1% 0%
2 : 192.168.0.101 N S 00:04 0.08 15% 1% 0%
server2:~#
Now go back to the Proxmox control panel on http://192.168.0.100/ (you don't need the control panel on server2.example.com!) and go to Cluster, and it should list both servers:
4 Adding Appliance Templates
Before we can create OpenVZ containers, we must add at least one OS template to our system (for KVM guests, you can add ISO files, although this is not necessary - KVM guests can as well be installed directly from an OS CD or DVD).
Go to Appliance Templates. You will see two tabs, Local and Download:
On the Download tab, you will see a list of templates provided by the Proxmox project that you can download directly to the system...
... - at least theoretically - the problem is that the links are too old and not working anymore:
That's why we have to use the Local tab. You can go to http://download.proxmox.com/appliances/ and then to the admin, mail, system, or www folders...
... and download the desired templates to your local hard drive:
On the Local tab, you can then upload the templates to the Proxmox master:
You can as well upload ISO images that can be used for the creation of KVM guests. To delete a template or ISO file, click on the red arrow in front of it and select Delete: