Installation guide

Chapter 26.
203
Storage pools
26.1. Creating storage pools
26.1.1. Dedicated storage device-based storage pools
This section covers dedicating storage devices to virtualized guests.
Security issues with dedicated disks
Guests should not be given write access to whole disks or block devices (for example, /dev/
sdb). Use partitions (for example, /dev/sdb1) or LVM volumes.
Guests with full access to a disk device may be able to maliciously access other disk devices that
they are not assigned due to disks not having access control lists.
26.1.1.1. Creating a dedicated disk storage pool using virsh
This procedure creates a new storage pool using a dedicated disk device with the virsh command.
Warning
Dedicating a disk to a storage pool will reformat and erase all data presently stored on the disk
device. Back up the storage device before commencing the procedure.
1. Create a GPT disk label on the disk
The disk must be relabeled with a GUID Partition Table (GPT) disk label. GPT disk labels allow for
creating a large numbers of partitions, up to 128 partitions, on each device. GPT partition tables
can store partition data for far more partitions than the msdos partition table.
# parted /dev/sdb
GNU Parted 2.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel
New disk label type? gpt
(parted) quit
Information: You may need to update /etc/fstab.
#
2. Create the storage pool configuration file
Create a temporary XML text file containing the storage pool information required for the new
device.
The file must be in the format shown below, and contain the following fields:
<name>guest_images_disk</name>
The name parameter determines the name of the storage pool. This example uses the name
guest_images_disk in the example below.