Virtualization with VMware ESX and openQRM on Debian

This HowTo is about how to create and manage VMware ESX Virtual Machines on Debian with openQRM. This howto requires an additional system dedicated for the VMware ESX Host and it shows how to integrate the ESX Host into an existing openQRM environment.

Requirements

  • Two physical Server. Alternatively openQRM itself can be installed within a Virtual Machine
  • at least 1 GB of Memory
  • at least 100 GB of Diskspace
  • VT (Virtualization Technology) enabled in the Systems BIOS for the VMware ESX Host system so it can run HVM Virtual Machines later

Install openQRM on Debian

Install a minimal Debian on a physical Server.

Install and initialize openQRM

Please notice!
A detailed Howto about the above initial starting point is available at Install openQRM on Debian

For this howto we have used the same openQRM server as for the howtos about Install openQRM on Debian, Virtualization with KVM and openQRM on Debian, 'Virtualization with Xen and openQRM on Debian' or 'Automated Amazon EC2 Cloud deployments with openQRM on Debian'. That means with this howto we are going to add functionality to an existing openQRM setup. This is to show that openQRM manages all different virtualization and deployment types seamlessly.

Actually this means you can use either use the Install openQRM on Debian, Virtualization with KVM and openQRM on Debian, 'Virtualization with Xen and openQRM on Debian' or 'Automated Amazon EC2 Cloud deployments with openQRM on Debian' howto as starting point.

Set a custom Domain name

Please notice!
Only needed if you haven't start with one of the previous howtos!

As the first step after the openQRM installation and initialization it is recommended to configure a custom domain name for the openQRM management network. In this Use-Case the openQRM Server has the private Class C IP address 192.168.178.5/255.255.255.0 based on the previous 'Howto install openQRM 5.1 on Debian Wheezy' (URL). Since the openQRM management network is a private one any syntactically correct domain name can be used e.g. 'my123cloud.net'. The default domain name pre-configured in the DNS plugin is "oqnet.org".

Best practice is to use the 'openqrm' commandline util to setup the domain name for the DNS plugin. Please login to the openQRM Server system and run the following command as 'root' in a terminal:

/usr/share/openqrm/bin/openqrm boot-service configure -n dns -a default -k OPENQRM_SERVER_DOMAIN -v my123cloud.net

The output of the above command will look like

root@debian:~# /usr/share/openqrm/bin/openqrm boot-service configure -n dns -a default -k OPENQRM_SERVER_DOMAIN -v my123cloud.net
Setting up default Boot-Service Konfiguration of plugin dns
root@debian:~#

To (re)view the current configuration of the DNS plugin please run:

/usr/share/openqrm/bin/openqrm boot-service view -n dns -a default

Enabling Plugins

In the openQRM Plugin Manager please enable and start the following plugins in the sequence below:

  • dns plugin - type Networking
  • dhcpd plugin- type Networking
  • tftpd plugin - type Networking
  • network-manager plugin - type Networking
  • local-server plugin - type Misc
  • device-manager plugin - type Management
  • novnc plugin - type Management
  • sshterm plugin - type Management
  • linuxcoe plugin - type Deployment
  • nfs-storage plugin - type Storage
  • vmware-esx plugin - type Virtualization
Image

Hint: You can use the filter in the plugin list to find plugins by their type easily!

Install VMware ESX on the second system

Install

Network configuration

Install the VMware vSphere Perl SDK on the openQRM server

Login to http://www.vmware.com and download the latest VMware vSphere Perl SDK.

Copy the downloaded file to the openQRM server and run the following commands to unpack and install it:

dpkg --add-architecture i386
apt-get update
apt-get install libarchive-zip-perl libcrypt-ssleay-perl libclass-methodmaker-perl libdata-dump-perl libsoap-lite-perl perl-doc libssl-dev libuuid-perl liburi-perl libxml-libxml-perl

Please notice!
During the VMWare SDK installation the VMWare installer only searchs for Ubuntu in the release file. To succeed the installation on Debian please add the paramter directly on the commandline please running as root:

echo "UBUNTU=ubuntu" >> /etc/os-release

Then unpack the SDK zip-file and run the installer

