Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Proxmox High Availability

You're reading from   Proxmox High Availability Discover how to introduce, design, and implement high availability clusters for your business without hassle

Arrow left icon
Product type Paperback
Published in Oct 2014
Publisher
ISBN-13 9781783980888
Length 258 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
CHENG MAN CHENG MAN
Author Profile Icon CHENG MAN
CHENG MAN
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Basic Concepts of a Proxmox Virtual Environment FREE CHAPTER 2. Getting Started with a High Availability (HA) Environment 3. Key Components for Building a Proxmox VE Cluster 4. Configuring a Proxmox VE Cluster 5. Testing on a Proxmox Cluster 6. System Migration of an Existing System to a Proxmox VE Cluster 7. Disaster Recovery on a Proxmox VE Cluster 8. Troubleshooting on a Proxmox Cluster Index

Basic administration on Proxmox VE

After we have talked about so many concepts, let's learn how to configure Proxmox! I assume you have downloaded and installed your own Proxmox. If you face any difficulty during the installation, you can refer to the following link:

https://pve.proxmox.com/wiki/Quick_installation

The following steps will help you perform basic administration in Proxmox VE:

  1. After the installation, you should be able to see the following screen:
    Basic administration on Proxmox VE
  2. In this step, access the Proxmox VE using a web browser, and make sure you have network access and you are connected in the same subnet as Proxmox. Then, type in a URL in the following format in your browser: https://<Proxmox_IP>:8006. When you first visit the page, your browser will warn you that the SSL certificate is not a trusted one. It is normal if you have experience in building your self-signed SSL certificate on your web server. If you have a domain name for your Proxmox server and would like to have a SSL certificate signed by an authorized CA, please take a look at the following sites:
  3. Next, simply choosing Continue to this website in Internet Explorer adds to the exception. Similarly, choose I understand the risk in Firefox and Chrome. Next, just log in to the system with the root account since we haven't created our own user account. Being logged in, the following warning message indicates that you do not have a valid subscription plan. You can ignore this warning message if you currently don't need to have technical support.
    Basic administration on Proxmox VE
  4. Within the web GUI, you will be able to manage most features of the Proxmox platform. For example, you can create new virtual machines by using the buttons located in the upper-right corner, as shown in the following screenshot:
    Basic administration on Proxmox VE

    There are two ways to create new virtual machines: Create VM and Create CT.

  5. By clicking on the Create CT button, you can create a virtualized Linux platform under the OpenVZ container. It is recommended for GNU/Linux guests because the Linux kernel is shared with the host server, which means that the used memory on the host server will be reduced. When you go through the wizard after clicking on the Create CT button, a virtualized OS is created based on the OS template you used. An OS template is an operation system (for example, CentOS, Debian, and others) with customized packages installed and predefined system parameters. The templates are available in the form of a brand new system or installed with a web server or an application like Drupal. Typically, no graphical user interface (GUI) is preinstalled in the virtualized guests if you use this type of installation.

Uploading the OS template or the ISO file to Proxmox

Before we can start trying to build our own virtual machines with OpenVZ, we have to first upload either an OS template or an ISO file that contains the operating system installation files to Proxmox. The following steps will help us understand how to do this:

  1. Double-click on the icon that is named as the hostname of Proxmox, then choose local, click on Content, and choose Upload from the panel on the right-hand side, as shown in the following screenshot:
    Uploading the OS template or the ISO file to Proxmox
  2. After we have clicked on the Upload button, three options are available, as shown in the following screenshot:
    Uploading the OS template or the ISO file to Proxmox

    The three options available are as follows:

    • ISO image: This is used as the installation source file for Kernel-based virtualization
    • VZDump backup file: This is used to upload backup files created by Proxmox for restoration
    • OpenVZ template: This is used for the installation source for OpenVZ virtualization
  3. Then, we can simply browse the file that we would like to upload. Pay attention when uploading the OpenVZ template file; you need to use the following naming format:
    {OSName}-{OSVersion}-{OSName}_{OSType}_{amd64/i386}.tar.gz

    This format is shown in the following example:

    centos-6-CentOS_standard_amd64.tar.gz

    The output can be seen in the following screenshot:

    Uploading the OS template or the ISO file to Proxmox

We are now ready to create our own virtual machines; let's see how we can create an OpenVZ-based virtual machine first. For example, the OpenVZ template file will be stored inside /var/lib/vz/template/cache/; you can also manually upload it to that directory if you don't wish to use the web interface.

Creating an OpenVZ-based virtual machine

