Skip to content

KVM_CRM_configuration

ofwzu4rsuuxh edited this page Sep 8, 2015 · 12 revisions

OVERVIEW OF KVM-CRM

FELIX KVM-based Compute Resource Manager (KVM-CRM) is a KVM-based virtual machine (VM) management software for testbed management. It based on OFELIA Control Framework (OCF). It controls experimentation life-cycle; reservation, instantiation, configuration, monitoring and uninistantiation.

KVM-CRM replaces some of components of XEN-based OCF to use KVM. So the KVM-CRM package provides only a VT manager for KVM (KVM-VT) and KVM-based OXAD (KVM-OXAD). KVM-VT is a master server of KVM-CRM and KVM-OXAD is a KVM agent for virtualization purposes.

INSTALLING KVM-CRM

1. Requirements

  • KVM-VT (VT manager for KVM)
    • One (or more) GNU/Linux Debian-based distros
    • Developed and ensured to work under Debian 7.0 (Wheezy) using the following packages:
      • Python 2.7
      • Django 1.4.19 (automatically installed)
      • MySQL server (automatically installed)
  • KVM-OXAD (KVM agent for virtualization purposes)
    • Ubuntu 14.04 or later
    • Developed and ensured to work under Ubuntu 14.04 (or later) using the following packages:
      • libvirt-bin
      • qemu-kvm
      • Python 2.7
      • Django 1.4.19
      • MySQL server

2. Installing

2.1 Clone the KVM-CRM repository:

mkdir -p /opt/felix/ocf
git clone https://github.com/dana-i2cat/felix.git /opt/felix/ocf
cd /opt/felix/ocf
git checkout kvm-crm

2.2 For KVM-VT: choose the components to install as a root user.

cd /opt/felix/ocf/deploy
python install.py

The following actions will take place:

  • Install dependencies
  • Build Certificates (see Note #1)
  • Configure Apache
  • Set file permissions
  • Modify the localsettings.py or mySettings.py depending on the component being installed
  • Populate database

Note #1: When installing the component, you will need to create the certificates for the Certification Authority (CA) first and for the component later. Do not use the same Common Name (CN) for both of them, and make sure that the CN you use in the component later certificate (you can use an IP) is the same you then set in the SITE_DOMAIN field in the localSettings.py file.

2.3 For KVM-OXAD:

2.3.1 Install packages

apt-get install openssl ssl-cert \
    python-setuptools qemu-kvm libvirt-bin tshark python-libvirt \
    python-setuptools python-mysqldb python-openssl python-m2crypto \
    python-dateutil python-decorator python-paramiko build-essential \
    python-imaging python-configobj python-pyparsing \
    python-lxml python-argparse python-pexpect python-dev libldap2-dev \
    libsasl2-dev libguestfs-tools libpython-stdlib python-pip git
pip install --allow-external django-evolution \
    "django-evolution<=0.6.9" pytz "Django<=1.4.19" \
    "django-extensions<=1.2.5" django-autoslug django-auth-ldap \
    django-registration jinja2

2.3.2 Configure libvirt

  • Open /etc/libvirt/qemu.conf and add (or modify) following parameters:

      user = "root"
      group = "root"
    
  • Restert libvirt-bin

      service libvirt-bin restart
    
  • Create bridge to connect the NICs of user VM

      brctl addbr brx0
      brctl addif brx0 eth0
    

2.3.3 Set up disk image files

2.3.3.1 Create directories for disk image files

Most of directories created in this section should be specified in configuration file (see section 2.3.5)

mkdir -p /mnt/l1vm
# Disk image template folder
mkdir -p /mnt/l1vm/template
# Log folder
mkdir -p /mnt/l1vm/image/log
# Cache folder to store VMs
# It must be same as OXA_FILEHD_CACHE_VMS in configuration file.
mkdir -p /mnt/l1vm/image/cache/vms
# Remote folder to store VMs
# It must be same as OXA_FILEHD_REMOTE_VMS in configuration file.
mkdir -p /mnt/l1vm/image/remote/vms
# Cache folder for templates
# It must be same as OXA_FILEHD_CACHE_TEMPLATES in configuration file.
mkdir -p /mnt/l1vm/image/cache/templates
# Remote folder for templates
# It must be same as OXA_FILEHD_REMOTE_TEMPLATES in configuration file.
mkdir -p /mnt/l1vm/image/remote/templates

2.3.4.2 Generate disk image template

Change directory to /opt/felix/ocf/vt_manager/src/python/agent/utils/generate_template and run generate_template script as root. When finished, a template file l1vm.qcow2 is generated in /mnt/l1vm/template directory.

cd /opt/felix/ocf/vt_manager/src/python/agent/utils/generate_template
./generate_template
Clone this wiki locally