Difference between revisions of "Virtualisation with KVM and openQRM on Debian"
(3 intermediate revisions by the same user not shown) | |||
Line 25: | Line 25: | ||
The default domain name pre-configured in the DNS plugin is "oqnet.org". | The default domain name pre-configured in the DNS plugin is "oqnet.org". | ||
− | Best practice is to use the 'openqrm' command line util to setup the domain name for the DNS plugin. | + | Best practice is to use the 'openqrm' command line util to setup the domain name for the DNS plugin. Login to the openQRM Server system and run the following command as 'root' in a terminal: |
<code>/usr/share/openqrm/bin/openqrm boot-service configure -n dns -a default -k OPENQRM_SERVER_DOMAIN -v my123cloud.net</code> | <code>/usr/share/openqrm/bin/openqrm boot-service configure -n dns -a default -k OPENQRM_SERVER_DOMAIN -v my123cloud.net</code> | ||
Line 37: | Line 37: | ||
<code>root@debian:~#</code> | <code>root@debian:~#</code> | ||
− | To review the current configuration of the DNS plugin | + | To review the current configuration of the DNS plugin run: |
<code>/usr/share/openqrm/bin/openqrm boot-service view -n dns -a default</code> | <code>/usr/share/openqrm/bin/openqrm boot-service view -n dns -a default</code> | ||
Line 43: | Line 43: | ||
=== Enabling Plugins === | === Enabling Plugins === | ||
[[File:Csm 01-openqrm-kvm df20b9d608.png|none|thumb|390x390px|Hint: You can use the filter in the plugin list to find plugins by their type easily!]] | [[File:Csm 01-openqrm-kvm df20b9d608.png|none|thumb|390x390px|Hint: You can use the filter in the plugin list to find plugins by their type easily!]] | ||
− | In the openQRM Plugin Manager | + | In the openQRM Plugin Manager, enable and start the following plugins in the sequence below: |
* dns plugin ''- type Networking'' | * dns plugin ''- type Networking'' | ||
* dhcpd plugin - ''type Networking'' | * dhcpd plugin - ''type Networking'' | ||
Line 80: | Line 80: | ||
Now click on 'Add new Volume group' | Now click on 'Add new Volume group' | ||
[[File:Csm 09-openqrm-kvm 568ced84c5.png|none|thumb|390x390px|Add new volume group]] | [[File:Csm 09-openqrm-kvm 568ced84c5.png|none|thumb|390x390px|Add new volume group]] | ||
− | When you have followed the initial '[[Install openQRM on Debian|How-To install openQRM 5.1 on Debian Wheezy]]' How-To, there is now a dedicated ''/dev/sda3'' partition available which can be used to create a LVM Volume group. | + | When you have followed the initial '[[Install openQRM on Debian|How-To install openQRM 5.1 on Debian Wheezy]]' How-To, there is now a dedicated ''/dev/sda3'' partition available which can be used to create a LVM Volume group. Provide a name for the LVM Volume group (here 'kvmvg'), select the ''/dev/sda3'' device and submit. |
[[File:Csm 10-openqrm-kvm 333ace4dec.png|none|thumb|390x390px|Add new Volume Group]] | [[File:Csm 10-openqrm-kvm 333ace4dec.png|none|thumb|390x390px|Add new Volume Group]] | ||
Confirm to create the new Volume group | Confirm to create the new Volume group | ||
Line 92: | Line 92: | ||
Go to '''Datacentre -> Server''' and click on 'Edit' of the openQRM server object | Go to '''Datacentre -> Server''' and click on 'Edit' of the openQRM server object | ||
[[File:Csm 13-openqrm-kvm 3bcdc0a64d.png|none|thumb|390x390px|Click on 'edit']] | [[File:Csm 13-openqrm-kvm 3bcdc0a64d.png|none|thumb|390x390px|Click on 'edit']] | ||
− | In the server edit section | + | In the server edit section select '''Network -> Network Manager.''' |
[[File:Csm 14-openqrm-kvm 58f701411b.png|none|thumb|390x390px|Network manager]] | [[File:Csm 14-openqrm-kvm 58f701411b.png|none|thumb|390x390px|Network manager]] | ||
This will provide a list of all available network interfaces on the system | This will provide a list of all available network interfaces on the system | ||
Line 100: | Line 100: | ||
The system automatically checks if the system utilities for the bridge and network functionalities are available. If not, openQRM triggers to automatically install them via the distribution package manager. This may delay the first time the command is executed on the system. | The system automatically checks if the system utilities for the bridge and network functionalities are available. If not, openQRM triggers to automatically install them via the distribution package manager. This may delay the first time the command is executed on the system. | ||
− | + | Click on 'Add new network bridge' to create a new network bridge | |
[[File:Csm 16-openqrm-kvm 5664b3d179.png|none|thumb|390x390px|Create a new bridge]] | [[File:Csm 16-openqrm-kvm 5664b3d179.png|none|thumb|390x390px|Create a new bridge]] | ||
Fill in 'br0' as the bridge name, select eth0 (the openQRM Management network interface) and insert the same IP configuration as for eth0. In this How-To, the IP 192.168.178.5/255.255.255.0 is used with a default gateway 192.168.178.1. Then click on submit to create the new network bridge. | Fill in 'br0' as the bridge name, select eth0 (the openQRM Management network interface) and insert the same IP configuration as for eth0. In this How-To, the IP 192.168.178.5/255.255.255.0 is used with a default gateway 192.168.178.1. Then click on submit to create the new network bridge. | ||
Line 114: | Line 114: | ||
'''NOTE:''' | '''NOTE:''' | ||
− | 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. | + | 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. Read more about how to further enhance your LinuxCOE installation at <nowiki>http://linuxcoe.sourceforge.net/#documentation</nowiki> |
First step is to create a new automatic-installation profile and ISO image. | 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 How-To we will use 'Debian Squeeze 64bit'. | + | Go to '''Plugins -> Deployment -> LinuxCOE -> Create Templates''' and select a Linux distribution and version for the automatic-installation. For this How-To we will use 'Debian Squeeze 64bit'. Leave the hostname input empty since openQRM will care about this via its dhcpd plugin. |
[[File:Csm 18-openqrm-kvm bfe5a6a990.png|none|thumb|390x390px|Use 'Debian Squeeze 64bit']] | [[File:Csm 18-openqrm-kvm bfe5a6a990.png|none|thumb|390x390px|Use 'Debian Squeeze 64bit']] | ||
Leave the default settings on the next page of LinuxCOE wizard. | Leave the default settings on the next page of LinuxCOE wizard. | ||
Line 126: | Line 126: | ||
Here, provide your custom package setup for the automatic-installation. | Here, provide your custom package setup for the automatic-installation. | ||
[[File:Csm 21-openqrm-kvm 3317a2bbb5.png|none|thumb|390x390px|Provide custom package setup]] | [[File:Csm 21-openqrm-kvm 3317a2bbb5.png|none|thumb|390x390px|Provide custom package setup]] | ||
− | On the following page | + | On the following page leave the default settings |
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. | 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. | ||
Line 145: | Line 145: | ||
Go to '''Datacenter -> Server -> Add a new Server''' | Go to '''Datacenter -> Server -> Add a new Server''' | ||
− | + | Give a name for the new server. Easiest is to use the 'generate name' button. Also provide a useful description. | |
[[File:Csm 28-openqrm-kvm 8c5381275c.png|none|thumb|390x390px|Provide a name and description]] | [[File:Csm 28-openqrm-kvm 8c5381275c.png|none|thumb|390x390px|Provide a name and description]] | ||
− | In the Resource-Selection | + | In the Resource-Selection, 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. |
[[File:Csm 29-openqrm-kvm 6b6f96943a.png|none|thumb|390x390px|Click 'New Resource']] | [[File:Csm 29-openqrm-kvm 6b6f96943a.png|none|thumb|390x390px|Click 'New Resource']] | ||
− | On the next page find a selection of different resource types to create. | + | On the next page find a selection of different resource types to create. Choose 'KVM (localboot) Virtual Machine' |
[[File:Csm 30-openqrm-kvm b974b8c45b.png|none|thumb|390x390px|Choose 'KVM (localboot) Virtual Machine']] | [[File:Csm 30-openqrm-kvm b974b8c45b.png|none|thumb|390x390px|Choose 'KVM (localboot) Virtual Machine']] | ||
− | This forwards to the KVM Host selection. | + | This forwards to the KVM Host selection. Select the openQRM server for the Virtualization Host of the VM to create |
[[File:Csm 31-openqrm-kvm 3571dd52f4.png|none|thumb|390x390px|Select the openQRM server]] | [[File:Csm 31-openqrm-kvm 3571dd52f4.png|none|thumb|390x390px|Select the openQRM server]] | ||
− | On the KVM Virtual Machine Overview | + | On the KVM Virtual Machine Overview click on 'Add local VM' |
[[File:Csm 32-openqrm-kvm bd73a87977.png|none|thumb|390x390px|Click on 'Add local VM']] | [[File:Csm 32-openqrm-kvm bd73a87977.png|none|thumb|390x390px|Click on 'Add local VM']] | ||
− | 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. | + | 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. Just make sure the first network card of the VM is connected to the previously created bridge 'br0' |
[[File:Csm 33-openqrm-kvm 2443e46725.png|none|thumb|390x390px|Leave configurations as default]] | [[File:Csm 33-openqrm-kvm 2443e46725.png|none|thumb|390x390px|Leave configurations as default]] | ||
− | Further down the VM add form | + | Further down the VM add form, 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 the filesystem of the Virtualization Host. Navigate to '/linuxcoe' and select the previously created LinuxCOE automatic-installation iso image. Not that the name of the iso image may be different in your setup. |
[[File:Csm 34-openqrm-kvm 983d00dabf.png|none|thumb|390x390px|Configure the boot sequence]] | [[File:Csm 34-openqrm-kvm 983d00dabf.png|none|thumb|390x390px|Configure the boot sequence]] | ||
− | Also | + | Also do not forget to set a VNC password to be able to connect to the VM console later. Then click on 'Submit' |
[[File:Csm 35-openqrm-kvm 2a87849b54.png|none|thumb|390x390px|Click on 'Submit']] | [[File:Csm 35-openqrm-kvm 2a87849b54.png|none|thumb|390x390px|Click on 'Submit']] | ||
Creating the new VM automatically forwards back into the server wizard with the new created resource available. Select the new resource and 'Submit' | Creating the new VM automatically forwards back into the server wizard with the new created resource available. Select the new resource and 'Submit' | ||
Line 165: | Line 165: | ||
We haven't created an Image for the Virtual Machine yet. An Image in openQRM is a logical and generic object which is mapped to the physical volumes of different storage types. So click on 'New Image' | We haven't created an Image for the Virtual Machine yet. An Image in openQRM is a logical and generic object which is mapped to the physical volumes of different storage types. So click on 'New Image' | ||
[[File:Csm 37-openqrm-kvm 80dc20e0fd.png|none|thumb|390x390px|Click 'New Image']] | [[File:Csm 37-openqrm-kvm 80dc20e0fd.png|none|thumb|390x390px|Click 'New Image']] | ||
− | Adding a new Image forwards to the Image type selection. | + | Adding a new Image forwards to the Image type selection. Select 'LVM deployment for KVM volume' |
− | + | [[File:Csm 38-openqrm-kvm b36edc8860.png|none|thumb|390x390px|Select 'LVM deployment for KVM volume]] | |
− | In the storage server selection | + | In the storage server selection, select the 'openqrm-lvm' storage object |
− | + | [[File:Csm 39-openqrm-kvm 94c3cede17.png|none|thumb|390x390px|Select the 'openqrm-lvm' storage object]] | |
Then select the 'kvmvg' LVM volume group | Then select the 'kvmvg' LVM volume group | ||
− | + | [[File:Csm 40-openqrm-kvm fdd8d697d4.png|none|thumb|390x390px|Select the 'kvmvg' LVM volume group]] | |
− | |||
− | |||
In the LVM volume overview click on 'Add new logical volume' | In the LVM volume overview click on 'Add new logical volume' | ||
− | + | [[File:Csm 41-openqrm-kvm 58fb823511.png|none|thumb|390x390px|Click on 'Add new logical volume']] | |
Provide a name and size (in MB) for the new volume. Again the easiest is to use the 'generate name' button. Then 'Submit' | Provide a name and size (in MB) for the new volume. Again the easiest is to use the 'generate name' button. Then 'Submit' | ||
− | + | [[File:Csm 42-openqrm-kvm 20f8b479b9.png|none|thumb|390x390px|Provide a name and size]] | |
Creating the new Image automatically forwards back into the server wizard with the new created image available. Select the new image and 'Submit' | Creating the new Image automatically forwards back into the server wizard with the new created image available. Select the new image and 'Submit' | ||
− | + | [[File:Csm 43-openqrm-kvm 409d7839a8.png|none|thumb|390x390px|Select the new image and 'Submit']] | |
Click on 'Submit' to edit the Image parameter | Click on 'Submit' to edit the Image parameter | ||
− | + | [[File:Csm 44-openqrm-kvm 6378d0667c.png|none|thumb|390x390px|Edit the Image parameter]] | |
− | This following step allows to edit further Image | + | This following step allows to edit further Image parameters e.g. setting a root password |
− | + | [[File:Csm 45-openqrm-kvm 54a1fcd7e8.png|none|thumb|390x390px|Edit further Image parameters]] | |
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. | 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. | ||
− | + | [[File:Csm 46-openqrm-kvm c0f6dfd0a7.png|none|thumb|390x390px|Click on 'Submit' to save the server configuration]] | |
− | The server overview list the new server, not yet activated. | + | The server overview list the new server, not yet activated. Select the new created server and click on 'Start' |
− | + | [[File:Csm 47-openqrm-kvm 1ffe64659f.png|none|thumb|390x390px|Select the new created server and click on 'Start']] | |
Confirm starting the server | Confirm starting the server | ||
− | + | [[File:Csm 48-openqrm-kvm 56cba9c134.png|none|thumb|390x390px|Confirm starting the server]] | |
− | Started the new server, now marked as 'active'. Starting the logical server object triggers to actually start the resource (the KVM VM) with the configured Image (the LVM volume) and triggers additional automatic configuration tasks via a plugin-hook. This server start | + | Started the new server, now marked as 'active'. Starting the logical server object triggers to actually start the resource (the KVM 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 checking each activated plugin if there is work to do. For a few examples how hooks are used in openQRM 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 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 Dhcpd plugin add the "hostname option" for the server to its configuration | ||
* The Nagios plugin adds/removes service checks for automatic monitoring | * The Nagios plugin adds/removes service checks for automatic monitoring | ||
− | * The Puppet plugin activates configured | + | * The Puppet plugin activates configured application recipes to automatically setup and pre-configure services on the VM |
− | + | Go to '''Plugins -> Virtualization -> KVM -> KVM VMs''' and select the openQRM server. In the KVM VM overview click on the 'console' button of the VM. This opens a VNC console within your web browser | |
− | Go to Plugins -> Virtualization -> KVM -> KVM VMs and select the openQRM server. In the KVM VM overview click on the 'console' button of the VM. This opens a VNC console within your web browser | ||
− | |||
− | |||
− | + | '''NOTE:''' You need to deactivate the browsers Pop-up Blocker for the openQRM website! | |
− | + | To start the automatic installation, type 'install' in the VNC console and press ENTER. | |
+ | [[File:Csm 50-openqrm-kvm 3a278f2118.png|none|thumb|390x390px|Type 'install' in the VNC console and press ENTER. ]] | ||
+ | The KVM VM is now automatically installing a Debian Linux distribution. This may take a while | ||
+ | [[File:Csm 51-openqrm-kvm 601ac4408e.png|none|thumb|390x390px|Installing a Debian Linux distribution]] | ||
+ | '''NOTE:''' 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, follow the steps below: | |
− | + | * Stop the VM by stopping its server object - '''Datacentre -> Server -> Select + Stop''' | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | * | ||
* The stop hook now halts the VM by sending a ACPI-Shutdown Signal to the VMs KVM monitor socket. Since in this stage there is now ACPI service running on the VM the stop action will "force-stop" the VM. This will result in a warning via an error event which can be ignored. | * The stop hook now halts the VM by sending a ACPI-Shutdown Signal to the VMs KVM monitor socket. Since in this stage there is now ACPI service running on the VM the stop action will "force-stop" the VM. This will result in a warning via an error event which can be ignored. | ||
− | * | + | * In '''Plugins -> Virtualization -> KVM -> KVM VMs''' select the KVM Host and update the VM to boot 'local' |
− | * | + | * Now start the VM again by starting its server object - '''Datacentre -> Server -> Select + Start''' |
Here a screenshot of the completed Debian installation after setting the boot-sequence of the VM to 'local' | Here a screenshot of the completed Debian installation after setting the boot-sequence of the VM to 'local' | ||
+ | [[File:Csm 52-openqrm-kvm 21ffd515db.png|none|thumb|390x390px|Completed Debian installation]] | ||
=== Install the 'openqrm-local-vm-client' === | === 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. kvm(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. | Now it is recommended to install the 'openqrm-local-vm-client' on the fresh installed system. For local-installed Virtual Machines (e.g. kvm(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. | ||
− | The 'openqrm-local-vm-client' also automatically makes sure that the 'acpi-support/acpid' package is installed to enable the reboot/restart functionalities of KVM via the VM monitor socket. To install the 'openqrm-local-vm-client' on VM | + | The 'openqrm-local-vm-client' also automatically makes sure that the 'acpi-support/acpid' package is installed to enable the reboot/restart functionalities of KVM via the VM monitor socket. To install the 'openqrm-local-vm-client' on VM, follow the steps below: |
− | + | Copy the 'openqrm-local-vm-client' utility to the running VM | |
− | scp openqrm-local-vm-client [ip-address-of-the-VM]:/tmp/ | + | <code>scp openqrm-local-vm-client [ip-address-of-the-VM]:/tmp/</code> |
− | + | Then login to the VM | |
− | ssh [ip-address-of-the-VM] | + | <code>ssh [ip-address-of-the-VM]</code> |
− | + | This prompts for the password which was configured in the LinuxCOE automatic-installation template. Give the password and execute the openqrm-local-vm-client utility | |
− | /tmp/openqrm-local-vm-client | + | <code>/tmp/openqrm-local-vm-client</code> |
This will automatically setup the 'openqrm-local-vm-client' in the system init and start it. | This will automatically setup the 'openqrm-local-vm-client' in the system init and start it. | ||
=== Create additional KVM VMs by cloning/snapshotting the Volume === | === Create additional KVM VMs by cloning/snapshotting the Volume === | ||
− | Go to Plugins -> Virtualization -> KVM -> KVM Volumes and select the 'openqrm-lvm' storage object. Then choose the 'kvmvg' logical volume group to get a list of all available LVM volumes. | + | Go to '''Plugins -> Virtualization -> KVM -> KVM Volumes''' and select the 'openqrm-lvm' storage object. Then choose the 'kvmvg' logical volume group to get a list of all available LVM volumes. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | In this view you can use the 'clone' or 'snap' action to clone or snapshot existing, installed KVM LVM Volumes. The 'clone' action creates a new logical volume and copies the content of the origin over. Snapshotting is using the "copy-on-write" mechanism of LVM which is much more efficient. Actually, a deployed snapshot of a KVM LVM Volume just stores the changes compared to its origin. That means that creating snapshots e.g. per user allows to 'just' store the data which is different per user. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | '''Congratulations!''' | |
− | + | You have successfully completed this openQRM How-To! | |
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 10:34, 10 December 2020
This How-To explains how to create and manage KVM Virtual Machines on Debian with openQRM
Requirements
- One physical Server
- at least 1 GB of Memory
- at least 100 GB of Diskspace
- VT (Virtualization Technology) enabled in the Systems BIOS so that the openQRM Server can run KVM Virtual Machines later
- A minimal Debian installation on a physical Server
- openQRM installed
NOTE:
For this How-To, we assume you have successfully installed openQRM and have at least referenced our Cloud Computing with openQRM on Debian How-To before. If not, it is highly suggested to complete both before continuing
Set a custom Domain name
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 install openQRM on Debian How-To. 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' command line util to setup the domain name for the DNS plugin. 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 Configuration of plugin dns
root@debian:~#
To review the current configuration of the DNS plugin run:
/usr/share/openqrm/bin/openqrm boot-service view -n dns -a default
Enabling Plugins
In the openQRM Plugin Manager, 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
- kvm plugin - type Virtualization
Create the Virtualization Host Object
Go to Datacenter -> Server -> Add a new Server
Enter 'openqrm' as the server name and provide a descriptive description
Select the openQRM Server resource
In the following Edit dialog, set 'KVM Host' as the Virtualization type of this server, then submit to save
This is the Server list after adding the Virtualization Host Object.
Additionally 2 KVM Storage Objects are automatically created to manage different types of VM volumes
Create a LVM Volume Group
The KVM Storage type with the best flexibility regarding volume management is 'KVM LVM Storage'. Each VM gets its own dedicated logical volume as its root image. Alternatively 'KVM Blockfile Storage' can be used. Volumes for this storage type are created on the Hosts filesystem via the qemu-img command. This How-To describes the 'KVM LVM Storage' type.
Go to Datacenter -> Storage and click on the 'manage' button of the 'openqrm-lvm' storage object
NOTE:
The system automatically checks if the system utilities for the LVM functionalities are available. If not it openQRM triggers to automatically install them via the distribution package manager. This may delay the first time the command is executed on the system.
Now click on 'Add new Volume group'
When you have followed the initial 'How-To install openQRM 5.1 on Debian Wheezy' How-To, there is now a dedicated /dev/sda3 partition available which can be used to create a LVM Volume group. Provide a name for the LVM Volume group (here 'kvmvg'), select the /dev/sda3 device and submit.
Confirm to create the new Volume group
The LVM Volume group to store the VM Images is created now
Create one or more network bridges
The KVM Virtualization technology uses network bridges to connect the Virtual Machines virtualised network interfaces to real networks.
Go to Datacentre -> Server and click on 'Edit' of the openQRM server object
In the server edit section select Network -> Network Manager.
This will provide a list of all available network interfaces on the system
NOTE:
The system automatically checks if the system utilities for the bridge and network functionalities are available. If not, openQRM triggers to automatically install them via the distribution package manager. This may delay the first time the command is executed on the system.
Click on 'Add new network bridge' to create a new network bridge
Fill in 'br0' as the bridge name, select eth0 (the openQRM Management network interface) and insert the same IP configuration as for eth0. In this How-To, the IP 192.168.178.5/255.255.255.0 is used with a default gateway 192.168.178.1. Then click on submit to create the new network bridge.
Here a screenshot of the network interface list after creating the new network bridge 'br0'.
Create a LinuxCOE automatic-installation template
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.
NOTE:
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. 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 How-To we will use 'Debian Squeeze 64bit'. Leave the hostname input empty since openQRM will care about this via its dhcpd plugin.
Leave the default settings on the next page of LinuxCOE wizard.
Next, select a Mirror from the list.
Here, provide your custom package setup for the automatic-installation.
On the following page leave the default settings
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.
The ISO image is created. No need to download it since it will be used for a KVM Virtual Machine installation on the openQRM server.
Go to Plugins -> Deployment -> LinuxCOE -> Template Manager and click on 'Edit'.
Now provide a description for the just created automatic-installation template.
Here the list view of the updated automatic-installation template.
Create a new KVM Virtual Machine
Use openQRM's Server Wizard to add a new KVM Virtual Machine. This Wizard works in the same way for physical systems, KVM VMs, Xen VMs, Citrix XenServer VMs, VMware VMs, LXC VMs and openVZ VMs.
Go to Datacenter -> Server -> Add a new Server
Give a name for the new server. Easiest is to use the 'generate name' button. Also provide a useful description.
In the Resource-Selection, 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.
On the next page find a selection of different resource types to create. Choose 'KVM (localboot) Virtual Machine'
This forwards to the KVM Host selection. Select the openQRM server for the Virtualization Host of the VM to create
On the KVM Virtual Machine Overview click on 'Add local VM'
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. Just make sure the first network card of the VM is connected to the previously created bridge 'br0'
Further down the VM add form, 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 the filesystem of the Virtualization Host. Navigate to '/linuxcoe' and select the previously created LinuxCOE automatic-installation iso image. Not that the name of the iso image may be different in your setup.
Also do not forget to set a VNC password to be able to connect to the VM console later. Then click on 'Submit'
Creating the new VM automatically forwards back into the server wizard with the new created resource available. Select the new resource and 'Submit'
We haven't created an Image for the Virtual Machine yet. An Image in openQRM is a logical and generic object which is mapped to the physical volumes of different storage types. So click on 'New Image'
Adding a new Image forwards to the Image type selection. Select 'LVM deployment for KVM volume'
In the storage server selection, select the 'openqrm-lvm' storage object
Then select the 'kvmvg' LVM volume group
In the LVM volume overview click on 'Add new logical volume'
Provide a name and size (in MB) for the new volume. Again the easiest is to use the 'generate name' button. Then 'Submit'
Creating the new Image automatically forwards back into the server wizard with the new created image available. Select the new image and 'Submit'
Click on 'Submit' to edit the Image parameter
This following step allows to edit further Image parameters e.g. setting a root password
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.
The server overview list the new server, not yet activated. Select the new created server and click on 'Start'
Confirm starting the server
Started the new server, now marked as 'active'. Starting the logical server object triggers to actually start the resource (the KVM 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 checking each activated plugin if there is work to do. For a few examples how hooks are used in openQRM 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 application recipes to automatically setup and pre-configure services on the VM
Go to Plugins -> Virtualization -> KVM -> KVM VMs and select the openQRM server. In the KVM VM overview click on the 'console' button of the VM. This opens a VNC console within your web browser
NOTE: You need to deactivate the browsers Pop-up Blocker for the openQRM website!
To start the automatic installation, type 'install' in the VNC console and press ENTER.
The KVM VM is now automatically installing a Debian Linux distribution. This may take a while
NOTE: 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, follow the steps below:
- Stop the VM by stopping its server object - Datacentre -> Server -> Select + Stop
- The stop hook now halts the VM by sending a ACPI-Shutdown Signal to the VMs KVM monitor socket. Since in this stage there is now ACPI service running on the VM the stop action will "force-stop" the VM. This will result in a warning via an error event which can be ignored.
- In Plugins -> Virtualization -> KVM -> KVM VMs select the KVM Host and update the VM to boot 'local'
- Now start the VM again by starting its server object - Datacentre -> Server -> Select + Start
Here a screenshot of the completed Debian installation after setting the boot-sequence of the VM to 'local'
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. kvm(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.
The 'openqrm-local-vm-client' also automatically makes sure that the 'acpi-support/acpid' package is installed to enable the reboot/restart functionalities of KVM via the VM monitor socket. To install the 'openqrm-local-vm-client' on VM, follow the steps below:
Copy the 'openqrm-local-vm-client' utility to the running 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. 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.
Create additional KVM VMs by cloning/snapshotting the Volume
Go to Plugins -> Virtualization -> KVM -> KVM Volumes and select the 'openqrm-lvm' storage object. Then choose the 'kvmvg' logical volume group to get a list of all available LVM volumes.
In this view you can use the 'clone' or 'snap' action to clone or snapshot existing, installed KVM LVM Volumes. The 'clone' action creates a new logical volume and copies the content of the origin over. Snapshotting is using the "copy-on-write" mechanism of LVM which is much more efficient. Actually, a deployed snapshot of a KVM LVM Volume just stores the changes compared to its origin. That means that creating snapshots e.g. per user allows to 'just' store the data which is different per user.
Congratulations!
You have successfully completed this openQRM How-To!