Block device creation cleanup
authorIustin Pop <iustin@google.com>
Mon, 19 Jan 2009 11:10:01 +0000 (11:10 +0000)
committerIustin Pop <iustin@google.com>
Mon, 19 Jan 2009 11:10:01 +0000 (11:10 +0000)
commit6c6265186c60c79b243b170fa7bdeddb47d1df32
tree0b0f6cb0d9dcd6d134a97f77d9d2df30e287f41b
parente6c1ff2fee54cf957d6800c99afdfa3aeabbfac8
Block device creation cleanup

Currently when creation LVM-based instances, we always get the
extremely-confusing message "ERROR Can't find LV /dev/xenvg/..." which
is actually expected. This behaviour was introduced before we had
UUID-style LV names, since at that point it was not a unexpected to have
such volumes laying around after a failed creation.

Today, it's much more of an error to see existing volumes, and it's
better to abort with a failure. Since bdev.LogicalVolume.Create() method
will raise an error in case it exists, we can remove this check in
backend before creating the device.

The Create methods for DRBD and FileStorage currently don't raise
exception, as behaviour is not very well defined here.

We also change some exception types raised in bdev so that all
exceptions raised by device creation are a subclass of GenericError.

Reviewed-by: ultrotter
lib/backend.py
lib/bdev.py