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

Configuring storage pools #7

Open
ncryptid opened this issue Feb 14, 2020 · 1 comment
Open

Configuring storage pools #7

ncryptid opened this issue Feb 14, 2020 · 1 comment

Comments

@ncryptid
Copy link

When trying to deploy a libvirt machine using this repo's version of the nixops-libvirt plugin, I run into the following error:

example> Connecting to qemu:///system...
example> preparing disk image...
example> uploading disk image...
libvirt: Storage Driver error : Storage pool not found: no storage pool with matching name 'default'
Traceback (most recent call last):
  File "/nix/store/s8jbqmv841dwpj6cq40rq1c4qyzk2x7q-nixops-1.8pre0_abcdef/bin/.nixops-wrapped", line 251, in <module>
    args.op(args)
  File "/nix/store/s8jbqmv841dwpj6cq40rq1c4qyzk2x7q-nixops-1.8pre0_abcdef/lib/python2.7/site-packages/nixops/script_defs.py", line 427,
in op_deploy
    max_concurrent_activate=args.max_concurrent_activate)
  File "/nix/store/s8jbqmv841dwpj6cq40rq1c4qyzk2x7q-nixops-1.8pre0_abcdef/lib/python2.7/site-packages/nixops/deployment.py", line 1062,
in deploy
    self.run_with_notify('deploy', lambda: self._deploy(**kwargs))
  File "/nix/store/s8jbqmv841dwpj6cq40rq1c4qyzk2x7q-nixops-1.8pre0_abcdef/lib/python2.7/site-packages/nixops/deployment.py", line 1051,
in run_with_notify
    f()
  File "/nix/store/s8jbqmv841dwpj6cq40rq1c4qyzk2x7q-nixops-1.8pre0_abcdef/lib/python2.7/site-packages/nixops/deployment.py", line 1062,
in <lambda>
    self.run_with_notify('deploy', lambda: self._deploy(**kwargs))
  File "/nix/store/s8jbqmv841dwpj6cq40rq1c4qyzk2x7q-nixops-1.8pre0_abcdef/lib/python2.7/site-packages/nixops/deployment.py", line 999, i
n _deploy
    nixops.parallel.run_tasks(nr_workers=-1, tasks=self.active_resources.itervalues(), worker_fun=worker)
  File "/nix/store/s8jbqmv841dwpj6cq40rq1c4qyzk2x7q-nixops-1.8pre0_abcdef/lib/python2.7/site-packages/nixops/parallel.py", line 44, in t
hread_fun
    result_queue.put((worker_fun(t), None, t.name))
  File "/nix/store/s8jbqmv841dwpj6cq40rq1c4qyzk2x7q-nixops-1.8pre0_abcdef/lib/python2.7/site-packages/nixops/deployment.py", line 972, i
n worker
    r.create(self.definitions[r.name], check=check, allow_reboot=allow_reboot, allow_recreate=allow_recreate)
  File "/nix/store/s6an2jrd2m2s1rchd65934bvbfyrjnwh-nixops-libvirtd/lib/python2.7/site-packages/nixopsvirtd/backends/libvirtd.py", line
163, in create
    self._prepare_storage_volume()
  File "/nix/store/s6an2jrd2m2s1rchd65934bvbfyrjnwh-nixops-libvirtd/lib/python2.7/site-packages/nixopsvirtd/backends/libvirtd.py", line
199, in _prepare_storage_volume
    self._vol = self._create_volume(image_info['virtual-size'], image_info['actual-size'])
  File "/nix/store/s6an2jrd2m2s1rchd65934bvbfyrjnwh-nixops-libvirtd/lib/python2.7/site-packages/nixopsvirtd/backends/libvirtd.py", line
221, in _create_volume
    vol = self.pool.createXML(xml)
  File "/nix/store/s6an2jrd2m2s1rchd65934bvbfyrjnwh-nixops-libvirtd/lib/python2.7/site-packages/nixopsvirtd/backends/libvirtd.py", line
104, in pool
    self._pool = self.conn.storagePoolLookupByName(self.storage_pool_name)
  File "/nix/store/p9d10c55vc0gb8gzvgrqhryaxx1xahhw-python2.7-libvirt-5.4.0/lib/python2.7/site-packages/libvirt.py", line 4706, in stora
gePoolLookupByName
    if ret is None:raise libvirtError('virStoragePoolLookupByName() failed', conn=self)
libvirt.libvirtError: Storage pool not found: no storage pool with matching name 'default'

Obviously the issue here is that I have no storage pools on the system:

$ virsh pool-list
 Name   State   Autostart
---------------------------

I could create one manually with virsh, but what I want to know is whether it's currently possible to do this through nix. Adding the following option just returns the same error as above (except 'default' is now '/mnt/vms'), which is what I would expect to happen anyways:

{
   example = {
     deployment = {
       targetEnv = "libvirtd";
       libvirtd = {
         headless = true;
         storagePool = "/mnt/vms";
       };
     };
   };
 }

Thanks

@jhillyerd
Copy link
Contributor

Ran into the same problem. I suspect this bug needs to be filed against nixpkgs though, not this nixops plugin?

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

No branches or pull requests

2 participants