RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1692489 - virt-install fails with "Storage pool not found: no storage pool with matching name 'default'"
Summary: virt-install fails with "Storage pool not found: no storage pool with matchin...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: virt-manager
Version: 8.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 8.0
Assignee: Cole Robinson
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1711806 1714752
TreeView+ depends on / blocked
 
Reported: 2019-03-25 17:14 UTC by Christophe de Dinechin
Modified: 2020-11-14 08:47 UTC (History)
8 users (show)

Fixed In Version: virt-manager-2.2.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1714752 (view as bug list)
Environment:
Last Closed: 2019-11-05 21:19:40 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:3464 0 None None None 2019-11-05 21:20:05 UTC

Description Christophe de Dinechin 2019-03-25 17:14:02 UTC
Description of problem:

virt-install fails with:
Storage pool not found: no storage pool with matching name 'default'


Version-Release number of selected component (if applicable):
virt-install.noarch     2.0.0-5.el8                            @beaker-AppStream


How reproducible: Always (with this image)

Steps to Reproduce:
Fresh install of RHEL-8.0.0-20190325.n.0
% yum module install virt
% yum install virt-viewer virt-install virt-manager
% virt-install -n rhel8 -r 4096 --vcpus 8 --disk size=20  -w type=direct,model=virtio,source=eno1

Actual results:
Storage pool not found: no storage pool with matching name 'default'


Expected results:
virt-install should create the storage pool

Additional info:

Running with -debug:
[root@virtlab605 ISO]# virt-install -n rhel8 -r 4096 --vcpus 8 --disk size=20  -w type=direct,model=virtio,source=eno1 
ERROR    Error: --disk size=20: Storage pool not found: no storage pool with matching name 'default'
[root@virtlab605 ISO]# virt-install --debug -n rhel8 -r 4096 --vcpus 8 --disk size=20  -w type=direct,model=virtio,source=eno1 
[Mon, 25 Mar 2019 12:52:26 virt-install 37995] DEBUG (cli:200) Launched with command line: /usr/share/virt-manager/virt-install --debug -n rhel8 -r 4096 --vcpus 8 --disk size=20 -w type=direct,model=virtio,source=eno1
[Mon, 25 Mar 2019 12:52:26 virt-install 37995] DEBUG (virt-install:243) Distilled --network options: ['type=direct,model=virtio,source=eno1']
[Mon, 25 Mar 2019 12:52:26 virt-install 37995] DEBUG (virt-install:159) Distilled --disk options: ['size=20']
[Mon, 25 Mar 2019 12:52:26 virt-install 37995] DEBUG (cli:214) Requesting libvirt URI default
[Mon, 25 Mar 2019 12:52:26 virt-install 37995] DEBUG (cli:217) Received libvirt URI qemu:///system
[Mon, 25 Mar 2019 12:52:26 virt-install 37995] DEBUG (cli:1195) Exception parsing inst=<DeviceDisk disk 140194183315408> optstr=size=20
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtinst/cli.py", line 1181, in parse
    objs = self._parse(inst or self.guest)
  File "/usr/share/virt-manager/virtinst/cli.py", line 2033, in _parse
    poolobj = self.guest.conn.storagePoolLookupByName(poolname)
  File "/usr/lib64/python3.6/site-packages/libvirt.py", line 4699, in storagePoolLookupByName
    if ret is None:raise libvirtError('virStoragePoolLookupByName() failed', conn=self)
libvirt.libvirtError: Storage pool not found: no storage pool with matching name 'default'
[Mon, 25 Mar 2019 12:52:26 virt-install 37995] DEBUG (cli:253)   File "/usr/share/virt-manager/virt-install", line 955, in <module>
    sys.exit(main())
  File "/usr/share/virt-manager/virt-install", line 943, in main
    guest, installer = build_guest_instance(conn, options)
  File "/usr/share/virt-manager/virt-install", line 527, in build_guest_instance
    cli.parse_option_strings(options, guest, None)
  File "/usr/share/virt-manager/virtinst/cli.py", line 2813, in parse_option_strings
    parseret = parserobj.parse(inst, validate=not update)
  File "/usr/share/virt-manager/virtinst/cli.py", line 1198, in parse
    "options": self.optstr, "err": str(e)})
  File "/usr/share/virt-manager/virtinst/cli.py", line 253, in fail
    logging.debug("".join(traceback.format_stack()))

[Mon, 25 Mar 2019 12:52:26 virt-install 37995] ERROR (cli:254) Error: --disk size=20: Storage pool not found: no storage pool with matching name 'default'
[Mon, 25 Mar 2019 12:52:26 virt-install 37995] DEBUG (cli:256) 
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtinst/cli.py", line 1181, in parse
    objs = self._parse(inst or self.guest)
  File "/usr/share/virt-manager/virtinst/cli.py", line 2033, in _parse
    poolobj = self.guest.conn.storagePoolLookupByName(poolname)
  File "/usr/lib64/python3.6/site-packages/libvirt.py", line 4699, in storagePoolLookupByName
    if ret is None:raise libvirtError('virStoragePoolLookupByName() failed', conn=self)
libvirt.libvirtError: Storage pool not found: no storage pool with matching name 'default'

