-1

It seems every time I create a VM with virt-install a new storage pool is created.

But I don't use storage pools at all!

I looked in the virt-install manual but could find a way to prevent this from happening. Also been looking for any settings in the libvirt/qemu config file to disable storage pools in any way but couldn't find anything there either.

If I run virsh pool-capabilities I do get a XML output with some "supported" attribute which could be interesting to set to 'no' but again I cannot find anywhere to edit those settings.

Any help would be appreciated.

I mostly edit/create/manage VM's by directly editing the VM XML files and I only use local storage (qcow2 files and logical devices). I also only manage VM's from console primarily using virsh (no gui). I cannot see any advantages for me to use storage pools.

EDIT: My virt-install cmd:

virt-install \
--virt-type kvm \
--name SRV01 \ 
--metadata description="SRV2019" \
--vcpus 2 \
--memory 2048 \
--boot uefi \
--cpu host \
--os-variant win2k19 \
--features acpi=on \
--disk device=disk,path="/mnt/data-r1/vm/w2k16-01/Disk1.qcow2",format=qcow2,bus=virtio,cache=none,boot_order=1 \
--disk device=cdrom,path="/mnt/data-r1/vm/iso/WinSrv2016.iso",boot_order=2,bus=scsi,boot_order=6 \
--disk device=cdrom,path="/mnt/data-r1/vm/iso/virtio-win-0.1.190.iso",bus=sata \
--controller type=virtio-serial \
--controller type=scsi,model=virtio-scsi \
--network bridge=brLAN,model=virtio \
--graphics vnc,password=pass,port=5900,keymap=local,listen=0.0.0.0 \
--noautoconsole \
--video vga \
--memballoon none \
--noreboot
MrCalvin
  • 305
  • 1
  • 4
  • 17
  • How do you run virt-install, and what does it make seem that a new storage pool is created? – berndbausch Apr 25 '21 at 21:51
  • Just added the virt-install cmd. And if I afterward call `virsh pool-list --all` I can see it create a storage pool for the qcow2 image file. – MrCalvin Apr 25 '21 at 22:30
  • I believe that libvirt creates a `dir`-type pool for each directory where a disk file resides. If you run `virsh pool-dumpxml` on the pool that was created by the above `virt-install` command, you should find that it's of type `dir` and its target path is `/mnt/data-r1/vm/w2k16-01`. You probably have a pool named `default` with a path of `/var/lib/libvirt/images`. – berndbausch Apr 26 '21 at 00:08
  • You say that you don't use storage pools at all. I understand that it is via pools that libvirt manages storage. If I am right, you have no choice - you do use pools, even if you don't manage them explicitly. You could experiment as follows: Launch a dummy VM, then remove its pool and see what happens. I guess that you won't be able to start it after destroying it. – berndbausch Apr 26 '21 at 00:09
  • I will claim libvirt work very fine without storage pools. First of all, in the VM XML I specify the qcow2 file directly, not the storage pool. Secondly I always completely delete those auto created pools. You are correct, those auto-created pools are dir pools. I have no default pools, did check that. – MrCalvin Apr 26 '21 at 05:19

1 Answers1

0

It seems every time I create a VM with virt-install a new storage pool is created.

But I don't use storage pools at all!

You might not directly use storage pools yourself, but the virt-install application uses storage pools to provision the storage volumes for the newly created VM, so you are effectively using them indirectly. If your OS distro provides modular packaging, you can potentially disable storage pools by not installing that part of the libvirt functionality, but then you will be unable to use virt-install, so I can't recommend that.

DanielB
  • 1,510
  • 6
  • 7
  • You are very right! At first I didn't had the package `libvirt-daemon-driver-storage` (openSUSE) installed which seem to provide some kind of storage-pool-driver and virt-install couldn't run. Basically my question was in short: is it hard coded, and it seems it is. At least I know! And thank you for clarify and give a competent answer. – MrCalvin Apr 26 '21 at 19:47