Installation guide

Chapter 24.
183
Miscellaneous administration tasks
This chapter contain useful hints and tips to improve virtualization performance, scale and stability.
24.1. Automatically starting guests
This section covers how to make virtualized guests start automatically during the host system's boot
phase.
This example uses virsh to set a guest, TestServer, to automatically start when the host boots.
# virsh autostart TestServer
Domain TestServer marked as autostarted
The guest now automatically starts with the host.
To stop a guest automatically booting use the --disable parameter
# virsh autostart --disable TestServer
Domain TestServer unmarked as autostarted
The guest no longer automatically starts with the host.
24.2. Using qemu-img
The qemu-img command line tool is used for formatting various file systems used by KVM. qemu-
img should be used for formatting virtualized guest images, additional storage devices and network
storage. qemu-img options and usages are listed below.
Formatting and creating new images or devices
Create the new disk image filename of size size and format format.
# qemu-img create [-6] [-e] [-b base_image] [-f format] filename [size]
If base_image is specified, then the image will record only the differences from base_image. No size
needs to be specified in this case. base_image will never be modified unless you use the "commit"
monitor command.
Convert an existing image to another format
The convert option is used for converting a recognized format to another image format.
Command format:
# qemu-img convert [-c] [-e] [-f format] filename [-O output_format] output_filename
Convert the disk image filename to disk image output_filename using format output_format.
The disk image can be optionally encrypted with the -e option or compressed with the -c option.
Only the qcow2 format supports encryption or compression. the compression is read-only. It means
that if a compressed sector is rewritten, then it is rewritten as uncompressed data.
The encryption uses the AES format with very secure 128-bit keys. Use a long password (over 16
characters) to get maximum protection.