tar -xzvf VMware-vSphere-Perl-SDK-5.1.0-780721.x86_64.tar.gz
cd vmware-vsphere-cli-distrib/
export http_proxy=
export ftp_proxy=
./vmware-install.pl

During the SDK installation please accept the licence and the default parameters.

Image

Please notice!
Newer libwww-perl versions do not allow any connection or access to self-signed SSL services. While older versions include a switch to allow this via environment parameters newer versions do not include this switch any more. Therefore the VMWare Perl API which is using libwww-perl may bail out with the error "server version unavailable".

To fix this please run the following commands as root on the openQRM server system to install a supported libwww-perl package directly from the CPAN repository:

apt-get remove libwww-perl
rm -rf .cpan
perl -MCPAN -e shell
cpan> install GAAS/libwww-perl-5.837.tar.gz

Autodiscover the VMware ESX Host

Go to Plugins -> Virtualization -> ESX -> Discovery and click on 'Autodiscover ESX Hosts'

Image

The autodiscovery now searches the openQRM management network for existing ESX Hosts.

Image

During the autodiscovery the event list shows an active event to inform about the action running in the background.

Image

Here a screenshot of the discovered ESX Host.

Image

Click on 'Add' to add the ESX Hosts to openQRM data-center repository. In the 'Add' form please provide the admin user credentials to manage the ESX Host. When finished click on 'Submit'

Image

Please notice!
Please make sure to provide the exact hostname PLUS domainname in this form! The VMWare API is really serious that the correct full FQDN is used for the Host configuration.

To re-check the exact domainname configuration of the ESX Host please login to the ESX Console

Image

You can find the configured domainname in the ESX console - Configure Management Network - Custom DNS Suffixes

Image

Here the successful integrated ESX Host.

Image

The integration automatically created a server object from the type ESX Host

Image

Also an ESX Storage object got created automatically

Image

Create a NFS Datastore

To store the Virtual Machine Images and configuration VMWare ESX is using 'Datastore'. Serveral different storage types are supported to be attached to an ESX Host as Datastore e.g. NAS, iSCSI or FC SAN. For this Howto a simple NAS/NFS share is used for the initial Datastore on the ESX Host. To create a NFS share for the Datestore we are using the 'nfs-storage' plugin. First step is to create a new storage object from the type 'nfs-deployment'. Go to Datacenter -> Components -> Storagte -> Add new Storage

Image

Provide a name for the storage object, select 'nfs-deployment' as Deployment Type and choose the openQRM server as resource.

Image

Creating the new storage forwards to the storage overview. Please click on 'Manage' of the new created NFS-Storage Ojbect.

Image

In the Volume overview please click on 'Add new Volume'

Image

Provide a name for the new volume, we choose 'esx_datastore' for this Howto.

Image

Here again the NFS volume overview with the new created volume listed. Now please click on 'Auth' to authenticate the new created NFS share against the ESX Hosts ip.

Image

Fill in the ESX Hosts ip and click on 'Submit'.

Image

Now the NFS volume is correctly authenticated against the ESX Hosts ip.

Image

We are going to attach this NFS share as Datastore to the ESX Host later in this Howto. First we go on with creating a automatic-installation profile with LinuxCOE.

Create a LinuxCOE automatic-installation template

Please notice!
Only needed if you haven't started with the 'Virtualization with KVM and openQRM 5.1 on Debian Wheezy', 'Virtualization with Xen and openQRM 5.1 on Debian Wheezy' or 'Automated Amazon EC2 Cloud deployments with openQRM 5.1 on Debian Wheezy' howto!

The LinuxCOE Project provides a useful UI to create automatic-installation ISO images for various Linux distribution e.g. preseed, kickstart and autoyast. Those ISO images can be then used to fully automatically install a Linux distribution without any manual interaction needed. The integration of LinuxCOE in openQRM makes those automatic-installation ISO images automatically available on all Virtualization Hosts (mounted by nfs at /linuxcoe from the openQRM server). This makes it easy to configure a Virtual Machines installation boot image from the central ISO Pool mount point.

