Part 1, Installing Proxmox on our servers
In part 1 I am only going to cover the basics of the setup of the Proxmox 4.2 server. This will be fairly short because the basic setup of Proxmox 4.2 is very simple. If you are looking to get your toes wet with virtualization I highly recommend it. It is completely free, you only need to pay if you want their support services. I pay for the basic subscription simply because I like to support the project. If you like it and you want to support the developers so they can continue to make it better please help support the project.
** WARNING – THE FOLLOWING WILL DESTROY THE EXISTING OS ON YOUR COMPUTER **
For this post I am going to install Proxmox within a Proxmox virtual machine (proxception?) so that I can take screenshots throughout the process. Normally you would not do this because it will severely affect performance. So, let’s begin. First you need to download the latest ISO from Proxmox. If you can, use the BitTorrent link and let it seed for a while to help them out with bandwidth. Once you have that you will need to burn it to a flash drive. If you are a Windows user the best option for you is probably going to be Rufus. If you are a Linux user simply use DD – if you are new to Linux, you might consider using Unetbootin.
For DD you need the ISO file name (if=) and the flash drive device name (of=). Make sure you know what the device name is of your USB flash drive, using this incorrectly could destroy your system or cause data loss.
dd if=proxmox-ve_4.2-725d76f0-28.iso of=/dev/XYZ bs=1M
Once you have the bootable flash drive insert it into your system and reboot. You may need to press a key to get into the boot menu. Consult your system’s documentation for instructions on how to boot to the flash drive. Make sure you do the following on a spare system, do not do this on your normal desktop or a server you will continue to need in production. The following will wipe the hard drive and install Proxmox, there will be no way to recover your data or operating system.
** WARNING – THE FOLLOWING WILL DESTROY THE EXISTING OS ON YOUR COMPUTER **
Once you boot to the flash drive you will be presented with the following menu. Select Install Proxmox VE.
Read the end user license agreement. If you do not agree click Abort. Otherwise, click I Agree to continue.
We need to tell Proxmox how to setup the hard drive. There are many options you can choose here. For the servers I setup there was approximately 1.7TB of SSD RAID5 array available. I wanted 100GB of that to be used for the Proxmox OS partition, 128GB for swap, and approximately 1TB for the virtual machines LVM. So for the “hdsize” I entered: 1280.0. For “swapsize” I entered 128. For “maxroot” I entered 100. After the initial installation I partitioned the remainded into a partition I mounted as “backup” to be used for Proxmox backups. By default Proxmox puts these on the system partition (maxroot) which is never more than 100GB. I wanted more than that for the backups. Ignore the hdsize in the above example, this was a screenshot taken in the proxception which only had 32GB assigned to it. Once you have chosen your settings click OK then click Next.
Choose the localization options you need and click Next.
Enter the FQDN for your new server. If possible add this to your DNS server after this is complete. Enter the static IP address, netmask, default gateway and DNS server. You will be able to change all of this later but you will need to be able to access the system to change it so make sure you use valid information. Once you are done entering the settings click Next.
Proxmox will begin copying files and configuring the initial setup. Once it is done click Reboot. Remove the flash drive before the system boots.
Let the system boot normally at the console screen.
When it has finished booting you will be presented with a screen similar to this. For now, you won’t need to login to the console. With the exception of one small change, everything most people need to do can be done through the web management console. But, you should familiarize yourself with the Linux command line if you plan on using Proxmox in production.
The command you will need to enter will make a small change to the apt repository settings. By default the system is setup to try to connect to the “Enterprise” repository which is reserved for paying customers. If you are not going to purchase a subscription, or haven’t purchased one yet, you’ll need to change this to the no-subscription repository.
Login as root using the password you entered during the Proxmox setup. Once logged in enter the following:
echo "deb http://download.proxmox.com/debian jessie pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list mv -v /etc/apt/sources.list.d/pve-enterprise.list ~/. apt-get update apt-get upgrade
This will disable the enterprise repository and enable the no-subscription repository. It will then update the apt cache and install the latest updates. Once it is complete you can type “exit” to logout.
Open your web browser and connect to the link displayed after your system initially booted. For this system the link was https://192.168.130.150:8006. You will most likely receive an SSL error since the server is using a self-signed certificate. Once you are at the login screen enter the username root and the password you entered during the Proxmox setup.
You will receive a subscription error. You do not have to have a subscription to use Proxmox VE. But, the developers put a lot of their own time and effort into the system so please consider subscribing. Until you do this warning will be presented whenever you login to the web console. There is a way to disable it but I will not cover that here, my best suggestion for getting rid of the annoying error is to subscribe and help support the project. Click OK to get past the warning.
One of the first things we need to do is setup permissions. You don’t want everyone logging in as root, even you shouldn’t be regularly using root. So, we need to create a group and users. Click on DataCenter on the left, then Groups in the top menu. Click Add. Enter the name admin and for comment add something descriptive then click Create.
Click Permissions to the right of Groups. Click Add. For the path enter /, select the group you created, and select the role Administrator then click Add.
To setup a new user click Users to the left of Groups. You’ll need to enter the username, choose the group, and optionally enter an email address for the user. Normally I would setup a local Linux user in which case the “Realm” would be “Linux PAM…”. If you are trying to avoid the command line though simply choose “Proxmox VE…”. You can also use Active Directory or LDAP which are covered in the Proxmox manual. After that you can click on Logout in the upper right, then login as the new user you created.
Remember I didn’t partition part of the RAID5 array during the installation? I’m not going to go through the steps of partitioning the drive, formatting it as ext4, and mounting it to /backup here since there are a million posts about how to do this already. But, I will show you how to make that new partition available to Proxmox. Click on Storage on the top menu and click Add. Select Directory. For the ID, the name that will appear on the left, I chose “backup”. I entered the directory where I mounted the partition /backup. And I clicked the drop down arrow and selected only “VZDump…” as the content type. I also set the maximum number of backups to 2. After that I clicked Add.
I could have chosen a different type of storage. Directory, LVM, NFS and iSCSI are probably the most used. It is hard to go into detail about this but if you need more information on it let me know and I will see if I can put something together. Once it is all done you should see the new storage on the left under the hostname.
This part you probably won’t do on your own system. The servers I am installing have 8 1Gb/s network connections that I am bonding together in a bridge. Proxmox sets up the bridge by default during the installation but it only adds the first connection to the bridge, eth0. In the picture above you can’t see the additional network ports because this is from the proxception, but on the original you would see ports 0-7. To add those to the bridge you would click on your hostname on the left, select Network, select the bridge, and click Edit. You would then manually type in the name of the ports that you want to add to the bridge and click OK. There are other options here that you may want to explore, especially the “VLAN aware”. These and other settings are covered in the Proxmox documentation.
And that is it for the basic setup of the Proxmox server. In the next part I will cover actually creating virtual machines. Until then, for more information on Proxmox take a look at Udemy’s Proxmox VE 4 course. And of course, if you have any questions feel free to ask.
Intro – Magento Development Environment
Part 1 – Installing Proxmox
Part 2 – Creating the Virtual Machines
Part 3 – Setup MySQL Master-Master
Part 4 – Setup Ansible
Part 5 – Setup APT Proxy