Project

General

Profile

Actions

Bug #2374

closed

Libvirt host creation fails with LVM storage pool

Added by Chris Barbour over 11 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Host creation
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

I'm unable to provision a libvirt host when the storage backend is an LVM pool. Host creation appears to fail when Foreman requests LV parameters that LVM2 is unable to satisfy.

Here's the error from the libvirtd:

2013-04-04 00:15:41.898+0000: 3686: error : virCommandWait:2345 : internal error Child process (/sbin/lvcreate --name test1.example.com-disk1 -L 0K --v
irtualsize 41943040K sec) unexpected exit status 5: Unable to create new logical volume with no extents

It's not clear if this is truly a Foreman bug, a LVM bug, or libvirt issue. However, the Following change in Foreman did work around the problem:

--- /usr/share/foreman/lib/foreman/model/libvirt.rb.orig    2013-04-04 12:39:13.000000000 -0700
+++ /usr/share/foreman/lib/foreman/model/libvirt.rb    2013-04-04 12:39:24.000000000 -0700
@@ -136,7 +136,7 @@
       vols = []
       (volumes = args[:volumes]).each do |vol|
         vol.name       = "#{args[:prefix]}-disk#{volumes.index(vol)+1}" 
-        vol.allocation = "0K" 
+        vol.allocation = "1M" 
         vol.save
         vols << vol
       end

I can confirm that provisioning using a directory based storage pool works normally in this environment.

Software versions:

libvirt-0.10.2-18.el6.x86_64
lvm2-2.02.87-6.el6.x86_64
foreman-1.1RC5-2.el6.noarch

OS Release is Scientific Linux 6.2


Files

libvirt.rb.lvm2.diff libvirt.rb.lvm2.diff 451 Bytes Chris Barbour, 04/04/2013 04:20 PM
fog-libvirt_full-volume-allocation.patch fog-libvirt_full-volume-allocation.patch 548 Bytes Fog libvirt thick provisioning patch Chris Barbour, 04/24/2013 06:24 PM
Actions

Also available in: Atom PDF