1
# fdisk -l /dev/sdb
Disk /dev/sdb: 447.1 GiB, 480103981056 bytes, 937703088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 518EC549-4DA3-4584-8738-5567F62C8056

I try to define volume to VM but failed. The same result I receive in GUI.

# virsh pool-list
Name State Autostart
-------------------------------------------
default active yes
dsk-b active yes
dsk-c active yes
# virsh pool-info dsk-b
Name: dsk-b
UUID: e58b5005-ef7b-43b9-a420-73779ccf74a3
State: running
Persistent: yes
Autostart: yes
Capacity: 447.13 GiB
Allocation: 0.00 B
Available: 447.13 GiB
# cat Vol226.xml
<volume>
<name>U226</name>
<source>
<device path='/dev/sdb'>
<extent start='2048' end='33554465'/>
</device>
</source>
<capacity>17179869184</capacity>
<allocation>17179869184</allocation>
</volume>
# virsh vol-create dsk-b Vol226.xml
error: Failed to create vol from Vol226.xml
error: internal error: Child process (/sbin/parted /dev/sdb mkpart --script primary 17408B 17179886591B) unexpected exit status 1: Error: You requested a partition from 17.4kB to 17.2GB (sectors 34..33554465).
The closest location we can manage is 1049kB to 17.2GB (sectors 2048..33554465).

The same result without XML

# virsh vol-create-as dsk-b sdb1 16G
error: Failed to create vol sdb1
error: internal error: Child process (/sbin/parted /dev/sdb mkpart --script primary 17408B 17179886591B) unexpected exit status 1: Error: You requested a partition from 17.4kB to 17.2GB (sectors 34..33554465).
The closest location we can manage is 1049kB to 17.2GB (sectors 2048..33554465).

The same result with GUI

 # virsh pool-dumpxml dsk-b
<pool type='disk'>
  <name>dsk-b</name>
  <uuid>e58b5005-ef7b-43b9-a420-73779ccf74a3</uuid>
  <capacity unit='bytes'>480103964160</capacity>
  <allocation unit='bytes'>0</allocation>
  <available unit='bytes'>480103946752</available>
  <source>
    <device path='/dev/sdb'>
      <freeExtent start='17408' end='480103964160'/>
    </device>
    <format type='gpt'/>
  </source>
  <target>
    <path>/dev</path>
  </target>
</pool>
# virsh -c qemu:///system version --daemon
Compiled against library: libvirt 1.3.1
Using library: libvirt 1.3.1
Using API: QEMU 1.3.1
Running hypervisor: QEMU 2.5.0
Running against daemon: 1.3.1
5
  • Please post the output of: virsh pool-dumpxml dsk-b Feb 9, 2021 at 15:17
  • @MichaelHampton done
    – Viacheslav
    Feb 10, 2021 at 0:27
  • This is starting to smell like a bug. What version of libvirt are you using? Can you upgrade it? Feb 10, 2021 at 0:38
  • @MichaelHampton Version added
    – Viacheslav
    Feb 10, 2021 at 9:47
  • 1
    As qemu and libvirt go, that's quite old. Libvirt doesn't even have release notes for such an old version. And your OS is probably very close to end of life. If it were me, I would just upgrade first. Feb 10, 2021 at 11:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.