Skip to contentSkip to conversation

rbd STDIN import does not work / wip-rbd-export-stdout

DISCUSSION Stefan Priebe - Profihost AG 4 participants 15 messages Nov 26, 2012 – Dec 2, 2012

lore
Share & tools
lore
#0 lore raw

Hello list,

i know branch wip-rbd-export-stdout is work in progress but it is more than useful ;-)

When i try to import an image i get:

# gzip -dc vm-101-disk-1.img.gz | rbd import --format=2 --size=42949672960 - kvmpool1/vm-101-disk-1
rbd: error reading file: (29) Illegal seek
Importing image: 0% complete...failed.
rbd: import failed: (29) Illegal seek

Anything i've tried wrong?

Greets,
Stefan

#1 lore raw

Well...

Quoted 6 lines · Stefan Priebe - Profihost AG

Hello list,

i know branch wip-rbd-export-stdout is work in progress but it is more than useful ;-)

When i try to import an image i get:

Quoted 7 lines
# gzip -dc vm-101-disk-1.img.gz | rbd import --format=2 
--size=42949672960 - kvmpool1/vm-101-disk-1
rbd: error reading file: (29) Illegal seek
Importing image: 0% complete...failed.
rbd: import failed: (29) Illegal seek

Anything i've tried wrong?

I would assume, that size is already in MiB? Seems to be a slightly too big value... Not tried myself, though...

Oliver.

Quoted 7 lines

Greets,
Stefan

Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 15 lines
Oliver Francke

filoo GmbH
Moltkestraße 25a
33330 Gütersloh
HRB4355 AG Gütersloh

Geschäftsführer: S.Grewing | J.Rehpöhler | C.Kunz

Folgen Sie uns auf Twitter: http://twitter.com/filoogmbh

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw

Am 26.11.2012 14:29, schrieb Oliver Francke:

Quoted 1 line

Well...

makes no difference:
gzip -dc vm-101-disk-1.img.gz | rbd import --format=2 --size=40960 - kvmpool1/vm-101-disk-1
rbd: error reading file: (29) Illegal seek
Importing image: 0% complete...failed.
rbd: import failed: (29) Illegal seek

I think the problem is that ceph seeks in File when it get's zeros (not filled content). But seeking doesn't work on stdin. It has to read from stdin until there are no more zeros.

Stefan

Quoted 30 lines · Stefan Priebe - Profihost AG
Quoted 7 lines

Hello list,

i know branch wip-rbd-export-stdout is work in progress but it is more than useful ;-)

When i try to import an image i get:

Quoted 7 lines
# gzip -dc vm-101-disk-1.img.gz | rbd import --format=2
--size=42949672960 - kvmpool1/vm-101-disk-1
rbd: error reading file: (29) Illegal seek
Importing image: 0% complete...failed.
rbd: import failed: (29) Illegal seek

Anything i've tried wrong?

I would assume, that size is already in MiB? Seems to be a slightly too big value... Not tried myself, though...

Oliver.

Quoted 7 lines

Greets,
Stefan
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

Yes, it's broken too (there's an issue open on it). I have some test code done over the weekend
and will be pushing it after review.

Be aware that import/export to stdin/stdout are limited in that they cannot preserve sparseness
of the image, but they should both be working soon at least.

Quoted 54 lines · Stefan Priebe - Profihost AG

Am 26.11.2012 14:29, schrieb Oliver Francke:

Quoted 2 lines

Well...

makes no difference:
gzip -dc vm-101-disk-1.img.gz | rbd import --format=2 --size=40960 - kvmpool1/vm-101-disk-1

rbd: error reading file: (29) Illegal seek
Importing image: 0% complete...failed.
rbd: import failed: (29) Illegal seek

I think the problem is that ceph seeks in File when it get's zeros (not filled content). But seeking doesn't work on stdin. It has to read from stdin until there are no more zeros.

Stefan

Quoted 33 lines · Stefan Priebe - Profihost AG
Quoted 8 lines

Hello list,

i know branch wip-rbd-export-stdout is work in progress but it is more than useful ;-)

When i try to import an image i get:

Quoted 7 lines
# gzip -dc vm-101-disk-1.img.gz | rbd import --format=2
--size=42949672960 - kvmpool1/vm-101-disk-1
rbd: error reading file: (29) Illegal seek
Importing image: 0% complete...failed.
rbd: import failed: (29) Illegal seek

Anything i've tried wrong?

I would assume, that size is already in MiB? Seems to be a slightly too big value... Not tried myself, though...

