Lvcreate is called with wrong parameters

Create host by image based method on top of LVM storage pool. it will prompt this error
Failed to create a compute xxxx (Libvirt) instance yyyy: Call to virStorageVolCreateXML failed: internal error: Child process (/usr/sbin/lvcreate --name yyyy -L 1K --type snapshot --virtualsize 10485760K -s /opt/pool/CentOS-7-x86_64-GenericCloud.qcow2) unexpected exit status 3: Volume group name expected (no slash) Run `lvcreate --help’ for more information.

Expected outcome:
host and lv can be successfully created.

Foreman and Proxy versions:
Foreman: 1.23
Proxy: 1.23


I’d wonder its a foreman bug or a libvirt bug?

From what you provided, this looks like a libvirt/virsh bug.
I have limited experience with libvirt, and none with libvirt managed by Foreman, but the chain of components should be something like this:
Foreman → libfog → libvirt → lvm
The Error you recieve is clearly from LVM, which should only be called by libvirt.
I did a little digging and judging from what I read and my very limited C-knowledge, I would assume this line to cause your problem (don’t quote me on that though :wink: ). Looks like a regression that happened during some sort of refactoring of the LVM backend code. You should probably check with the libvirt project directly or your distribution vendor/community to get that resolved.

Libvirt provider is only meant for testing purposes, it was only tested with the default directory-based pool. Any other pool type will likely fail.