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 bridge-utils vlan \
    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

2.3.5 Create KVM-OXAD configuration files

cd /opt/felix/ocf/vt_manager/src/python/agent/
vi mySettings.py
  • mySettings.py

      ### Section 1: KVM-OXAD settings
      #
      # Basic settings for the KVM-OXAD
      # Settings for virtualization KVM-VT, to which the KVM-OXAD connects
      # VTAM_PORT: it is usually '8445'
      # WARNING: *same* settings as in KVM-VT's 'mySettings.py' file
      VTAM_IP = "172.21.100.137"
      VTAM_PORT = "8445"
      XMLRPC_USER = "root"
      XMLRPC_PASS = "PLEASE_SET_PASSWORD_OF_KVM_VT"
    
      # Password for the KVM-OXAD HTTP XML-RPC server. Use a STRONG password
      XMLRPC_SERVER_PASSWORD = "PLEASE_SET_PASSWORD_OF_KVM_OXAD"
    
      ### Section 2: Optional KVM-OXAD settings
      #
      # Optional settings for the KVM-OXAD.
      # WARNING: default values are commented. Uncomment and modify to override
      # the static settings (file at 'settings/staticSettings.py').
      #
      # Network parameters.
      # XMLRPC_SERVER_LISTEN_HOST: you should not use '' here
      # unless you have a real FQDN.
      # Defaults are as follows.
      ##XMLRPC_SERVER_LISTEN_HOST = "0.0.0.0"
      ##XMLRPC_SERVER_LISTEN_PORT = 9229
    
      # Enable/Disable the usage of cache.
      # Default is True.
      ##OXA_FILEHD_USE_CACHE = True
    
      # Use sparse disks or not while cloning.
      # Uncomment if willing to use Sparse disks.
      # Default is False.
      ##OXA_FILEHD_CREATE_SPARSE_DISK = False
    
      # Define machine SWAP size in MB.
      # Default is 512.
      ##OXA_DEFAULT_SWAP_SIZE_MB = 512
    
      # Level used for logging Agent messages.
      # Possible values = {"DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"}.
      # Default is "WARNING".
      #
      LOG_LEVEL = "DEBUG"
    
      #Template Image File location
      OXA_KVM_DEBIAN_TEMPLATE_IMGFILE="/mnt/l1vm/template/l1vm.qcow2"
      OXA_KVM_UBUNTU_TEMPLATE_IMGFILE="/mnt/l1vm/template/l1vm.qcow2"
    
      ## FileHD driver settings
      # Enable/disable file-type Hdmanager Cache FS
      OXA_FILEHD_USE_CACHE=False
    
      # Cache folder to store VMs (if cache mechanism is used)
      OXA_FILEHD_CACHE_VMS="/mnt/l1vm/image/cache/vms/"
    
      # Remote folder to store VMs
      OXA_FILEHD_REMOTE_VMS="/mnt/l1vm/image/remote/vms/"
    
      # Cache folder for templates (if cache is enabled)
      OXA_FILEHD_CACHE_TEMPLATES="/mnt/l1vm/image/cache/templates/"
    
      # Remote folder for templates
      OXA_FILEHD_REMOTE_TEMPLATES="/mnt/l1vm/image/remote/templates/"
    
      # Use sparse disks while cloning
      OXA_FILEHD_CREATE_SPARSE_DISK=False
    
      # Nice priority for Copy&untar operations
      OXA_FILEHD_NICE_PRIORITY=15
    
      # IONice copy&untar operations class
      OXA_FILEHD_IONICE_CLASS=2
    
      # IONice copy&untar operations priority
      OXA_FILEHD_IONICE_PRIORITY=5
    
      # /bin/dd block size(bs) for copy operations
      OXA_FILEHD_DD_BS_KB=32
    
Clone this wiki locally