3

I have a secondary hdd that I would like to use as a storage pool for my KVM host. Here is the xml file I use to create the storage pool,

<pool type='disk'>
    <name>guest_images_disk</name>
    <source>
        <device path='/dev/sdb' />
        <format type='gpt' />
    </source>
    <target>
        <path>/dev</path>
    </target>
</pool>

Here is the pool-info output after createing and starting the storage pool,

Name:           guest_images_disk
UUID:           779b1ad8-093f-4c7f-a32e-4d120101088b
State:          running
Persistent:     no
Autostart:      no
Capacity:       931.51 GiB
Allocation:     931.51 GiB
Available:      992.50 KiB

As one can see, even thought there is only one partition in my hdd, KVM doesn't make available the entire allocated space.

1 Answer 1

0

Libvirt can't make use of the space on your disk, because the disk is full.

When you tell libvirt to use a whole disk device, it expects to be able to use the entire block device, ignoring any existing partitions.

To resolve the problem, delete the partitions, or erase the partition table from the device:

dd bs=512 count=1 if=/dev/zero of=/dev/sdb
partprobe

If you are suggested to reboot, then reboot. Otherwise, reload libvirtd:

systemctl reload libvirtd
6
  • My drive has one partition which is the size of the entire disk. I would like to add the partition to the storage pool Apr 30, 2015 at 17:15
  • Huh? Why do you want to use the partition? Apr 30, 2015 at 17:17
  • Check "Warning" under section 13.1, access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/… Apr 30, 2015 at 17:22
  • Ah, right, well then change the storage pool to reference /dev/sdb1. Apr 30, 2015 at 17:23
  • So, when I explicitly mention partition no, I get the following message when I do pool-create. error: Failed to create pool from xmlfiles/storage_pool_1.xml error: Storage volume not found: no storage vol with matching path '/dev/sdb1p1' Apr 30, 2015 at 17:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .