Hello,
I have a problem with the following code fragment, which refreshes a directory
based storage pool:
storage_backend_fs.c#virStorageBackendFileSystemRefresh(...)
...
while ((ent = readdir(dir)) != NULL) {
...
if ((ret = virStorageBackendProbeTarget(...) < 0) {
if (ret == -1)
goto cleanup;
...
}
...
}
closedir(dir);
...
return 0;
cleanup:
...
return -1;
}
This disables the whole pool, if it contains an Qcow2 volume while, whose
backfile is (currently) unavailable (because, for example, the central NFS
store is currently unavailable or the permissions don't allow reading). This
is very annoying, since it's hard to find the Qcow2 volume, which breaks the
pool. I use the following command to find broken volumes:
find "$dir" -maxdepth 1 \( -type f -o -type l \) \( -exec kvm-img info {}
\; -o -print \) 2>/dev/null
Even worse, you can't delete the broken or re-create the missing volume with
virsh allone.
To reproduce:
dir=$(mktemp -d)
virsh pool-create-as tmp dir '' '' '' ''
"$dir"
virsh vol-create-as --format qcow2 tmp back 1G
virsh vol-create-as --format qcow2 --backing-vol-format qcow2 --backing-vol
back tmp cow 1G
virsh vol-delete --pool tmp back
virsh pool-refresh tmp
After the last step, the pool will be gone (because it was not persistent). As
long as the now broken image stays in the directory, you will not be able to
re-create or re-start the pool.
The easiest 'fix' would be to ignore all errors regarding the detection of the
backing files file format. This would at least allow users to still create
new volumes and list existing volumes.
I appreciate any comments.
BYtE
Philipp
--
Philipp Hahn Open Source Software Engineer hahn(a)univention.de
Univention GmbH Linux for Your Business fon: +49 421 22 232- 0
Mary-Somerville-Str.1 28359 Bremen fax: +49 421 22 232-99
http://www.univention.de/
** Besuchen Sie uns auf der CeBIT in Hannover **
** Auf dem Univention Stand D36 in Halle 2 **
** Vom 01. bis 05. März 2011 **