You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

Build disk image

First, we need to build a disk image of the VM. Information on how to build a disk image in detail is available here for a Yocto VM, or here for a Debian VM.

Configuration

The inventory may define these hosts to run:

  • hypervisors: Set of hosts to launch virtual machines

Hypervisor

The project use the KVM hypervisor to virtualize machines.

RADOS Block Device

libvirt will automatically detect the RBD and create a pool with this option --enable-rbd. The found resources can be used to launch a VM (if it's an image for a virtual machine).

Components of VM

Each components of VM should have a VirtIO interface (like the network and the disk). This reduces problems with the virtual hardware.

Some examples are available here.

Troubleshooting
Bootloader

If the VM is in UEFI mode, it's possible that it doesn't boot because the firmware is not the same. Follow this steps:

  1. Boot the machine on the cluster
  2. Re-install the bootloader
  3. Update the bootloader configuration

Deployment of VM with Ansible

The playbook ansible/playbooks/cluster_setup_deploy_vms.yaml is used to deploy a virtual machine. There is an ansible library (ansible/library/cluster_vm.py) to wrap vm_manager.

Configuration

The inventory must define these hosts to run this step:

  • VMs: Sets of hosts to launch on hypervisors

Before starting, make sure there is enough space in /home and /tmp.

Manage VM on the cluster

  • Add VM in the cluster:

    vm-mgr create --name NAME --xml /path/to/configuration.xml --image /path/to/disk.qcow2 --disable --force --enable-live-migration --migration-user virtu --migrate-to-timeout 180
  • Check the execution of the resource:

    crm status
  • Get the status of the resource:

    vm-mgr status --name NAME
  • Delete VM in the cluster:

    vm-mgr remove --name NAME

VM configuration

The official documentation on the XML format of libvirt is here.

Resources

On the XML configuration of a virtual machine, the resource can be specified to know which slice should be used (more details here). So, the virtual machine will only have acces to the CPU associated with the slice.

Possible values:

  • /machine/nort
  • /machine/rt

Example, for a virtual machine with the real-time:

<resource>
    <partition>/machine/rt</partition>
</resource>

CPU tunning

In the project, this element will be used to limite the virtual machine (more details here).

  • The emulatorpin element specifies which of host physical CPUs the emulator, a subset of a domain not including vCPU or iothreads will be pinned to.
  • The vcpupin element specifies which of host's physical CPUs the domain vCPU will be pinned to. It's used to reserved one or more CPUs for a critical virtual machine. So, it's important not use this CPU on another VM.
  • The vcpusched element specifies the scheduler type for a particular vCPU. A priority can be setting. In the project, all values greats than 10, it's for the host; equals to 10, it's for the RCU and less than 10, it's to set the priority of the RT vCPU among themselves.
  • No labels