[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [BUG] storage_backend_fs: failung virStorageBackendProbeTarget() disabled whole pool


I have a problem with the following code fragment, which refreshes a directory 
based storage pool:

    while ((ent = readdir(dir)) != NULL) {
       if ((ret = virStorageBackendProbeTarget(...) < 0) {
            if (ret == -1)
                goto cleanup;
    return 0;
    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.

Philipp Hahn           Open Source Software Engineer      hahn 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
** Besuchen Sie uns auf der CeBIT in Hannover **
** Auf dem Univention Stand D36 in Halle 2    **
** Vom 01. bis 05. März 2011                  **

Attachment: signature.asc
Description: This is a digitally signed message part.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]