Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when default storage pool is missing #8

Open
screeley44 opened this issue Feb 5, 2015 · 10 comments
Open

error when default storage pool is missing #8

screeley44 opened this issue Feb 5, 2015 · 10 comments

Comments

@screeley44
Copy link

  1. my work laptop is rhel 6.5
  2. I have created f21 VM (named miqbuild.rhs)
  3. from the f21 VM I have successfully performed these commands:
    dnf copr enable fsimonce/virt-deploy
    dnf install virt-deploy virt-address
  4. Now when I try to create the instance, I get this:

[root@miqbuild ~]# virt-deploy create test01 fedora-21
Traceback (most recent call last):
File "/usr/bin/virt-deploy", line 9, in
load_entry_point('virt-deploy==0.1.6', 'console_scripts', 'virt-deploy')()
File "/usr/lib/python2.7/site-packages/virtdeploy/cli.py", line 143, in main
return parse_command_line(sys.argv[1:])
File "/usr/lib/python2.7/site-packages/virtdeploy/cli.py", line 138, in parse_command_line
return COMMAND_TABLEargs.command
File "/usr/lib/python2.7/site-packages/virtdeploy/cli.py", line 41, in instance_create
instance = driver.instance_create(args.id, args.template)
File "/usr/lib/python2.7/site-packages/virtdeploy/drivers/libvirt.py", line 96, in instance_create
pool = conn.storagePoolLookupByName(kwargs['pool'])
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 4305, 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'

Any idea what I'm missing at this point, or maybe my approach is completely wrong?

@simon3z
Copy link
Owner

simon3z commented Feb 5, 2015

@screeley44 what version are you using? (virt-deploy --version)

Latest version on copr is 0.1.6.

Can you check that you have the default pool defined in libvirt:

# virsh pool-list
 Name                 State      Autostart 
-------------------------------------------
 default              active     yes     

Thanks

@simon3z
Copy link
Owner

simon3z commented Feb 5, 2015

You can try to define the pool with:

# virsh pool-define /dev/stdin <<EOF
<pool type='dir'>
  <name>default</name>
  <target>
    <path>/var/lib/libvirt/images</path>
  </target>
</pool>
EOF

virsh pool-start default
virsh pool-autostart default

@screeley44
Copy link
Author

that worked!! Thanks!!

Name State Autostart

default active yes

@simon3z
Copy link
Owner

simon3z commented Feb 5, 2015

Marking this as enhancement/help-wanted because adding the default storage pool when missing will improve user experience.

@simon3z simon3z changed the title error when trying to virt-deploy create (instance) (image) error when default storage pool is missing Feb 5, 2015
@jscotka
Copy link

jscotka commented Feb 27, 2015

Hi,
I've met similar issue. I have minimal installation and I've installed virt-deploy and it seems that "default" pool is not defined.
It is caused also by missing dependency, what is not directly needed but this dependency create this pool.
it is package "virt-manager"
after installation of that package and reboot machine, pool is aviable.

So I'm not sure what is better solution, install dependendend virt-manager or create default pool + default network in own setup as workaround.
From this point of view I cannot decide what is better.
it is connected with another issue:
#10

So my point of view is, that it would be nice, to not use default pool and default network but be able to config own pool for disc and net.
Regards
Honza

@jscotka
Copy link

jscotka commented Feb 27, 2015

My mentioned solution should also solve another issue:
I'm running virt-deploy under normal user ( not root) and I've added policy to
/etc/polkit-1/localauthority/50-local.d/50-org.example-libvirt-remote-access.pkla
to allow some group work with virsh qemu:///system
All virsh qemu:///system comands works then well, but qemu-img command does not have access to /var/lib/libvirt/images (default pool location), so in case virt-deploy under normal user create this pool in some other dir where user/group has access it will be better. (/var/lib/libvirt/images/_fedora-21-x86_64.qcow2: qemu-img exited with error status 1.)

@jscotka
Copy link

jscotka commented Feb 27, 2015

Hi,
otherwise I found, that this default pool is created after command virt-manager is called (probably virt-manager do some init of "default" pool)
installation of virt-manager is not enouht
Honza

@rrasouli
Copy link

rrasouli commented Aug 1, 2016

error: Failed to define pool default
error: operation failed: Storage source conflict with pool: 'images'
SOLVED:
virsh pool-list

Name State Autostart

images active yes

$ virsh pool-destroy images
Pool images destroyed

$ virsh pool-undefine images
Pool images has been undefined

Then restart the deployment

@huataihuang
Copy link

a reference to vagrant-libvirt README

storage_pool_name - Libvirt storage pool name, where box image and instance snapshots will be stored.

My Solution

Example: install boxe centos/7

  • init Vagrant
vagrant init centos/7
  • edit Vagrantfile config, in provider secition add config like follow:
Vagrant.configure("2") do |config|
  ...
  config.vm.provider :libvirt do |libvirt|
    libvirt.storage_pool_name = "images"
  end
  ...
end
  • then, start install
vagrant up --provider libvirt
  • (Option) if you like, you can add follow environment config to /etc/profile to make libvirt as default provider, then you not need --provider libvirt as vagrant parameter.
export VAGRANT_DEFAULT_PROVIDER=libvirt

@busti
Copy link

busti commented Jul 21, 2024

I had to define the pool using virtmanager instead of using virsh to get it to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants