On Mon, Mar 26, 2018 at 1:03 PM Richard W.M. Jones <rjones@redhat.com> wrote:
On Mon, Mar 26, 2018 at 09:27:25AM +0000, Daniel Erez wrote:
> You can get it from '.storage.type' on the StorageDomain object.
> E.g.
> sd = connection.system_service().storage_domains_service().list()[0]
> sd.storage.type -> nfs/iscsi/etc

Is there a defined set of what can be returned, and/or a way
to find out if the storage is "block-like" or not?

Yes, the list is defined by the StorageType enum (file/block sub-type is also specified):
I don't see we expose it through the sdk though.

Alternately what happens if we don't specify the sparse flag at all?
Will it do the right thing? 

If not specified, the volume type should fallback to its default value, which is thin.
So it's depended on your use-case...


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.