Re: [Libguestfs] few things I found about virt-p2v
[Please keep replies on the list] On Sat, Mar 30, 2019 at 02:24:36PM +0300, Hetz Ben Hamo wrote:
I spent the last few hours playing with virt-p2v, and here are few things that I found, please tell me on which to submit a bug report:
1. I created a boot image (without any parameters) and tested it using virt-manager. With QXL driver, when it loads the Xorg, it shows .. a blank screen (I tried it tens of times). With VirtIO it works.
Unclear, you'd probably need to look at the logs from the virtual machine to see what's going on.
I mean the screen is totally blank after it boots and tries to go to X. You cannot type or see anything. if you want, I can record a video and show it to you.
A video is not going to help. Press the key to get to the console after boot ([Alt]+[Ctrl]+[F2] or something similar) and have a look at the journalctl output.
3. There network to connect to - I think GUI wise, that it's not understandable that you need to click the word "default" and change the name manually. Perhaps change the name from "default" to something like "Type Network Name"?
Where exactly is this in the UI?
In the right bottom side, where you see the nic MAC address and near it by default you see the word "Default".
I'm not exactly sure, but if it's the "Network interfaces" section of the second page of the wizard then that is the network that we try to connect to.
4. Looks like there is no way to type a pool name to export to (if I select libvirt) or am I missing something? (let's say I have a pool called NAS-10G). In the -os field I'm trying to put the NAS-10G (as the virt-v2v man page suggests), but this seems not work.
Put the pool name into the storage (-os) field.
that's the problem. Once I remove the default "/var/tmp" and try to put my pool name and starts the conversion, it thinks that I'm using the Local mode (and I selected the libvirt mode) and when it finishes and it fails, the end of the log shows:
virt-v2v: error: -o libvirt: output pool ‘NAS-10G’ is not a directory (type='dir'). See virt-v2v-output-local(1)
It could well be a bug, but take a look at the virt-p2v logs which are saved under /tmp/virt-p2v-* on the conversion server. That will tell you what exact command line was used. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
On Sat, Mar 30, 2019 at 4:23 PM Richard W.M. Jones <rjones@redhat.com> wrote:
[Please keep replies on the list]
I wasn't approved yet by moderator ;)
4. Looks like there is no way to type a pool name to export to (if I select libvirt) or am I missing something? (let's say I have a pool called NAS-10G). In the -os field I'm trying to put the NAS-10G (as the virt-v2v man page suggests), but this seems not work.
Put the pool name into the storage (-os) field.
that's the problem. Once I remove the default "/var/tmp" and try to put my pool name and starts the conversion, it thinks that I'm using the Local mode (and I selected the libvirt mode) and when it finishes and it fails, the end of the log shows:
virt-v2v: error: -o libvirt: output pool ‘NAS-10G’ is not a directory (type='dir'). See virt-v2v-output-local(1)
It could well be a bug, but take a look at the virt-p2v logs which are saved under /tmp/virt-p2v-* on the conversion server. That will tell you what exact command line was used.
I did, and I'm enclosing gzipped copy of the file. Line 4197 clearly shows it got the correct parameter: Initializing the target -o libvirt -os NAS-10G
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
On Sat, Mar 30, 2019 at 04:32:31PM +0300, Hetz Ben Hamo wrote:
On Sat, Mar 30, 2019 at 4:23 PM Richard W.M. Jones <rjones@redhat.com> wrote:
It could well be a bug, but take a look at the virt-p2v logs which are saved under /tmp/virt-p2v-* on the conversion server. That will tell you what exact command line was used.
I did, and I'm enclosing gzipped copy of the file. Line 4197 clearly shows it got the correct parameter: Initializing the target -o libvirt -os NAS-10G
Ah I see. This is a limitation: https://github.com/libguestfs/libguestfs/blob/f79129b8dc92470e3a5597daf53c84... Actually not one that I recall from before (the vast majority of people using virt-p2v are either creating a file or writing to RHV/OpenStack/etc). However this should be easy enough to work around: Set the output (-os) to some directory on the conversion appliance with plenty of space. Do the conversion, you'll end up with a libvirt XML file and the disk images as files. Then use normal ‘virsh’ commands to copy the disk images to the pool you actually want to use, adjust the libvirt XML to point to the pool, and create the VM also using ‘virsh’ commands. Would suggest reading the libvirt documentation if unsure about these steps. 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/
I did, and I'm enclosing gzipped copy of the file. Line 4197 clearly shows it got the correct parameter: Initializing the target -o libvirt -os NAS-10G
Ah I see. This is a limitation:
https://github.com/libguestfs/libguestfs/blob/f79129b8dc92470e3a5597daf53c84...
I see. This situation is great if someone wants to move 1 VM from Hyper-V (for example) to a laptop or to a workstation where he/she is using virt-manager.
Actually not one that I recall from before (the vast majority of people using virt-p2v are either creating a file or writing to RHV/OpenStack/etc).
I got 2 more questions: 1. Is it possible to add to the virt-p2v-make-disk program a parameter to add kernel parameters? (right now I have to create the image and edit manually the grub.conf file in the image in order to edit them) - this could help in situations where someone cannot setup PXE. 2. Is there a way to create the image as a bootable ISO? Hyper-V for example, doesn't like standard "hard disk" images. I see that kiwi has this functionality, but it's only for SuSE. Thanks again
On Sat, Mar 30, 2019 at 05:19:55PM +0300, Hetz Ben Hamo wrote:
I did, and I'm enclosing gzipped copy of the file. Line 4197 clearly shows it got the correct parameter: Initializing the target -o libvirt -os NAS-10G
Ah I see. This is a limitation:
https://github.com/libguestfs/libguestfs/blob/f79129b8dc92470e3a5597daf53c84...
I see. This situation is great if someone wants to move 1 VM from Hyper-V (for example) to a laptop or to a workstation where he/she is using virt-manager.
Actually not one that I recall from before (the vast majority of people using virt-p2v are either creating a file or writing to RHV/OpenStack/etc).
I got 2 more questions:
1. Is it possible to add to the virt-p2v-make-disk program a parameter to add kernel parameters? (right now I have to create the image and edit manually the grub.conf file in the image in order to edit them) - this could help in situations where someone cannot setup PXE.
The real issue here is what file in the image to edit and how. You could try editing virt-p2v-make-disk (or a local copy of it) and add something to the long virt-builder command right near the end of the file. I would suggest adding an --edit option such as: --edit '/etc/grub/grub.conf: s/linux (.*)/linux $1 your_parameter=foo/' \
2. Is there a way to create the image as a bootable ISO? Hyper-V for example, doesn't like standard "hard disk" images. I see that kiwi has this functionality, but it's only for SuSE.
I actually tried at one point to create a bootable ISO from a virt-builder image, but totally failed to make anything work ... You could try the kickstart approach (ie. virt-p2v-make-kickstart) but then you're in a world of other painful tools such as livecd-creator. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Hi,
1. Is it possible to add to the virt-p2v-make-disk program a parameter
to add kernel parameters? (right now I have to create the image and edit manually the grub.conf file in the image in order to edit them) - this could help in situations where someone cannot setup PXE.
The real issue here is what file in the image to edit and how.
You could try editing virt-p2v-make-disk (or a local copy of it) and add something to the long virt-builder command right near the end of the file. I would suggest adding an --edit option such as:
--edit '/etc/grub/grub.conf: s/linux (.*)/linux $1 your_parameter=foo/' \
At the end I simply used guestmount to mount the image, and edited manually the /boot/grub2/grub.cfg and added the parameters.
BTW: I couldn't find a way to tell it to map the NIC to a bridge in the virt-manager, which parameter should it be?
2. Is there a way to create the image as a bootable ISO? Hyper-V for example, doesn't like standard "hard disk" images. I see that kiwi has this functionality, but it's only for SuSE.
I actually tried at one point to create a bootable ISO from a virt-builder image, but totally failed to make anything work ... You could try the kickstart approach (ie. virt-p2v-make-kickstart) but then you're in a world of other painful tools such as livecd-creator.
I found a workaround for this - qemu-img convert to VHDX, then - no need for ISO ;) Thanks for your help. I hope within the next few hours to record a video and upload to youtube about using virt-p2v.
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
participants (2)
-
Hetz Ben Hamo -
Richard W.M. Jones