Oliver.

Quoted 7 lines

Greets,
Stefan
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

Hi,

Export isn't a problem. But import should handle this correctly. Or does it write zeros to the object file

But even if it write zeros to the file shouldn't a fstrim fix this?

Stefan

Am 26.11.2012 um 18:34 schrieb Dan Mick <[email protected]>:

Quoted 64 lines

Yes, it's broken too (there's an issue open on it). I have some test code done over the weekend
and will be pushing it after review.

Be aware that import/export to stdin/stdout are limited in that they cannot preserve sparseness
of the image, but they should both be working soon at least.

Quoted 13 lines · Stefan Priebe - Profihost AG

Am 26.11.2012 14:29, schrieb Oliver Francke:

Quoted 2 lines

Well...

makes no difference:
gzip -dc vm-101-disk-1.img.gz | rbd import --format=2 --size=40960 - kvmpool1/vm-101-disk-1

rbd: error reading file: (29) Illegal seek
Importing image: 0% complete...failed.
rbd: import failed: (29) Illegal seek

Quoted 37 lines

I think the problem is that ceph seeks in File when it get's zeros (not filled content). But seeking doesn't work on stdin. It has to read from stdin until there are no more zeros.

Stefan

Quoted 30 lines · Stefan Priebe - Profihost AG
Quoted 8 lines

Hello list,

i know branch wip-rbd-export-stdout is work in progress but it is more than useful ;-)

When i try to import an image i get:

Quoted 7 lines
# gzip -dc vm-101-disk-1.img.gz | rbd import --format=2
--size=42949672960 - kvmpool1/vm-101-disk-1
rbd: error reading file: (29) Illegal seek
Importing image: 0% complete...failed.
rbd: import failed: (29) Illegal seek

Anything i've tried wrong?

I would assume, that size is already in MiB? Seems to be a slightly too big value... Not tried myself, though...

Oliver.

Quoted 7 lines

Greets,
Stefan
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw

It writes zeros; there's no way for it to know how many zeros are coming. It could make a half-hearted attempt depending on its buffer size and the amount of data the source is willing to buffer.

As for fstrim: on the rbd image?....sure, if it's a filesystem, it ought to work (modulo some bugs I've heard about with 32-bit vs. 64-bit offsets in qemu... :) )

Quoted 74 lines · Stefan Priebe - Profihost AG

Hi,

Export isn't a problem. But import should handle this correctly. Or does it write zeros to the object file

But even if it write zeros to the file shouldn't a fstrim fix this?

Stefan

Am 26.11.2012 um 18:34 schrieb Dan Mick <[email protected]>:

Quoted 64 lines

Yes, it's broken too (there's an issue open on it). I have some test code done over the weekend
and will be pushing it after review.

Be aware that import/export to stdin/stdout are limited in that they cannot preserve sparseness
of the image, but they should both be working soon at least.

Quoted 13 lines · Stefan Priebe - Profihost AG

Am 26.11.2012 14:29, schrieb Oliver Francke:

Quoted 2 lines

Well...

makes no difference:
gzip -dc vm-101-disk-1.img.gz | rbd import --format=2 --size=40960 - kvmpool1/vm-101-disk-1

rbd: error reading file: (29) Illegal seek
Importing image: 0% complete...failed.
rbd: import failed: (29) Illegal seek

Quoted 37 lines

I think the problem is that ceph seeks in File when it get's zeros (not filled content). But seeking doesn't work on stdin. It has to read from stdin until there are no more zeros.

Stefan

Quoted 30 lines · Stefan Priebe - Profihost AG
Quoted 8 lines

Hello list,

i know branch wip-rbd-export-stdout is work in progress but it is more than useful ;-)

When i try to import an image i get:

Quoted 7 lines
# gzip -dc vm-101-disk-1.img.gz | rbd import --format=2
--size=42949672960 - kvmpool1/vm-101-disk-1
rbd: error reading file: (29) Illegal seek
Importing image: 0% complete...failed.
rbd: import failed: (29) Illegal seek

Anything i've tried wrong?

I would assume, that size is already in MiB? Seems to be a slightly too big value... Not tried myself, though...

Oliver.

Quoted 7 lines

Greets,
Stefan
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw

Am 26.11.2012 21:00, schrieb Dan Mick:

Quoted 3 lines

It writes zeros; there's no way for it to know how many zeros are coming. It could make a half-hearted attempt depending on its buffer size and the amount of data the source is willing to buffer.

Yes OK that's correct. Maybe the buffer should be the size of a rados object / stripe size? So a whole stripe containing zeros could be ignored?

