Re: [Libguestfs] oVirt import from VMware
Thanks for sending the disk image across. With latest libguestfs and guestfs-tools I am able to inspect the image fine: $ rpm -q guestfs-tools libguestfs guestfs-tools-1.47.2-1.fc35.x86_64 libguestfs-1.45.6-6.fc35.x86_64 $ tar xf SoftdriveTest.ova SoftdriveTest2-disk1.vmdk $ virt-inspector -a SoftdriveTest2-disk1.vmdk <?xml version="1.0"?> <operatingsystems> <operatingsystem> <root>/dev/sda2</root> <name>windows</name> <arch>x86_64</arch> <distro>windows</distro> <product_name>Windows 10 Home</product_name> <product_variant>Client</product_variant> <major_version>10</major_version> <minor_version>0</minor_version> <windows_systemroot>/Windows</windows_systemroot> <windows_current_control_set>ControlSet001</windows_current_control_set> <osinfo>win10</osinfo> <mountpoints> <mountpoint dev="/dev/sda2">/</mountpoint> </mountpoints> ... Recent virt-v2v gets further, but hits an issue because the guest is using Fast Restart: $ rpm -q virt-v2v virt-v2v-1.45.1-1.fc35.x86_64 $ virt-v2v -i ova SoftdriveTest.ova -o null [ 0.0] Opening the source -i ova SoftdriveTest.ova [ 166.6] Creating an overlay to protect the source from being modified [ 166.7] Opening the overlay [ 173.0] Inspecting the overlay virt-v2v: error: filesystem was mounted read-only, even though we asked for it to be mounted read-write. This usually means that the filesystem was not cleanly unmounted. Possible causes include trying to convert a guest which is running, or using Windows Hibernation or Fast Restart. (https://libguestfs.org/virt-v2v.1.html#windows-8-fast-startup-is-incompatibl...) Looking at the detailed log, the inspection step was fine. Therefore I think it should work fine if Fast Restart was disabled before conversion. I went back to the old version of libguestfs you're using (1.40) virt-inspector shows pretty similar output to your virt-v2v log. However when I looked closer I found that guestfish cannot mount the /dev/sda2 partition from this disk at all. I'm not at all clear why. I guess it might be fast restart or something else (too old ntfs-3g?) Anyway since it works with recent libguestfs/virt-v2v, I would suggest upgrading to a later version and disabling Fast Restart in Windows guests before conversion, which together should solve the problem. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
When we powered off VMs through vCenter prior to exporting/importing, sometimes it would complain about failing to mount /dev/sda2: Failed to mount '/dev/sda2': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option. ocaml_exn: 'mount' raised 'Failure' exception guestfsd: error: mount exited with status 14: The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sda2': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option. guestfsd: => mount (0x1) took 0.03 secs libguestfs: trace: v2v: mount = -1 (error) virt-v2v: error: unable to mount the disk image for writing. This has probably happened because Windows Hibernation or Fast Restart is being used in this guest. You have to disable this (in the guest) in order to use virt-v2v. After this, we started always shutting off the VMs inside the Guest OS via shift-shutdown. This resolved the error above. However, the guests do not support Hibernate / Fast Shutdown: PS C:\WINDOWS\system32> powercfg /a The following sleep states are not available on this system: Standby (S1) An internal system component has disabled this standby state. Graphics Standby (S2) The system firmware does not support this standby state. An internal system component has disabled this standby state. Graphics Standby (S3) The system firmware does not support this standby state. An internal system component has disabled this standby state. Graphics Hibernate The system firmware does not support hibernation. Standby (S0 Low Power Idle) The system firmware does not support this standby state. Hybrid Sleep Standby (S3) is not available. Hibernation is not available. Fast Startup Hibernation is not available. Thanks! - Alan On Fri, Jun 18, 2021 at 6:27 AM Richard W.M. Jones <rjones@redhat.com> wrote:
Thanks for sending the disk image across.
With latest libguestfs and guestfs-tools I am able to inspect the image fine:
$ rpm -q guestfs-tools libguestfs guestfs-tools-1.47.2-1.fc35.x86_64 libguestfs-1.45.6-6.fc35.x86_64
$ tar xf SoftdriveTest.ova SoftdriveTest2-disk1.vmdk $ virt-inspector -a SoftdriveTest2-disk1.vmdk <?xml version="1.0"?> <operatingsystems> <operatingsystem> <root>/dev/sda2</root> <name>windows</name> <arch>x86_64</arch> <distro>windows</distro> <product_name>Windows 10 Home</product_name> <product_variant>Client</product_variant> <major_version>10</major_version> <minor_version>0</minor_version> <windows_systemroot>/Windows</windows_systemroot>
<windows_current_control_set>ControlSet001</windows_current_control_set> <osinfo>win10</osinfo> <mountpoints> <mountpoint dev="/dev/sda2">/</mountpoint> </mountpoints> ...
Recent virt-v2v gets further, but hits an issue because the guest is using Fast Restart:
$ rpm -q virt-v2v virt-v2v-1.45.1-1.fc35.x86_64
$ virt-v2v -i ova SoftdriveTest.ova -o null [ 0.0] Opening the source -i ova SoftdriveTest.ova [ 166.6] Creating an overlay to protect the source from being modified [ 166.7] Opening the overlay [ 173.0] Inspecting the overlay virt-v2v: error: filesystem was mounted read-only, even though we asked for it to be mounted read-write. This usually means that the filesystem was not cleanly unmounted. Possible causes include trying to convert a guest which is running, or using Windows Hibernation or Fast Restart.
( https://libguestfs.org/virt-v2v.1.html#windows-8-fast-startup-is-incompatibl... )
Looking at the detailed log, the inspection step was fine. Therefore I think it should work fine if Fast Restart was disabled before conversion.
I went back to the old version of libguestfs you're using (1.40) virt-inspector shows pretty similar output to your virt-v2v log. However when I looked closer I found that guestfish cannot mount the /dev/sda2 partition from this disk at all. I'm not at all clear why. I guess it might be fast restart or something else (too old ntfs-3g?)
Anyway since it works with recent libguestfs/virt-v2v, I would suggest upgrading to a later version and disabling Fast Restart in Windows guests before conversion, which together should solve the problem.
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
To be clear, fast boot doesn't seem to be the problem / I'm still seeing the issue. Are you able to boot the OVA and shift-shutdown to verify that it resolves the issue or that fast boot is not the issue? Could you let me know how to upgrade to a later version? Thanks! - Alan On Fri, Jun 18, 2021 at 10:19 AM Alan Daniels <alan@softdrive.co> wrote:
When we powered off VMs through vCenter prior to exporting/importing, sometimes it would complain about failing to mount /dev/sda2:
Failed to mount '/dev/sda2': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option. ocaml_exn: 'mount' raised 'Failure' exception guestfsd: error: mount exited with status 14: The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sda2': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option. guestfsd: => mount (0x1) took 0.03 secs libguestfs: trace: v2v: mount = -1 (error) virt-v2v: error: unable to mount the disk image for writing. This has probably happened because Windows Hibernation or Fast Restart is being used in this guest. You have to disable this (in the guest) in order to use virt-v2v.
After this, we started always shutting off the VMs inside the Guest OS via shift-shutdown. This resolved the error above.
However, the guests do not support Hibernate / Fast Shutdown:
PS C:\WINDOWS\system32> powercfg /a The following sleep states are not available on this system: Standby (S1) An internal system component has disabled this standby state. Graphics
Standby (S2) The system firmware does not support this standby state. An internal system component has disabled this standby state. Graphics
Standby (S3) The system firmware does not support this standby state. An internal system component has disabled this standby state. Graphics
Hibernate The system firmware does not support hibernation.
Standby (S0 Low Power Idle) The system firmware does not support this standby state.
Hybrid Sleep Standby (S3) is not available. Hibernation is not available.
Fast Startup Hibernation is not available.
Thanks! - Alan
On Fri, Jun 18, 2021 at 6:27 AM Richard W.M. Jones <rjones@redhat.com> wrote:
Thanks for sending the disk image across.
With latest libguestfs and guestfs-tools I am able to inspect the image fine:
$ rpm -q guestfs-tools libguestfs guestfs-tools-1.47.2-1.fc35.x86_64 libguestfs-1.45.6-6.fc35.x86_64
$ tar xf SoftdriveTest.ova SoftdriveTest2-disk1.vmdk $ virt-inspector -a SoftdriveTest2-disk1.vmdk <?xml version="1.0"?> <operatingsystems> <operatingsystem> <root>/dev/sda2</root> <name>windows</name> <arch>x86_64</arch> <distro>windows</distro> <product_name>Windows 10 Home</product_name> <product_variant>Client</product_variant> <major_version>10</major_version> <minor_version>0</minor_version> <windows_systemroot>/Windows</windows_systemroot>
<windows_current_control_set>ControlSet001</windows_current_control_set> <osinfo>win10</osinfo> <mountpoints> <mountpoint dev="/dev/sda2">/</mountpoint> </mountpoints> ...
Recent virt-v2v gets further, but hits an issue because the guest is using Fast Restart:
$ rpm -q virt-v2v virt-v2v-1.45.1-1.fc35.x86_64
$ virt-v2v -i ova SoftdriveTest.ova -o null [ 0.0] Opening the source -i ova SoftdriveTest.ova [ 166.6] Creating an overlay to protect the source from being modified [ 166.7] Opening the overlay [ 173.0] Inspecting the overlay virt-v2v: error: filesystem was mounted read-only, even though we asked for it to be mounted read-write. This usually means that the filesystem was not cleanly unmounted. Possible causes include trying to convert a guest which is running, or using Windows Hibernation or Fast Restart.
( https://libguestfs.org/virt-v2v.1.html#windows-8-fast-startup-is-incompatibl... )
Looking at the detailed log, the inspection step was fine. Therefore I think it should work fine if Fast Restart was disabled before conversion.
I went back to the old version of libguestfs you're using (1.40) virt-inspector shows pretty similar output to your virt-v2v log. However when I looked closer I found that guestfish cannot mount the /dev/sda2 partition from this disk at all. I'm not at all clear why. I guess it might be fast restart or something else (too old ntfs-3g?)
Anyway since it works with recent libguestfs/virt-v2v, I would suggest upgrading to a later version and disabling Fast Restart in Windows guests before conversion, which together should solve the problem.
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
On Mon, Jun 21, 2021 at 12:27:46AM -0400, Alan Daniels wrote:
To be clear, fast boot doesn't seem to be the problem / I'm still seeing the issue. Are you able to boot the OVA and shift-shutdown to verify that it resolves the issue or that fast boot is not the issue?
I didn't try, but as far as I know the instructions for disabling fast startup are these ones: https://libguestfs.org/virt-v2v.1.html#windows-8-fast-startup-is-incompatibl...
Could you let me know how to upgrade to a later version?
I don't think Oracle ships any newer version, but in Fedora 34 we have the latest virt-v2v packages. 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
There is no such option to disable fast boot / it is not enabled / we've been doing shift-shutdown in the guest to guarantee a full shutdown. I replied to my own email where I provided the powercfg output. Any other suggestions? Thanks! - Alan On Mon, Jun 21, 2021, 3:36 AM Richard W.M. Jones, <rjones@redhat.com> wrote:
To be clear, fast boot doesn't seem to be the problem / I'm still seeing
On Mon, Jun 21, 2021 at 12:27:46AM -0400, Alan Daniels wrote: the
issue. Are you able to boot the OVA and shift-shutdown to verify that it resolves the issue or that fast boot is not the issue?
I didn't try, but as far as I know the instructions for disabling fast startup are these ones:
https://libguestfs.org/virt-v2v.1.html#windows-8-fast-startup-is-incompatibl...
Could you let me know how to upgrade to a later version?
I don't think Oracle ships any newer version, but in Fedora 34 we have the latest virt-v2v packages.
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 Mon, Jun 21, 2021 at 10:22:19AM -0400, Alan Daniels wrote:
There is no such option to disable fast boot / it is not enabled / we've been doing shift-shutdown in the guest to guarantee a full shutdown.
I replied to my own email where I provided the powercfg output.
Any other suggestions?
So to be totally clear, are you using Fedora 34 (or a recent upstream version of virt-v2v), and what is the error message with that version? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
I didn't upgrade. I have to be on Oracle Linux 7.9. I could try building libguestfs and using that. You mentioned that it still fails on latest though. Thanks! - Alan On Mon, Jun 21, 2021, 10:32 AM Richard W.M. Jones, <rjones@redhat.com> wrote:
On Mon, Jun 21, 2021 at 10:22:19AM -0400, Alan Daniels wrote:
There is no such option to disable fast boot / it is not enabled / we've been doing shift-shutdown in the guest to guarantee a full shutdown.
I replied to my own email where I provided the powercfg output.
Any other suggestions?
So to be totally clear, are you using Fedora 34 (or a recent upstream version of virt-v2v), and what is the error message with that version?
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
On Mon, Jun 21, 2021 at 10:42:54AM -0400, Alan Daniels wrote:
I didn't upgrade. I have to be on Oracle Linux 7.9. I could try building libguestfs and using that. You mentioned that it still fails on latest though.
Here we'll help you use the upstream version, or for help with the old version contact Oracle support. For the upstream (or near-upstream) version I'd suggest installing a Fedora 34 virtual machine and using that. If you have trouble on Fedora 34, post the virt-v2v -v -x log with the failure. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Ok, I will do that and share the logs in a few hours. - Alan On Mon, Jun 21, 2021, 10:45 AM Richard W.M. Jones, <rjones@redhat.com> wrote:
I didn't upgrade. I have to be on Oracle Linux 7.9. I could try building libguestfs and using that. You mentioned that it still fails on latest
On Mon, Jun 21, 2021 at 10:42:54AM -0400, Alan Daniels wrote: though.
Here we'll help you use the upstream version, or for help with the old version contact Oracle support. For the upstream (or near-upstream) version I'd suggest installing a Fedora 34 virtual machine and using that. If you have trouble on Fedora 34, post the virt-v2v -v -x log with the failure.
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Rich - sorry, you were right. It works on Fedora 34. Perhaps I broke the test OVA I gave you, since we've had 2 other VMs import successfully via the same command (running on Fedora 34) with no changes inside the Guest OS. Thanks for insisting that I try with latest - I'll do that sooner in the future. Thanks! - Alan On Mon, Jun 21, 2021 at 10:51 AM Alan Daniels <alan@softdrive.co> wrote:
Ok, I will do that and share the logs in a few hours.
- Alan
On Mon, Jun 21, 2021, 10:45 AM Richard W.M. Jones, <rjones@redhat.com> wrote:
I didn't upgrade. I have to be on Oracle Linux 7.9. I could try building libguestfs and using that. You mentioned that it still fails on latest
On Mon, Jun 21, 2021 at 10:42:54AM -0400, Alan Daniels wrote: though.
Here we'll help you use the upstream version, or for help with the old version contact Oracle support. For the upstream (or near-upstream) version I'd suggest installing a Fedora 34 virtual machine and using that. If you have trouble on Fedora 34, post the virt-v2v -v -x log with the failure.
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
participants (2)
-
Alan Daniels -
Richard W.M. Jones