Skip to content

oVirt 4

Henryk Paluch edited this page May 1, 2018 · 22 revisions

oVirt is virtualization backed by RedHat (some people say that it is Open Source vCenter, but be rather alert).

oVirt consists of:

  • one Engine node that contains all management software and web portal and database
  • Nodes - there are run virtual machines (VMs). Nodes are managed primarily using daemons called VDSM. There are two VDSM daemons for security reasons:
    • vdsmd.service is main unprivileged VSDM
    • supervdsmd.service is running as root and is called by VDSM for privileged tasks (mounting filesystems etc.)
  • Recommended: shared storage (NFS, iSCSI, FC...) for ISOs and VMs. Shared storage is the only options supported in clusters. But for single host you can still use Local storage with some gotchas...

Local storage requirements:

  • be sure to have at least 2 empty disk partitions formatted to supported filesystem - I used ext4
    • partition use as ISO type for installation isos
    • partition use as Data type for VM data (is it correct?)

My sample setup is:

  • ovirt-mng.example.com - oVirt Engine. Run as VM in VirtualBox. Installed in top of CentOS 7.4, 1x CPU, 1.8GB RAM (because of host PC constraints), 8GB swap, 60GB VirtualDisk (currently used ~6GB). Installed using guide on https://www.ovirt.org/documentation/quickstart/quickstart-guide/#install-ovirt-engine
  • ovirt-node1.example.com - oVirt Node with local storage. Installed on bare metal AMD X2, 6GB RAM, 200GB SATA disk. Again CentOS 7.4 (with EPEL's forcedeth network driver - see Missing-NVidia-Network-driver). Prepared using guide on https://www.ovirt.org/documentation/install-guide/chap-Enterprise_Linux_Hosts/ I used following partition layout - GPT:
    • biosdev boot 1MB (compatibility layer to allow old MBR based BIOS to boot from GPT disk)
    • /boot, ext4, 1GB
    • LVM, swap, 8GB
    • LVM, /, 50GB for node installation
    • LVM, /mnt/vms, 90GB for future VMS (on storage setup this partition must be un-mounted and removed from /etc/fstab)
    • LVM, /mnt/isos, 40GB for future ISO library (on storage setup this partition must be un-mounted and removed from /etc/fstab)

Timekeeping:

  • please ensure that all your hosts have proper time
  • you can set Local system clock in CentOS 7 using:
    timedatectl set-local-rtc true

Setup outline:

  • oVirt Engine install:

    • installed CentOS 7.4 for oVirt Engine in VirtualBox
    • added host entries to /etc/hosts, double checked hostnames, using hostnamectl set-hostname for fix
    • disabled setlinux in /etc/sysconfig/selinux
    • prepare for setup:
      yum update -y
      init 6 # rebooting new kernel
      yum install http://resources.ovirt.org/pub/yum-repo/ovirt-release42.rpm
      yum -y install ovirt-engine
    • recommended: Snapshot of VM, or even export - for easy rebuild
    • run engine-setup to create oVirt portal
  • oVirt Node install

    • installed CentOS 7.4 for oVirt Engine on bare-metal Hardware
    • added host entries to /etc/hosts, double checked hostnames, using hostnamectl set-hostname for fix
    • disabled setlinux in /etc/sysconfig/selinux
    • preparing for host addition:
      yum update -y
      init 6 # rebooting new kernel
      yum install http://resources.ovirt.org/pub/yum-repo/ovirt-release42.rpm
  • Adding my new Host ovirt-node1.example.com in oVirt portal

    • TIP: You can go to Events menu in oVirt portal to to see detailed progress of adding New Host
  • Creating two basic storages (Warning! Data must be created first! It's the only option in beginning):

  • Create Local Data storage on Host ovirt-node1: I did following preparation on ovirt-node1:

    df /mnt/vms # note mount point
       /dev/mapper/centos_ovirt--node1-mnt_vms
    chown vdsm:kvm /mnt/vms/
    umount /mnt/vms
    vi /etc/fstab # comment out line with `/mnt/vms`

    In oVirt portal specify following on storage creation:

    • Storage type: POSIX compliant FS
    • Path: /dev/mapper/centos_ovirt--node1-mnt_vms
    • VFS Type: ext4
    • Name: node1-vms
    • Try OK - oh now it works!
    • Wait until your storage become Active
  • Create Local ISO storage on Host ovirt-node1 - similar setup:

    df /mnt/isos # note mount point
       /dev/mapper/centos_ovirt--node1-mnt_isos ...
    chown vdsm:kvm /mnt/isos/
    umount /mnt/isos
    vi /etc/fstab # comment out line with `/mnt/isos`
    In _oVirt portal_ specify following on storage creation:
    - Domain Function: `ISO` - do not forget this!!!
    - Storage type: `POSIX compliant FS`
    - Path: `/dev/mapper/centos_ovirt--node1-mnt_isos`
    - VFS Type: `ext4`
    - Name: `node1-isos`
    * Try OK - oh now it works!
    * Wait until your storage become _Active_
    
  • Upload CentOS 7.4 install ISO to Local ISO storage - because of bugs bellow use directly SCP - upload your CentOS ISO (for example CentOS-7-x86_64-Minimal-1708.iso) to /rhev/data-center/mnt/_dev_mapper_centos__ovirt--node1-mnt__isos/fcad81a3-e9fa-4730-903c-6b9be46ee31b/images/11111111-1111-1111-1111-111111111111/ on ovirt-node1. (Warning! you path may differ a bit)

  • verify that install ISO is visible in portal:

    • click on Storage -> Domain
    • click on your ISO domain (in my case node1-isos
    • click on Images
    • Voilà! I can see my CentOS iso there.
  • Create first VM with CentOS 7.4 - in portal:

    • click on Compute -> Virtual Machines
    • click on New
    • fill in at least:
      • Operating system: RedHat Enteprise Linux 7.x (x64)
      • Optimized for: Server
      • Name: centos7 (required field)
      • nic1: select the only options (in my case ovirtmgmt/ovirtmgmt)
      • Instance Images click on Create:
        • Size(GB): enter 10 for example.
        • Alias: centos-root (required field)
        • click on OK
      • click on Show Advanced Options
      • click on Boot options
      • check on Attach CD
      • ensure that your install ISO is selected
      • select CD-ROM as Second Device (default is empty)
    • confirm OK
  • once your VM is in state Down you can click on Run

  • wait until your VM is in state Active

  • then click on Console

  • if your browser asks you to select program to run *.vv file than you need to download virt-viewer.exe for Windows. Beware - in my case worked only 32-bit version virt-viewer-x86-6.0.msi (64-bit crashed) Done.

Bugs

Data Center "Default" is Down

After reboot of both ovirt-mng and ovirt-node I found that my Default datacenter is down forever. After a while I had found dat datacenter Default has:

  • Storage Type: Shared

Which is wrong (I use Local storage type). So I fix it following way:

  • highlight my Default data-center in Compute -> Data Centers
  • click on Edit
  • change Storage Type to Local again.
  • click on OK After a while my data center was _Up_again.

VM or host Nor responding

Sometimes all VMs in host are in state Not responding.

  • workaround - restart VDSM using:
    systemctl restart vdsmd

QEMU guest agent not responding

When you click on details of your VM you see that all field of Guest Info tab are Unknown even when Guest Agent is running.

Fix: N/A

Tips

Exporting VM to local disk

On your oVirt Node (ovirt-node1 in my example) create directory for export:

mkdir /vm-exports
chown vdsm:kvm /vm-exports/ # probably not needed (it seems to be created by root)

In oVirt portal do this:

  • highlight your VM for export
  • click on vertical ... for additional menu
  • click on Export as OVA
  • fill in Directory: /vm-exports
  • click on OK
  • click on menu Events
  • Wait until this message appears:
    Vm VM_NAME was exported successfully as a Virtual Appliance to path /vm-exports/VM_NAME.ova ...
    
  • You can then transfer your VM to client PC using regular SCP/WinSCP program.

Using CLI

On your host (ovirt-node1 in my case) I can use commands (see https://www.ovirt.org/develop/developer-guide/vdsm/vdsm-client/):

vdsm-client Host getVMList
  [
    "bcc2845e-f372-4260-8874-7b45bd55f8e9"
  ]

vdsm-client VM getInfo vmID=bcc2845e-f372-4260-8874-7b45bd55f8e9
# lot of output in JSON format

# getting list of commands
 vdsm-client VM help
usage: vdsm-client VM [-h] method [arg=value] ...
vdsm-client VM: error: argument method [arg=value]: invalid choice: 'help' (choose from 'changeFloppy', 'thaw', 'changeCD', 'desktopSendHcCommand', 'setNumberOfCpus', 'getInfo', 'migrate', 'merge', 'diskSizeExtend', 'seal', 'migrationCreate', 'getStats', 'hibernate', 'hostdevHotplug', 'desktopLogin', 'setIoTune', 'desktopLogoff', 'cont', 'hotplugMemory', 'setCpuTunePeriod', 'diskReplicateFinish', 'migrateChangeParams', 'hostdevHotunplug', 'shutdown', 'hotplugDisk', 'getIoTunePolicy', 'getIoTune', 'getMigrationStatus', 'destroy', 'hotplugNic', 'hotunplugLease', 'pause', 'setDestroyOnReboot', 'hotplugLease', 'hotunplugMemory', 'setTicket', 'diskReplicateStart', 'desktopLock', 'updateDevice', 'setCpuTuneQuota', 'create', 'freeze', 'reset', 'updateVmPolicy', 'migrateCancel', 'getDiskAlignment', 'setBalloonTarget', 'hotunplugDisk', 'snapshot', 'hotunplugNic')

vdsm-client VM getStats vmID=bcc2845e-f372-4260-8874-7b45bd55f8e9
# lot of outpout - but does not see guest...
Clone this wiki locally
You can’t perform that action at this time.