Quoted 3 lines

As for fstrim: on the rbd image?....sure, if it's a filesystem, it ought to work (modulo some bugs I've heard about with 32-bit vs. 64-bit offsets in qemu... :) )

it works fine with my patches i send to qemu. But right now they're no upstream an nobody of the qemu people answers anymore. So right now i'll keep my patches and be lucky others can't use RBD and fstrim. So maybe inktank should push this a bit more to the qemu people.

Stefan

Quoted 83 lines · Stefan Priebe - Profihost AG
Quoted 78 lines

Hi,

Export isn't a problem. But import should handle this correctly. Or does it write zeros to the object file

But even if it write zeros to the file shouldn't a fstrim fix this?

Stefan

Am 26.11.2012 um 18:34 schrieb Dan Mick <[email protected]>:

Quoted 67 lines

Yes, it's broken too (there's an issue open on it). I have some test code done over the weekend
and will be pushing it after review.

Be aware that import/export to stdin/stdout are limited in that they cannot preserve sparseness
of the image, but they should both be working soon at least.

Quoted 13 lines · Stefan Priebe - Profihost AG

Am 26.11.2012 14:29, schrieb Oliver Francke:

Quoted 2 lines

Well...

makes no difference:
gzip -dc vm-101-disk-1.img.gz | rbd import --format=2 --size=40960 - kvmpool1/vm-101-disk-1

rbd: error reading file: (29) Illegal seek
Importing image: 0% complete...failed.
rbd: import failed: (29) Illegal seek

Quoted 40 lines

I think the problem is that ceph seeks in File when it get's zeros (not filled content). But seeking doesn't work on stdin. It has to read from stdin until there are no more zeros.

Stefan

Quoted 33 lines · Stefan Priebe - Profihost AG
Quoted 9 lines

Hello list,

i know branch wip-rbd-export-stdout is work in progress but it is more
than useful ;-)

When i try to import an image i get:

Quoted 7 lines
# gzip -dc vm-101-disk-1.img.gz | rbd import --format=2
--size=42949672960 - kvmpool1/vm-101-disk-1
rbd: error reading file: (29) Illegal seek
Importing image: 0% complete...failed.
rbd: import failed: (29) Illegal seek

Anything i've tried wrong?

I would assume, that size is already in MiB? Seems to be a slightly too
big value... Not tried myself, though...

Oliver.

Quoted 8 lines

Greets,
Stefan
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
Quoted 8 lines · Stefan Priebe - Profihost AG

Am 26.11.2012 21:00, schrieb Dan Mick:

Quoted 3 lines

As for fstrim: on the rbd image?....sure, if it's a filesystem, it ought to work (modulo some bugs I've heard about with 32-bit vs. 64-bit offsets in qemu... :) )

it works fine with my patches i send to qemu. But right now they're no upstream an nobody of the qemu people answers anymore. So right now i'll keep my patches and be lucky others can't use RBD and fstrim. So maybe inktank should push this a bit more to the qemu people.

If you could send another version with PATCHv3 instead of PATCH in the subject, and a description of the changes since the last version between the --- and the diffstat, the qemu folks would probably appreciate it.

scripts/checkpatch.pl in qemu.git will warn you about style issues like the conditionals without braces.

Josh

#8 lore raw

Am 27.11.2012 23:50, schrieb Josh Durgin:

Quoted 5 lines · Stefan Priebe - Profihost AG
Quoted 4 lines

Am 26.11.2012 21:00, schrieb Dan Mick:

Quoted 3 lines

As for fstrim: on the rbd image?....sure, if it's a filesystem, it ought to work (modulo some bugs I've heard about with 32-bit vs. 64-bit offsets in qemu... :) )

Quoted 8 lines
Quoted 4 lines

it works fine with my patches i send to qemu. But right now they're no upstream an nobody of the qemu people answers anymore. So right now i'll keep my patches and be lucky others can't use RBD and fstrim. So maybe inktank should push this a bit more to the qemu people.

If you could send another version with PATCHv3 instead of PATCH in the subject, and a description of the changes since the last version between the --- and the diffstat, the qemu folks would probably appreciate it.