Please notice!
The LinuxCOE plugin in openQRM comes with a fully automatically setup and pre-configuration of LinuxCOE. Since LinuxCOE is an installation-framework it is recommended to add further custom configuration such as local package mirrors, new distribution data and config files etc. Please read more about how to further enhance your LinuxCOE installation at http://linuxcoe.sourceforge.net/#documentation.

First step is to create a new automatic-installation profile and ISO image.

Go to Plugins -> Deployment -> LinuxCOE -> Create Templates and select a Linux distribution and version for the automatic-installation. For this Howto we will use 'Debian Squeeze 64bit'. Please leave the hostname input empty since openQRM will care about this via its dhcpd plugin.

Image

Leave the default settings on the next page of LinuxCOE wizard.

Image

Next please select a Mirror from the list.

Image

Here please provide your custom package setup for the automatic-installation.

Image

On the following page please leave the default settings.

Image

The summary page of the LinuxCOE wizard allows to preconfigure a root and user account. Click on 'Go for it' to create the automatic-installation template.

Image

The ISO image is created. No need to download it since it will be used directly by the VMware ESX Host for a VMware ESX Virtual Machine installation from a central '/linuxcoe-iso' NFS share on the openQRM server.

Image

Go to Plugins -> Deployment -> LinuxCOE -> Template Manager and click on 'Edit'.

Image

Now provide a description for the just created automatic-installation template.

Image

Here the list view of the updated automatic-installation template.

Image

Attach Datastore(s) to the ESX Host

Go to Plugins -> Virtualization -> ESX -> Datastore and select the ESX Host.

Image

In the Datastore overview please click on 'Add new NAS Datastore'.

Image

Here add the previously created NFS Volume as new Datastore. The path for the NFS share is '/exports/esx_datastore'

Image

Now click again 'Add new NAS Datastore'. We are going to add the automatically shared LinuxCOE ISO Pool to the ESX Hosts as another Datastore. This datastore is used to provide ISO Images for Operating Systems installations.

Image

To add the LinuxCOE ISO Pool please provide a name for the datastore, the ip address of the openQRM server and as path '/linuxcoe'

Image

Here again the Datastore overview with the 2 new datastores created.

Image

Configure Networking and VSwitches on the ESX Host

Go to Plugins -> Virtualization -> ESX -> Network and select the ESX Host to add and manage the Virtual Network Switches on the ESX Host.

Image

Create a new VMware ESX Virtual Machine

Use openQRM's Server Wizard to add a new VMware ESX Virtual Machine. This Wizard works in the same way for physical systems, VMware ESX VMs, VMware ESX VMs, Citrix VMware ESXServer VMs, VMware VMs, LXC VMs and openVZ VMs.

Go to Datacenter -> Server -> Add a new Server

Image

Please give a name for the new server. Easiest is to use the 'generate name' button. Also provide a useful description.

Image

In the Resource-Selection please click on 'new resource'. A resource in openQRM is a logical generic object which is mapped to a physical system or Virtual Machine of any type.

Image

On the next page find a selection of different resource types to create. Please choose 'VMware ESX (localboot) Virtual Machine'

Image

This forwards to the VMware ESX Host selection. Please select the VMware ESX Host as the Virtualization Host of the VM

Image

On the VMware ESX Virtual Machine Overview please click on 'Add local VM'

Image

In the VM add form provide a name for the new VM. Again the easiest is to use the 'generate name' button. There are lots of different parameters which can be configured. Anyway you can go with most of the default selection. Please just make sure the first network card of the VM is connected to the 'Default VM Network'

Image

Further down the VM add form please configure the boot sequence of the VM. Select 'iso' and open the Filepicker by clicking on the 'Browse' button. This will open a small new window listing all ISO Images found on the ESX Virtualization Host. Navigate to '/linuxcoe' and select the previously created LinuxCOE automatic-installation iso iamge. Please notice that the name of the iso image may be different in your setup.

Image

Click on 'Submit' to create the new VM

Image

Creating the new VM automatically forwards back into the server wizard with the new created resource available. Select the new resource and 'Submit'

Image

An Image for the new ESX VM got automatically created during the VM creation. Please select the VM Image and click on 'Submit'

Image

Click on 'Submit' to edit the Image description

Image

Add your Image description

Image