To create an OpenVZ-based virtual machine, please follow these steps:

  1. Click on the Create CT button, and the following window pops up; a system hostname and a password for the root account can be defined, as shown in the following screenshot:
    Creating an OpenVZ-based virtual machine
  2. Next, the system will ask you for the template you want to use; for example, you can choose centOS-6-CentOS_devel_amd64.tar.gz:
    Creating an OpenVZ-based virtual machine
  3. Then, you will be asked to assign resources to the VM; we can accept the default setting for testing purposes:
    Creating an OpenVZ-based virtual machine
  4. After we have allocated system resources to the new virtual machine, we reach an important part: networking. Here, you have the following two options:
    • Routed mode: This uses the default network interface used by Proxmox, and simply specifies an IP address. Only select routed mode if you create a guest system that lies in the same IP subnet as the host system. It would be slightly easier during the system configuration than in the Bridged mode.
    • Bridged mode: This allows you to choose a network adapter other than the default one (including a VLAN-enabled interface). It requires a DHCP server for IP assignment or is manually configured under VM. A demonstration on how to configure the Bridged mode will be shown in Chapter 4, Configuring a Proxmox VE Cluster.

    In the following screenshot, we choose the Routed mode and specify an IP address for demonstration:

    Creating an OpenVZ-based virtual machine
  5. The following settings regarding the DNS parameters are saved to the /etc/resolv.conf file in the virtualized guest:
    Creating an OpenVZ-based virtual machine
  6. A summary for the configuration is displayed before the VM is created.
  7. After the VM creation is completed, you can view its status in the Summary tab, as shown in the following screenshot:
    Creating an OpenVZ-based virtual machine

Creating a kernel-based virtual machine

We have seen how to create OpenVZ-based virtual machines; now, let's learn how we can create a kernel-based virtual machine:

  1. Click on the Create VM button in the top-right corner, as shown in the following screenshot:
    Creating a kernel-based virtual machine
  2. Specify a name for identification, but please note that the name is not directly applied to the VM's hostname, as shown in the following screenshot:
    Creating a kernel-based virtual machine
  3. Then, we need to choose the type of platform we are going to create, shown as follows:
    Creating a kernel-based virtual machine
  4. Next, the OS installation source is specified, shown as follows:
    Creating a kernel-based virtual machine
  5. After that, we have to allocate the hard disk for the virtual machine. Pay attention to the hard disk's Format you have chosen; the raw format will instantly allocate the space you have defined (that is, if you defined a 20 GB hard disk, a disk image with 20 GB will be created under the host server) while the QEMU format will only allocate the space based on the current usage of the guest OS. If the guest OS takes up 8 GB, then a disk image with 8 GB in size will be created. For more details, refer to the Virtual disk options under Proxmox VE section. The hard disk window is shown in the following screenshot:
    Creating a kernel-based virtual machine
  6. The number of cores/sockets and the CPU types have to be specified for the guest, as shown in the following screenshot:
    Creating a kernel-based virtual machine
  7. Of course, we need to allocate the amount of memory for the guest platform, shown as follows:
    Creating a kernel-based virtual machine
  8. For the network part, similar to the OpenVZ creation, we have bridged mode and NAT mode. Here, we can specify Model for the virtualized VM; generally, choosing Intel E1000 and Realtek RTL8139 should be fine. The VirtIO option provides better performance, but the driver must be installed on the guest OS before it can be used. This is shown in the following screenshot:
    Creating a kernel-based virtual machine
  9. A summary of the configurations is displayed for confirmation.
  10. Just as it appears for OpenVZ, we can find our created VM under the menu, as follows:
    Creating a kernel-based virtual machine

Isn't it easy to create a virtual machine with a web interface? By the way, you can identify whether a virtual machine is an OpenVZ container or KVM by its associated icons, as shown in the following screenshot:

Creating a kernel-based virtual machine

Accessing the new virtual machine

Congratulations! You have just created your own virtual machine! Wait, how can we access the system? That's a good question; here, we have two options to achieve our goal. One option is to access it from the web browser. What? Access an operating system with a web browser? Yes, let's see how it works:

  1. Right-click on the virtual machine you would like to access from the panel on the left-hand side, and then choose console.

    Prior to Proxmox 3.2, a new console mode, SPICE, was introduced, which provides a better usage performance especially in a KVM machine. You can refer to https://pve.proxmox.com/wiki/SPICE for more details.

    Make sure you have the latest JAVA runtime (JRE), preferably with JAVA 7 on your browser, and allow it to run if there is any prompt message. You can download it from http://www.oracle.com/technetwork/java/javase/downloads/index.html. If you cannot run the applet, refer to Chapter 8, Troubleshooting on a Proxmox Cluster, for troubleshooting.

Pay attention to OpenVZ-based VM; you will see that it cannot be accessed from the console because you have to configure a getty service inside the VM. So, we need to use another method for this purpose, for example, the OpenVZ management CLI:

  1. Access your Proxmox console with the root account, as shown in the following screenshot:
    Accessing the new virtual machine
  2. You can check the existing running OpenVZ containers with the vzlist command as shown in the following screenshot:
    Accessing the new virtual machine
  3. Then, access it with vzctl enter <CTID>, for example, vzctl enter 102.
  4. Create a new file under /etc/init.d/tty.conf with vi or any text editor you like.
  5. Paste the following code in the tty.conf file:
    # This service maintains agetty on tty1 from the point the 
    # system is started until it is shut down again.
    start on stopped rc RUNLEVEL=[2345]
    stop on runlevel [!2345]
    respawn
    exec /sbin/agetty -8 tty1 38400
    
  6. Reboot the guest VM or type start tty to reboot.
You have been reading a chapter from
Proxmox High Availability
Published in: Oct 2014
Publisher:
ISBN-13: 9781783980888
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image