No idea how to archieve this with git send-email ;-( But still more important is also the patch for discards...

Quoted 2 lines

scripts/checkpatch.pl in qemu.git will warn you about style issues like the conditionals without braces.

Thank!

0001-rbd-block-driver-fix-race-between-aio-completition-a.patch has no obvious style problems and is ready for submission.

Stefan

#9 lore raw
Quoted 12 lines · Stefan Priebe - Profihost AG

Am 27.11.2012 23:50, schrieb Josh Durgin:

Quoted 11 lines · Stefan Priebe - Profihost AG
Quoted 9 lines

Am 26.11.2012 21:00, schrieb Dan Mick:

Quoted 4 lines

As for fstrim: on the rbd image?....sure, if it's a filesystem, it ought
to work (modulo some bugs I've heard about with 32-bit vs. 64-bit offsets in qemu... :) )

it works fine with my patches i send to qemu. But right now they're no upstream an nobody of the qemu people answers anymore. So right now i'll keep my patches and be lucky others can't use RBD and fstrim. So maybe inktank should push this a bit more to the qemu people.

Quoted 6 lines
Quoted 3 lines

If you could send another version with PATCHv3 instead of PATCH in the subject, and a description of the changes since the last version between the --- and the diffstat, the qemu folks would probably appreciate it.

No idea how to archieve this with git send-email ;-( But still more important is also the patch for discards...

Use git format-patch, edit the patch file (it includes the basic headers already), then send it with git send-email.

Your return value type change was already merged into master of qemu.git as 08448d5195aeff49bf25fb62b4a6218f079f5284.

Josh

#10 lore raw

Hi Josh,

Am 28.11.2012 19:51, schrieb Josh Durgin:

Quoted 5 lines
Quoted 2 lines

No idea how to archieve this with git send-email ;-( But still more important is also the patch for discards...

Use git format-patch, edit the patch file (it includes the basic headers already), then send it with git send-email.

done / fixed

Quoted 2 lines

Your return value type change was already merged into master of qemu.git as 08448d5195aeff49bf25fb62b4a6218f079f5284.

Oh thanks i didn't get a reply that it is applied.

Stefan

#11 lore raw
In reply to Stefan Priebe - Profihost AG

Hi Dan,

thanks for your update / new import-export branch.

The import seems to work now. What i'm wondering is that it is really slow.

I see around 10% CPU Usage on importing host (host where rbd import is started) and just 4MB every 2s raising Data on ceph. This means 40GB took around 5-6 hours.

Night this be due to he size update? 4MB every 2s looks like the stripe size.

Greets,
Stefan

#12 lore raw
Quoted 9 lines · Stefan Priebe - Profihost AG

Hi Dan,

thanks for your update / new import-export branch.

The import seems to work now. What i'm wondering is that it is really slow.

I see around 10% CPU Usage on importing host (host where rbd import is started) and just 4MB every 2s raising Data on ceph. This means 40GB took around 5-6 hours.

Night this be due to he size update? 4MB every 2s looks like the stripe size.

I did change the resize to double each time to help with that before pushing to master, but that still seems awfully slow. You should definitely use the version in the mainline, though; it's better in several ways.

Are these particularly sparse images? I'm testing a "preserve sparseness" tweak that should help a lot if so (and save space in the cluster, obviously).

#13 lore raw
In reply to Stefan Priebe - Profihost AG

Hi Dan,

Am 27.11.2012 10:16, schrieb Stefan Priebe - Profihost AG:

Quoted 4 lines

Am 26.11.2012 21:00, schrieb Dan Mick:

Quoted 3 lines

It writes zeros; there's no way for it to know how many zeros are coming. It could make a half-hearted attempt depending on its buffer size and the amount of data the source is willing to buffer.

Yes but why not skip at leas if the WHOLE BUFFER is zero and then use the buffer size = stripe size?

Right now a 40GB image which has just 3GB used rest is zeros due to using fstrim before doing the export takes a long time to import. We could speed this up a lot if we would skip parts with only zeros.

Greets,
Stefab

#14 lore raw
Quoted 11 lines · Stefan Priebe

Hi Dan,

Am 27.11.2012 10:16, schrieb Stefan Priebe - Profihost AG:

Quoted 4 lines

Am 26.11.2012 21:00, schrieb Dan Mick:

Quoted 3 lines

It writes zeros; there's no way for it to know how many zeros are coming. It could make a half-hearted attempt depending on its buffer size and the amount of data the source is willing to buffer.

Yes but why not skip at leas if the WHOLE BUFFER is zero and then use the buffer size = stripe size?

Right now a 40GB image which has just 3GB used rest is zeros due to using fstrim before doing the export takes a long time to import. We could speed this up a lot if we would skip parts with only zeros.

Great minds! I'm actually working on that now; as you say it's not hard.

Quoted 2 lines

Greets,
Stefab