One attempt to virt-install with --import (not sure if it matters)

Complete command history on this host since reimaging:

    1  wget http://download-node-02.eng.bos.redhat.com/rhel-8/nightly/RHEL-8/latest-RHEL-8/compose/BaseOS/x86_64/images/rhel-guest-image-8.0-1839.x86_64.qcow2
    2  yum module install virt
    3  yum install virt-install
    4  virt-install -n rhel8 -r 4096 --vcpus 8 --disk ./rhel-guest-image-8.0-1839.x86_64.qcow2  -w type=direct,model=virtio,source=eno1 --import
    5  mv rhel-guest-image-8.0-1839.x86_64.qcow2 /var/lib/libvirt/images/
    6  cd /var/lib/libvirt/images/
    7  virt-install -n rhel8 -r 4096 --vcpus 8 --disk ./rhel-guest-image-8.0-1839.x86_64.qcow2  -w type=direct,model=virtio,source=eno1 --import
    8  virsh list 
    9  virsh destroy rhel8
   10  ls
   11  virsh undefine rhel8
   12  ls
   13  yum install virt-viewer virt-manager
   14  virt-install -n rhel8 -r 4096 --vcpus 8 --disk ./rhel-guest-image-8.0-1839.x86_64.qcow2  -w type=direct,model=virtio,source=eno1 --import --os-type linux --os-variant rhel8
   15  osinfo-query os
   16  osinfo-query os | grep rhel
   17  virt-install -n rhel8 -r 4096 --vcpus 8 --disk ./rhel-guest-image-8.0-1839.x86_64.qcow2  -w type=direct,model=virtio,source=eno1 --import --os-type linux --os-variant rhel8.0
   18  mkdir /ISO; mount virtlab202:/mnt/c3d_storage /ISO
   19  vi /etc/fstab
   20  mount /ISO/
   21  cd /ISO/
   22  wget http://download-node-02.eng.bos.redhat.com/rhel-8/nightly/RHEL-8/latest-RHEL-8/compose/BaseOS/x86_64/iso/RHEL-8.0.0-20190325.n.0-x86_64-dvd1.iso
   23  setsebool -P virt_use_nfs 1
   24  virt-install -n rhel8 -r 4096 --vcpus 8 --disk size=20  -w type=direct,model=virtio,source=eno1  --os-type linux --os-variant rhel8.0
   25  cat /etc/os-release 
   26  virt-install -n rhel8 -r 4096 --vcpus 8 --disk size=20  -w type=direct,model=virtio,source=eno1 
   27  virt-install --debug -n rhel8 -r 4096 --vcpus 8 --disk size=20  -w type=direct,model=virtio,source=eno1 
   28  history

Comment 1 Cole Robinson 2019-03-26 16:03:45 UTC
We narrowed this down after a debugging session. What happened was:

* The first virt-install invocation used --disk /var/lib/libvirt/images/some-preexisting-path.qcow2
* virt-install imports the parent directory /var/lib/libvirt/images as a pool, names it 'images' after the last directory bit
* next virt-install run uses --disk size=X
* virt-install tries to look up pool name=default. there is no pool named default
* next it tries to lookup a pool using the default path /var/lib/libvirt/images, finds pool name=images
* however it fails to return name=images up to caller, which then tries to blindly look up name=default, which throws the erro

This is fixed upstream now with:

commit a0ca387aad0fde19683aa8b5b5636add6455b8b4
Author: Cole Robinson <crobinso>
Date:   Tue Mar 26 10:44:58 2019 -0400

    cli: Fix pool=default when path belongs to another pool (bz 1692489)

Comment 6 zhoujunqin 2019-07-08 07:25:18 UTC
I can reproduce this bug with build:
virt-manager-2.0.0-5.el8.noarch

Steps:
1. Remove default storage pool if it exists.

2. Define new storage pool that will point to the same directory as the default one with a different name then 'default:

# cat pool-images.xml 
<pool type='dir'>
  <name>images</name>
  <target>
    <path>/var/lib/libvirt/images</path>
  </target>
</pool>


# virsh pool-define pool-images.xml
Pool images defined from pool-images.xml

# virsh pool-start images
Pool images started


3. Run virt-install command that will try to create new disk in default storage pool:

# virt-install --name def-disk --memory 512 --import --disk size=1
ERROR    Error: --disk size=1: Storage pool not found: no storage pool with matching name 'default'


Then try to verify this bug with new build:
virt-install-2.2.0-2.el8.noarch
virt-manager-2.2.0-2.el8.noarch
libvirt-4.5.0-24.module+el8.1.0+3205+41ff0a42.x86_64
qemu-kvm-2.12.0-77.module+el8.1.0+3382+49219945.x86_64

Steps:
Rerun virt-install command that will try to create new disk in default storage pool:

# virt-install --name def-disk --memory 512 --import --disk size=1
WARNING  No operating system detected, VM performance may suffer. Specify an OS with --os-variant for optimal results.

Starting install...
Allocating 'def-disk.qcow2'     
...

Result: No error reports, so I move this bug from ON_QA to VERIFIED.

Comment 8 errata-xmlrpc 2019-11-05 21:19:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:3464


Note You need to log in before you can comment on or make changes to this bug.