Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement option vmtype to select between raw or qcow2 #182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

paulmenzel
Copy link
Contributor

No description provided.

qcow2 is a growable format not taking so much space from the beginning.
Instead of creating a raw image and converting it to qcow2 with
`qemu-img convert`

    $ qemu-img convert -f raw -O qcow2 debian.img debian.qcow2

add a switch `--vmtype` allowing to specify the type of the virtual
machine file, which is used in `qemu-img create -f`.

It looks like though, installing the system into that file using NBD is
twice as slow.

    $ sudo ~/src/grml-debootstrap/grml-debootstrap --arch amd64 --release sid --filesystem ext4 --vmfile
Copy link
Member

@mika mika left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not yet convinced that we should support this from within grml-debootstrap, tbh. :)

You write:

It looks like though, installing the system into that file using NBD is twice as slow.

So what's the actual reason, to not install it into raw format as-is, and then convert to the format as needed?

Also all the qemu-nbd actions around /dev/nbd0 seem to ask for trouble AFAICS, what about e.g. if the device is used elsewhere already? :-/
(Not commenting on other code changes themselves yet)

@paulmenzel
Copy link
Contributor Author

paulmenzel commented Jun 15, 2021

I'm not yet convinced that we should support this from within grml-debootstrap, tbh. :)

You write:

It looks like though, installing the system into that file using NBD is twice as slow.

So what's the actual reason, to not install it into raw format as-is, and then convert to the format as needed?

I only came up with this, because on the “build machine” you do not always have 100 GB of free space for the raw image.

Also all the qemu-nbd actions around /dev/nbd0 seem to ask for trouble AFAICS, what about e.g. if the device is used elsewhere already? :-/
(Not commenting on other code changes themselves yet)

Yes, I have to figure out – the same with kpartx – how to get the correct device.

Comment on lines +321 to 326
eend $?
else
einfo "Removing loopback mount of file ${ORIG_TARGET}."
qemu-nbd -d /dev/nbd0
fi
eend $?
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paulmenzel Just a quick question: you moved eend $?. Any reason for not keeping it at the end?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. That’s an oversight no my part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants