-
Notifications
You must be signed in to change notification settings - Fork 985
Allow instance import from QCoW2 and VMDK format #13385
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
Conversation
|
Heads up @ru-fu - the "Documentation" label was applied to this issue. |
0c4b4ea to
1cbf3cd
Compare
f51053f to
f78b84b
Compare
|
For tests we could use VMDK images provided on ubuntu cloud (https://cloud-images.ubuntu.com/releases/22.04/release-20240514). They are a bit bulky (~600MiB), but offer a reliable way to get images without the need to prepare them during the tests or store pre-build image within a repository. |
Sounds good, thanks. |
|
Are there ubuntu-minimal variants we can use that are smaller? |
|
I couldn't find one, but it would very practical to use minimal images. |
2b81fb4 to
eb4a929
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its somewhat concerning me that this implementation for image conversion has been implemented inside the migration functions.
I realise the lxd-migrate tool uses the migration protocol, but as the migration handlers are already quite complex, I'm wondering if we should take this opportunity to add a new function to the storage subsystem CreateInstanceFromConversion and then separate the handlers entirely.
Even if no conversion options are being used (i.e straight raw import too).
What do you think?
…Migration Signed-off-by: Din Music <[email protected]>
The volume size of the imported VM disk is: 1. User specified storage pool and volume size - respect even if image won't fit in the pool (error out in such case). 2. User did not specify volume size - depends on conversion option format: a) format is enabled: Use the size of the uncompressed image (we get that info from qemu-img info) b) format is disabled: Use the value from SourceDiskSize field - We need to know the volume size before copying the image / disk as it will go directly into the volume. Signed-off-by: Din Music <[email protected]>
…ol from devices Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
…r conversion API Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
… is in raw format Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
Signed-off-by: Din Music <[email protected]>
tomponline
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This is first part of the [Improve VM import from external sources](https://discourse.ubuntu.com/t/improve-vm-import-from-external-sources/41762). It introduces the new migration source type `conversion`, which ensures the received image is converted using `qemu-img` into the raw image format. All virt-v2v bits are stripped away and will be introduced in the second part where we will also introduce conversion option `virtio` which will run virt-v2v-in-place on converted image to ensure virtio drivers are present. --- TODO: - [x] qemu-img info is not provided with image format explicitly ([Comment on spec](https://discourse.ubuntu.com/t/improve-vm-import-from-external-sources/41762/15)) - [x] conversionOpts: `--conversion=format` (list of conversion options) - [x] Add tests for conversion (canonical/lxd-ci#179) Signed-off-by: hamistao <[email protected]>
Wrong path is passed to the `isImageTypeRaw` check. Introduced in #13385
This PR adds new conversion option `virtio` (disabled by default). When enabled, LXD invokes `virt-v2v-in-place` tool on the host to inject virtio drivers into the image. For Windows images, additional drivers need to be present in `/usr/share/virt-tools`. This requires: - For rebase: #13385 - Custom command in LXD snap to invoke virt-v2v-in-place on the host: canonical/lxd-pkg-snap#510
This is first part of the Improve VM import from external sources.
It introduces the new migration source type
conversion, which ensures the received image is converted usingqemu-imginto the raw image format.All virt-v2v bits are stripped away and will be introduced in the second part where we will also introduce conversion option
virtiowhich will run virt-v2v-in-place on converted image to ensure virtio drivers are present.TODO:
--conversion=format(list of conversion options)