The last step in the server wizard presents the full configuration and allows to further setup network, management, monitoring and deployment configuration. Click on 'Submit' to save the server configuration.

Image

The server overview list the new server, not yet activated. Please select the new created server and click on 'Start'

Image

Confirm starting the server

Image

Starting the logical server object triggers to actually start the resource (the VMware ESX VM) with the configured Image (the LVM volume) and triggers additional automatic configuration tasks via a plugin-hook. This server start- and stop hooks are "asking" each activated plugin if there is "some work to do". For a few examples how hooks are used in openQRM please check the list below:

  • The DNS plugin is using those hooks to automatically add (or remove) the server name into the managed bind server
  • The Dhcpd plugin add the "hostname option" for the server to its configuration
  • The Nagios plugin adds/removes service checks for automatic monitoring
  • The Puppet plugin activates configured appliaction recipes to automatically setup and pre-configure services on the VM

Go to Plugins -> Virtualization -> VMware ESX -> VMware ESX VMs and select the VMware ESX Host system.

Image

In the VMware ESX VM overview click on the 'console' button of the VM. This opens a VNC console within your web browser

Image

Please notice!
You need to deactivate the browsers Pop-up Blocker for the openQRM website!

To start the automatic installation please type 'install' in the VNC console and press ENTER.

Image

The VMware ESX VM is now automatically installing a Debian Linux distribution. Good time for you to grab a coffee!

Image

Please notice!
After the automatic installation via the attached LinuxCOE ISO image the VM reboots to the install screen again. We now have to re-configure the VMs boot-sequence to 'local-boot'. To do this please follow the steps below:

Go to Plugins -> Virtualization -> ESX -> Discovery and click on 'Autodiscover ESX Hosts'

- stop the VM in the ESX VM overview - Plugins -> Virtualization -> ESX -> VMs -> select ESX Host + Stop VM
- in Plugins -> Virtualization -> VMware ESX -> VMware ESX VMs select the VMware ESX Host and udate the VM to boot 'local'
- now start the VM again - Plugins -> Virtualization -> ESX -> VMs -> select ESX Host + Start VM

Image
Image

Here a screenshot of the completed Debian installation after setting the boot-sequence of the VM to 'local'

Image

Install the 'openqrm-local-vm-client'

Now it is recommended to install the 'openqrm-local-vm-client' on the fresh installed system. For local-installed Virtual Machines (e.g. xen(local VM), xen(local VM), lxc(local VM), openvz(local VM) which have access to the openQRM network the 'openqrm-local-vm-client' activates the plugin-client-boot-services to allow further management functionality (e.g. application deployment with Puppet, system statistics with Collectd etc). Monitoring and openQRM actions are still running on behalf of the VM Host.

To install the 'openqrm-local-vm-client' on VM please follow the steps below:

Copy the 'openqrm-local-vm-client' utility to the running VM

cd /usr/share/openqrm/plugins/local-server/web/local-vm/
scp openqrm-local-vm-client [ip-address-of-the-VM]:/tmp/

Then login to the VM

ssh [ip-address-of-the-VM]

This prompts for the password which was configured in the LinuxCOE automatic-installation template. Please give the password and execute the openqrm-local-vm-client utility

/tmp/openqrm-local-vm-client

This will automatically setup the 'openqrm-local-vm-client' in the system init and start it.

Full control for KVM, Xen, VMware and Amazon EC2 systems within a single managment console

Here the Datacenter Dashboard after we have created the VMware ESX Virtual Machine

Image

Add more functionalities to your openQRM Setup

To continue and further enhance your openQRM VMware ESX Virtualization Setup there are several things to do:

  • Enable the puppet plugin and automatically deploy your appliactions to your server
  • Enable the highavailability plugin to automatically gain HA for your server
  • Enable the hybrid-cloud plugin to automate your Amazon EC2 and Eucalyptus deployments
  • Enable the cloud plugin for a complete Self-Service deployment of your Server and Software stack to end-users
  • Enable further Virtualization plugins and integrate additional remote Virtulization hosts for a fully distributed Cloud environment
  • Enable further Storage and Deployment plugins to automatically provision your Virtualization Hosts and other physical systems
  • ... and more.

Links