machacekondra / imageiotest

Container providing ImageIO functionality for tests
1 stars 2 forks source link

Use nbd backend #3

Open nirs opened 4 years ago

nirs commented 4 years ago

You use the file backend:

curl --unix-socket /ovirt-imageio/daemon/test/daemon.sock -X PUT -d '{"uuid": "cirros", "size": 46137344, "url": "file:///images/cirros.img", "timeout": 30000000000000, "ops": ["read"]}' http://localhost:12345/tickets/cirros && \

But this backend does not support the extents API, so you will not be able to test efficient downloads.

To use nbd backend you can add:

(qemu-nbd --persistant --socket=/tmp/cirros.sock --shared=8 --read-only  --cache=none --aio=native --format raw images/cirros.img &)

curl --unix-socket /ovirt-imageio/daemon/test/daemon.sock -X PUT -d '{"uuid": "cirros", "size": 46137344, "url": "nbd:unix:/tmp/cirros.sock", "timeout": 30000000000000, "ops": ["read"]}' http://localhost:12345/tickets/cirros && \

With this you can get image extents, for example:

curl -k https://localhost:12345/images/cirros/extents
nirs commented 4 years ago

@machacekondra please check the updated example for nbd backend usage: https://gerrit.ovirt.org/c/110106