On Sun, Mar 25, 2018 at 08:05:14PM +0000, Nir Soffer wrote:
> > > + sparse =
params['output_sparse'],
> > >
> > The user cannot configure that. This must be based on the image
> > format. The current coded may create images in unsupported
> > combinations, e.g. raw/sparse on block storage, or fail validation
> > in engine.
>
> In virt-v2v this can be configured using ‘-oa’. What are the possible
> combinations?
>
I could not find documentation for this in the ovirt engine sdk.
There is
http://ovirt.github.io/ovirt-engine-sdk/master/ but it is
not very useful for anything.
The ovirt-engine REST API has real documentation here:
http://ovirt.github.io/ovirt-engine-api-model/master
But I could not find any documentation about creating disks there, so
the above is based on current system behavior.
When creating disks from the UI, the user select the storage domain
(implicitly selecting the file/block), and the allocation policy
(thin/preallocated). The user cannot select the image format when
creating disk, ovirt will choose the image format and sparse for you.
storage type allocation | image format sparse creating
---------------------------|-----------------------------------------------------------------
file thin | raw true sparse file of
provisioned_size bytes
file preallocated | raw false preallocated file of
provisioned_size bytes
block thin | qcow2 true logical volume of
initial_size bytes
block preallocated | raw false logical volume of
provisioned_size bytes
When uploading disk, the user select a file, implicitly selecting the
image format (raw/qcow2), and the storage domain, implicitly selecting
the storage type (file/block). oVirt selects the allocation and sparse
value for you.
storage type image format | allocation sparse creating
---------------------------|---------------------------------------------------------------
file qcow2 | thin true sparse file of image
size bytes
file raw | thin true sparse file of
provisioned_size bytes
block qcow2 | thin true logical volume of
initial_size bytes
block raw | preallocated false logical volume of
provisioned_size bytes
Notes:
- file,qcow2 cannot be created from the UI.
- no way to create preallocated uploading from the UI (looks like a bug to
me)
When using the sdk, you can select both the image format and sparse, so you
can create invalid combinations. oVirt selects the allocation for you.
storage type image format sparse | allocation creating
-----------------------------------|--------------------------------------------------------
file qcow2 true | thin sparse file of image
size bytes
file raw false | preallocated preallocated file of
provisioned_size bytes
file raw true | thin sparse file of
provisioned_size
bytes
file qcow2 false | - unsupported
block qcow2 true | thin logical volume of
initial_size bytes
block raw false | preallocated logical volume of
provisioned_size bytes
block qcow2 false | - unsupported
block raw true | - unsupported
The only case when selecting the sparse value is useful is raw file
on file based storage domain, allowing creation of sparse or preallocated
disk.
I don't think this is true. Both LVs (lvmthin) and SAN LUNs can
support sparse allocation meaningfully.
In any case it sounds like we need to know if the storage domain
corresponds to file or block storage, or else just force non-sparse
everywhere. I'm going to force non-sparse for now, and add an 'XXX'
comment about it.
I guess you can check if a storage domain is file based or block
basedu
using the SDK, but I'm not familiar with it.
OK.
Daniel, do we expose this info?
> [snipped]
> >
> > > +# Can we issue zero, trim or flush requests?
> > >
> > +def get_options(h):
> > > + if h['got_options']:
> > > + return
> > > + h['got_options'] = True
> > > +
> > > + http = h['http']
> > > + transfer=h['transfer']
> > > +
> > > + http.putrequest("OPTIONS", h['path'])
> > > + http.putheader("Authorization", transfer.signed_ticket)
> > > + http.endheaders()
> > > +
> > > + r = http.getresponse()
> > > + if r.status == 200:
> > > + j = json.loads(r.read())
> > + h['can_zero'] = "zero" in j['features']
> > > + h['can_trim'] = "trim" in
j['features']
> > > + h['can_flush'] = "flush" in
j['features']
> > > +
> > > + # If can_zero is true then it means we're using the new
> imageio
> > > + # which never needs the Authorization header.
> > > + if h['can_zero']:
> > > + h['needs_auth'] = False
>
In older proxy, we do support OPTIONS, used for allowing access
from enigne UI, but it does not return any content. Fortunately, we
return httplib.NO_CONTENT so it is easy to detect.
So we need to handle gracefully r.status = 204
OK done.
> > >
> >
> > If we got here, we are working with new daemon or proxy, and both
> > of them do not need auth, so we can set 'needs_auth' to False
> > if OPTIONS returned 200 OK.
>
> Which is what this code does, unless I'm misunderstanding things.
>
Accessing readonly ticket will return empty features list, and
h['needs_auth']
will be True, while this server does not need auth. Yes, it cannot happen
with this code but it is not the right check.
Right, I reread what you said originally and it makes sense after a
good nights sleep, thanks!
Rich.
--
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.
http://people.redhat.com/~rjones/virt-df/