refreshing a pool destroys all volume info in libvirt zfs backend
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libvirt (Ubuntu) |
Confirmed
|
Low
|
Unassigned |
Bug Description
How to replicate:
1. Install libvirt, libvirt-
2. Create a zfs pool
# zpool create -oashift=12 zfs /dev/sdb
# zfs set compression=lz4 zfs
# zfs create zfs/images
# virsh pool-define-as --name zfs --source-name zfs/images --type zfs
3. Create a volume in that pool
root@beaver:~# virsh vol-create-as --pool zfs --name vol1 --capacity 1G
Vol vol1 created
root@beaver:~# virsh vol-list --pool zfs
Name Path
-------
vol1 /dev/zvol/
4. Start virt-manager (even as a non-root user)
5. Immediately re-list the volumes from virsh:
root@beaver:~# virsh vol-list --pool zfs
Name Path
-------
root@beaver:~#
All zfs volumes have been forgotten!! Fortunately they still exist in zfs:
root@beaver:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
zfs 1.03G 8.59G 96K /zfs
zfs/images 1.03G 8.59G 96K /zfs/images
zfs/images/vol1 1.03G 9.63G 56K -
I think virt-manager is supposed to play nicely with zfs:
* You can create a zfs pool successfully in the GUI
* You can click to create a zfs volume. It actually creates the underlying zvol (as shown by "zfs list")
* But every time you do any action in virt-manager, even just clicking the Refresh button on the list of volumes, all volumes disappear from libvirt.
root@beaver:~# virsh vol-list --pool zfs
Name Path
-------
vol1 /dev/zvol/
root@beaver:~#
<<< click the Refresh button >>>
root@beaver:~# virsh vol-list --pool zfs
Name Path
-------
root@beaver:~#
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: virt-manager 1:1.5.1-0ubuntu1
ProcVersionSign
Uname: Linux 4.15.0-20-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.9-0ubuntu7
Architecture: amd64
Date: Mon Apr 30 10:24:19 2018
PackageArchitec
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: virt-manager
UpgradeStatus: No upgrade log present (probably fresh install)
summary: |
- virt-manager destroys all volumes in libvirt zfs pool + refreshign a pool destroys all volume info in libvirt zfs backend |
summary: |
- refreshign a pool destroys all volume info in libvirt zfs backend + refreshing a pool destroys all volume info in libvirt zfs backend |
Hi (again) Brian,
this is rather unexpected let me try to follow what happened.
So far you only triggered this via virt-manager start/refresh so I'll follow that until we know a non virt-manager trigger - usually it only calls libvirt tasks so I'd assume we can identify a virsh <something> or so to trigger the same.
Fortunately it seems it "only" seems to forget in libvirt about it quoting you on "All zfs volumes have been forgotten!! Fortunately they still exist in zfs".
I should be able to start testing this in an hour or so I hope ...