This is the first blog post of a series which will cover Libosinfo, what it is, who uses it, how it is used, how to manage it, and, finally, how to contribute to it.
A quick overview
Libosinfo is the operating system information database. As a project, it consists of three different parts, with the goal to provide a single place containing all the required information about an operating system in order to provision and manage it in a virtualized environment.
The project allows management applications to:
Automatically identify for which operating system an ISO image or an installation tree is intended to;
Find the download location of installable ISOs and LiveCDs images;
Find the location of installation trees;
Query the minimum, recommended, and maximum CPU / memory / disk resources for an operating system;
Query the hardware supported by an operating system;
Generate scripts suitable for automating “Server” and “Workstation” installations;
The library (libosinfo)
As part of libosinfo, three tools are provided:
osinfo-detect: Used to detect an Operating System from a given ISO or installation tree.
osinfo-install-script: Used to generate a “Server” or “Workstation” install-script to perform automated installation of an Operating System;
osinfo-query: Used to query information from the database;
The database (osinfo-db)
The database is written in XML and it can either be consumed via libosinfo APIs or directly via management applications’ own code.
It contains information about the operating systems, devices, installation scripts, platforms, and datamaps (keyboard and language mappings for Windows and Linux OSes).
The database tools (osinfo-db-tools)
These are tools that can be used to manage the database, which is distributed as a tarball archive.
osinfo-db-import: Used to import an osinfo database archive;
osinfo-db-export: Used to export an osinfo database archive;
osinfo-db-validate: Used to validate the XML files in one of the osinfo database locations for compliance with the RNG schema.
osinfo-db-path: Used to report the paths associated with the standard database locations;
The consumers …
Libosinfo and osinfo-db have management applications as their target audience. Currently the libosinfo project is consumed by big players in the virtual machine management environment such as OpenStack Nova, virt-manager, GNOME Boxes, Cockpit Machines, and KubeVirt.
… a little bit about them …
virt-manager: An application for managing virtual machines through libvirt.
GNOME Boxes: A simple application to view, access, and manage remote and virtual systems.
KubeVirt: Virtual Machine Management on Kubernetes.
… and why they use it
Download ISOs: As libosinfo provides the ISO URLs, management applications can offer the user the option to download a specific operating system;
Automatically detect the ISO being used: As libosinfo can detect the operating system of an ISO, management applications can use this info to set reasonable default values for resources, to select the hardware supported, and to perform unattended installations.
Start tree installation: As libosinfo provides the tree installation URLs, management applications can use it to start a network-based installation without having to download the whole operating system ISO;
Set reasonable default values for RAM, CPU, and disk resources: As libosinfo knows the values that are recommended by the operating system’s vendors, management applications can rely on that when setting the default resources for an installation.
Automatically set the hardware supported: As libosinfo provides the list of hardware supported by an operating system, management applications can choose the best defaults based on this information, without taking the risk of ending up with a non-bootable guest.
Unattended install: as libosinfo provides unattended installations scripts for CentOS, Debian, Fedora, Fedora Silverblue, Microsoft Windows, OpenSUSE, Red Hat Enterprise Linux, and Ubuntu, management applications can perform unattended installations for both “Workstation” and “Server” profiles.
The next blog post will provide a “demo” of an unattended installation using both GNOME Boxes and virt-install and, based on that, explain how libosinfo is internally used by these projects.
By doing that, we’ll both cover how libosinfo can be used and also demonstrate how it can ease the usage of those management applications.