libvirt
libvirt is a library that provides a common API for managing popular
virtualization solutions, among them KVM, LXC, and Xen. The library
provides a normalized management API for these virtualization solutions,
allowing a stable, cross-hypervisor interface for higher-level management
tools. The library also provides APIs for management of virtual networks
and storage on the VM Host Server. The configuration of each VM Guest is stored
in an XML file.
With libvirt you can also manage your VM Guests remotely. It supports
TLS encryption and x509 certificates as well as authentication with SASL.
The communication between the virtualization solutions (KVM, Xen,
LXC) and the libvirt API is managed by the daemon libvirtd, which
needs to run on the VM Host Server. libvirt client applications such as
virt-manager, possibly running on a remote machine, communicate with
libvirtd running on the VM Host Server, which services the requestusing native
hypervisor APIs. Use the following commands to start and stop libvirtd
or check its status:
# systemctl start libvirtd.service # systemctl status libvirtd.service libvirtd.service - Virtualization daemon Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled) Active: active (running) since Mon 2014-05-12 08:49:40 EDT; 2s ago [...] # systemctl stop libvirtd.service # systemctl status libvirtd.service [...] Active: inactive (dead) since Mon 2014-05-12 08:51:11 EDT; 4s ago [...]
To automatically start libvirtd at boot time, either activate it using
the YaST module or by entering the
following command:
systemctl enable libvirtd.service
The following libvirt-based tools are available on SUSE Linux Enterprise Server. They
do not need to be run on the VM Host Server, allowing management of VM Host Servers
and VM Guests via remote connections. This enables managing VM Host Servers
centrally from a single workstation, alleviating the need to access each
VM Host Server individually.
virt-manager)
The Virtual Machine Manager is a desktop tool for managing VM Guests. It provides the
ability to control the life cycle of existing machines (start/shutdown,
pause/resume, save/restore) and create new VM Guests. It allows
managing various types of storage and virtual networks. It provides
access the graphical console of VM Guests with a built-in VNC viewer
and can be used to view performance statistics.
virt-manager supports connecting to a local
libvirtd, managing a local VM Host Server, or a remote libvirtd managing
a remote VM Host Server.
To start the Virtual Machine Manager, enter virt-manager at the
command prompt.
virt-viewer
A viewer for the graphical console of a VM Guest. It uses SPICE
(configured by default on the VM Guest) or VNC protocols and supports TLS and x509 certificates.
VM Guests can be accessed by name, ID, or UUID. If the guest is not
already running, the viewer can be told to wait until the guest starts,
before attempting to connect to the console.
virt-viewer is not installed by default and is
available after installing the package
virt-viewer.
virt-install
A command line tool for creating new VM Guests using the libvirt
library. It supports graphical installations via VNC or
SPICE protocols. Given suitable
command line arguments, virt-install can run
completely unattended. This allows for easy automation of guest
installs. virt-install is the default installation
tool used by the Virtual Machine Manager.
vm-install
A tool to set up a VM Guest, configure its devices and start the
operating system installation. Starts a GUI wizard when called from a
graphical user interface. When invoked on a terminal, starts the wizard
in command-line mode. vm-install can be selected as
the installation tool when creating a new virtual machine in the Virtual Machine Manager.
virsh
A command line tool to manage VM Guests with similar functionality as
the Virtual Machine Manager. Allows you to change a VM Guest's status (start, stop,
pause, etc.) to set up new guests and devices and to edit existing
configurations. virsh is also useful to script
VM Guest management operations.
virsh works like Subversion's svn
command or zypper: it takes the first arguments as a
command and further arguments as options to this command:
virsh [-c URI] commanddomain-id [OPTIONS]
Just like zypper, virsh can also
be called without a command. In this case it starts a shell waiting for
your commands. This mode is useful when having to run subsequent
commands:
~> virsh -c qemu+ssh://wilber@mercury.example.com/system
Enter passphrase for key '/home/wilber/.ssh/id_rsa':
Welcome to virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
virsh # hostname
mercury.example.com