Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
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: ASSIGNED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: virt-manager
Version: 8.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Cole Robinson
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-25 17:14 UTC by Christophe de Dinechin
Modified: 2019-04-09 22:41 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)

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@redhat.com>
Date:   Tue Mar 26 10:44:58 2019 -0400

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


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