12138 Commits

Author SHA1 Message Date
Richard W.M. Jones
28eca74579 Version 2.5.10. v2.5.10 2024-09-10 10:42:52 +01:00
Richard W.M. Jones
fa18f8ac16 output: -o kubevirt: Fix firmware section to match specification
The previous firmware section in Kubevirt YAML didn't match the
current specification.  Unclear if it matched a previous spec or if we
just guessed at the format.

After this change, for BIOS:

..
spec:
  template:
    spec:
      domain:
        firmware:
          bootloader:
            bios: {}
..

For UEFI:

..
spec:
  template:
    spec:
      domain:
        firmware:
          bootloader:
            efi:
              persistent: true
..

Link: https://kubevirt.io/api-reference/v1.3.1/definitions.html#_v1_firmware
Reported-by: Martin Necas
Fixes: https://issues.redhat.com/browse/RHEL-58065
2024-09-10 10:25:18 +01:00
Richard W.M. Jones
6b57c16140 lib: YAML: Fix empty dictionaries and lists
Another weird corner case in YAML is that empty dictionaries have a
special representation.  Empty lists also have a special
representation, that we got wrong.

Link: https://stackoverflow.com/a/33510095
2024-09-10 10:25:18 +01:00
Richard W.M. Jones
89ec5f9079 output/create_kubevirt_yaml.ml: Replace List [] with Assoc []
Previously several empty Kubevirt YAML nodes were represented as empty
lists (List []).  Our YAML generator incorrectly generated "{}" for
this, but this is the YAML for empty dictionary, not list.  However as
a consequence of two bugs cancelling out, this actually generated the
expected YAML.

Since we're going to fix the bug in our YAML generator, replace
List [] with Assoc [] so the output will remain the same.
2024-09-10 10:25:18 +01:00
Richard W.M. Jones
321c980348 output: -o kubevirt: Update comments with reference to latest spec
I looked through the latest specification
(https://kubevirt.io/api-reference/v1.3.1/definitions.html#_v1_acpi)
and updated comments as appropriate.  No actual change to the output.
2024-09-09 16:04:13 +01:00
Richard W.M. Jones
8df0d58903 inspector: Add <firmware type="bios|uefi"> to the output 2024-09-09 12:29:11 +01:00
Weblate Translation Memory
33717800c6 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (552 of 552 strings)

Translation: libguestfs/virt-v2v-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/virt-v2v-master/uk/
2024-09-04 17:17:10 +01:00
Yuri Chornoivan
5b6fd11668 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (552 of 552 strings)

Translation: libguestfs/virt-v2v-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/virt-v2v-master/uk/
2024-09-04 17:17:10 +01:00
Weblate Translation Memory
e618c18bf4 Translated using Weblate (Ukrainian)
Currently translated at 95.4% (527 of 552 strings)

Translation: libguestfs/virt-v2v-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/virt-v2v-master/uk/
2024-09-03 15:54:38 +01:00
Yuri Chornoivan
e34f5c7e44 Translated using Weblate (Ukrainian)
Currently translated at 95.4% (527 of 552 strings)

Translation: libguestfs/virt-v2v-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/virt-v2v-master/uk/
2024-09-03 15:54:38 +01:00
Weblate
a8587202db Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: libguestfs/virt-v2v-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/virt-v2v-master/
2024-09-02 15:00:23 +01:00
Andi Chandler
00692c57b0 Translated using Weblate (English (United Kingdom))
Currently translated at 4.9% (65 of 1305 strings)

Translation: libguestfs/virt-v2v-docs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/virt-v2v-docs-master/en_GB/
2024-09-02 15:00:23 +01:00
Richard W.M. Jones
4b39b7bd0f convert: Display osinfo in "Converting ..." message
eg:

[ 9.3] Converting Windows Server 2022 Phony Edition (win2k22) to run on KVM

Reported-by: Ming Xie
Fixes: https://issues.redhat.com/browse/RHEL-56784
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
2024-08-31 09:40:21 +01:00
Richard W.M. Jones
413f5ccabf Version 2.5.9. v2.5.9 2024-08-29 15:29:06 +01:00
Richard W.M. Jones
950e82dfb7 convert: windows: Ignore sriov drivers on virtio-win disk
Update common submodule to get:

  Richard W.M. Jones (1):
      mlcustomize: Ignore sriov drivers on virtio-win disk
2024-08-29 15:09:41 +01:00
Richard W.M. Jones
67dd3de654 test-data/phony-guests: "Update" phony Windows to 2022 Server
For the phony Windows guest we used the registry information from a
32 bit Windows 7 instance.  This version of Windows is EOL.  Newer
Windows changed the versioning scheme so we now use the build ID to
distinguish between versions, but we have not tested this in virt-v2v
upstream before.

I grabbed HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion
from a real 64 bit Windows 2022 Server instance, minus identifying strings.

Various tests had to be updated because they contained references to
Windows 7, or because virtio-win contains more drivers for Windows
2022.
2024-08-29 15:09:10 +01:00
Richard W.M. Jones
2e78fb4d10 output/create_libvirt_xml.ml: Hard-code libosinfo URL for W2K22
Also add a comment that we ought to get this from the libosinfo
information provided by libguestfs.  I'm not sure why we aren't doing
that already.
2024-08-29 15:09:10 +01:00
Richard W.M. Jones
9b69cde051 po-docs: Update podfiles
Adds the two v2v-customize-*.pod snippets.

Also update the common submodule to get:

  Richard W.M. Jones (1):
      mlcustomize: Include v2v-customize-*.pod in EXTRA_DIST

Updates: commit f720aff7d690ead787b2ec9d4dabdff2b2923efd
2024-08-29 15:08:42 +01:00
Richard W.M. Jones
cb56f6f94d convert: windows: Online all virtio disks at first boot
Windows 2022 (and possibly earlier versions back to around 2019) will
force offline any non-boot disks which change bus, apparently as a
security mitigation.  The effect of this is that although the system
drive (C:) is present after conversion, other drives may seem to
disappear.

Running a Powershell script to bring all disks online seems risky.
The compromise is to bring online only virtio disks at first boot.

To further reduce risk, we only do this if there are non-system disks
(ie. > 1 disks in total), and only if we installed virtio drivers.

Fixes: https://issues.redhat.com/browse/RHEL-55763
Fixes: https://issues.redhat.com/browse/RHEL-55837
Related: https://issues.redhat.com/browse/MTV-1299
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1662286
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Thanks: Martin Necas
Acked-by: Martin Necas
2024-08-27 13:19:36 +01:00
Richard W.M. Jones
aa91135688 tests: Add a test of customizing a VM during conversion
Updates: commit ade62ebdb50e32a05c336ffcf4c08c6996a3af36
2024-08-20 21:32:54 +01:00
Richard W.M. Jones
f720aff7d6 v2v: Don't include virt-customize --inject* options
Commit ade62ebdb5 ("v2v: Add support for virt-customize options")
included --inject* options that covered facilities for injecting QEMU
guest agent etc which are already part of virt-v2v.  We shouldn't add
the options for that.

The generator in libguestfs was changed so we can now exclude those
options from virt-v2v.

Update common submodule to include:

Richard W.M. Jones (1):
      mlcustomize: Update generated options for virt-v2v

Fixes: commit ade62ebdb50e32a05c336ffcf4c08c6996a3af36
2024-08-20 21:24:00 +01:00
Richard W.M. Jones
170d6ba42e Version 2.5.8. v2.5.8 2024-08-20 12:07:40 +01:00
Richard W.M. Jones
ade62ebdb5 v2v: Add support for virt-customize options
For higher level tools making further arbitrary changes to the guest
post-conversion, especially adding more firstboot scripts, it's useful
if we have various features from virt-customize.  Particularly the
ability to upload and run scripts.  Since we have the virt-customize
code in the common/ submodule, the easiest thing to do is to add the
virt-customize options, the same way it is done in virt-builder and
virt-sysprep.

Also updates the common submodule to get:

Richard W.M. Jones (1):
      mlcustomize: Move virt-customize modules to mlcustomize/
2024-08-20 11:46:31 +01:00
Richard W.M. Jones
373ee61ab5 convert: Move SELinux relabelling step to common conversion code
Simple code motion.  SELinux relabelling is a no-op for
non-Linux/non-SELinux guests.
2024-08-20 10:14:06 +01:00
Richard W.M. Jones
0e3fb1ba37 convert: windows: Allow increasing verboseness of driver installation
To try to chase an issue with installing drivers on 32 bit Windows 10,
let's increase the LogLevel to maximum to get maximum logging.  As I
understand it we shouldn't leave this on all the time, so it is
commented out by default.

This setting is explained further here:
https://learn.microsoft.com/en-us/windows-hardware/drivers/install/setting-setupapi-logging-levels

Thanks: Vadim Rozenfeld
Related: https://issues.redhat.com/browse/RHEL-53990
2024-08-14 16:30:25 +01:00
Richard W.M. Jones
2471e29626 Version 2.5.7. v2.5.7 2024-08-13 11:57:12 +01:00
Richard W.M. Jones
bc845c124c convert: windows: Don't wait indefinitely for netkvm.sys
In the network configuration script, don't wait indefinitely for the
netkvm.sys (virtio-net) adapter to become available.  It might not
have been installed correctly or there could be some other reason why
it doesn't work.  This of course indicates a bug in the guest, but
it's still better than looping forever.

Reported-by: Ming Xie
Related: https://stackoverflow.com/a/40841942
Related: https://issues.redhat.com/browse/RHEL-50731
2024-08-13 10:47:51 +01:00
Richard W.M. Jones
e9c0d63b22 docs: Restate position on removal of VMware Tools
With the "reboot after every step" change made in the previous commit,
it seems removal of VMware Tools is now more reliable.  Update the
notes about this.

Updates: commit c952f310c902e438a8b0b5240a4b486b698bede8
2024-08-08 10:56:16 +01:00
Richard W.M. Jones
50f005f8b7 Pull in a fix to make Windows firstboot more reliable.
Update the common submodule to get:

Richard W.M. Jones (2):
      mlcustomize: Add some comments to firstboot batch file
      mlcustomize: Reboot Windows between each firstboot script

Document that Windows may now reboot several times after conversion.
2024-08-08 10:49:36 +01:00
Richard W.M. Jones
7bc9b115ba Update common submodule
Richard W.M. Jones (1):
      mlcustomize: Write qemu-ga log file name to log.txt
2024-08-05 10:18:31 +01:00
Richard W.M. Jones
c952f310c9 docs: Add a note about removal of VMware Tools on Windows
We use VMware's recommended method for removal, but we know from
experience that this rarely works.  The alternate method being
proposed involves making very invasive changes to the Registry and
filesystem, which are inappropriate for virt-v2v to do and highly
risky.  Therefore simply document this, with notes for the virt-v2v
user if they want to try the risky method.

Fixes: https://issues.redhat.com/browse/RHEL-51169
Thanks: Yan Vugenfirer
Reported-by: Ming Xie
2024-08-05 10:08:34 +01:00
Richard W.M. Jones
168eacf977 common: mlcustomize: Inject qemu-ga & blnsvr into <firstboot_dir>/Temp
Update common submodule to pick up this further change which should
mean that for all Windows conversions, everything is confined to
C:\Program Files\Guestfs\Firstboot (except the virtio drivers
themselves).

Richard W.M. Jones (1):
      mlcustomize: Inject qemu-ga & blnsvr into <firstboot_dir>/Temp
2024-08-01 11:03:42 +01:00
Richard W.M. Jones
c57ec4fd5d convert: More robust qemu-ga installation, change paths
Add a commit from the common submodule to attempt to make qemu-ga
installation more robust on Windows.

Rename network configuration Powershell script from "v2vnetcf" to
"network-configuration".  I also dropped the ".ps1" extension as the
modified Firstboot.add_firstboot_powershell function now adds this.

Update the common submodule to get these changes:

Richard W.M. Jones (3):
      mlcustomize: Use Start-Process -Wait to run qemu-ga installer
      mlcustomize: Add Firstboot.firstboot_dir function
      mlcustomize: Place powershell scripts into <firstboot_dir>\Temp
2024-08-01 10:12:28 +01:00
Richard W.M. Jones
7800049c56 docs: Note that --mac len field is now optional
Reported-by: Ming Xie
Updates: commit 159fda411d2f75b087106e7293d273ae142c9fbe
2024-07-31 10:09:50 +01:00
Richard W.M. Jones
74dda022ee Version 2.5.6. v2.5.6 2024-07-30 17:00:18 +01:00
Richard W.M. Jones
d33fa8822b convert: Collect drive mappings in 'inspect' object
Currently we only print it in debugging output, but we might use it in
future.  It costs nothing to get it as it is already collected for
Windows guests (and is empty for other guests).
2024-07-30 16:33:20 +01:00
Richard W.M. Jones
652766b412 convert: Dump more information about the guest during conversion
As with the previous commit, this will match searches for ^info:
2024-07-30 16:07:34 +01:00
Richard W.M. Jones
0950ae3d75 convert: Tag some important information in debug output with ^info:
When we get large virt-v2v logs back from customers it is often
difficult to find relevant information about the guest.  Try to fix
this by tagging some important information so that it will match this
regular expression in searches:

  ^info:

Note I'm not including information about input and output drivers
here.  If we suspect a problem there, then more detailed review of the
log is always needed, plus that information is usually much easier to
find (eg. finding the kubevirt yaml or libvirt XML is obvious even in
large log files).

The main complexity here was to ensure that all of the nbdinfo
information appears together.  We need to run the command and collect
the output, otherwise it gets mixed in with debugging from nbdkit
which resulted from running nbdinfo.

Also update the common submodule to include:

  Richard W.M. Jones (1):
      mldrivers/linux_kernels.ml: Prefix general information with ^info:
2024-07-30 16:07:34 +01:00
Richard W.M. Jones
7a82e130c2 lib: Only get nbdkit config and version once
The configuration (--dump-config) and version of nbdkit won't change
while we are running, so we only need to get it once.  We also don't
need the config parameter to Nbdkit.version so drop that.
2024-07-30 15:57:57 +01:00
Richard W.M. Jones
159fda411d v2v: --mac: Allow gw and len fields to be empty
Even if these appear in the middle of the list, allow them to be
empty.  For example this is now permitted whereas previously it was an
error:

  virt-v2v --mac <MAC>:ip:<ADDR>,,,nameserver

Reported-by: Arik Hadas
2024-07-28 14:49:42 +01:00
Richard W.M. Jones
4ba18d2d6d Update common submodule
This pulls in the commits below which simplify the installation of
Qemu Guest Agent on Windows.

Richard W.M. Jones (4):
      mlcustomize: firstboot: Use Linux path for Powershell script path
      mlcustomize: firstboot: Use powershell.exe instead of path
      mlcustomize: firstboot: Use Powershell -NoProfile flag
      mlcustomize: Revert delay installation of qemu-ga MSI

Fixes: https://issues.redhat.com/browse/RHEL-49761
2024-07-25 09:08:41 +01:00
Richard W.M. Jones
3d26e48af3 -i ova: Ignore dot-underscore-files in OVA files
I received an OVA created by a mac which contained various files
prefixed by "._" that contain some sort of extra information.  Ignore
those files when decoding OVAs:

$ tar tvf win22ktest.tar 2>/dev/null
drwxr-xr-x markd/staff       0 2024-07-23 18:23 win22test/
-rw-r--r-- markd/staff     619 2024-07-23 15:16 win22test/._win22test.mf
-rw-r--r-- markd/staff     271 2024-07-23 15:16 win22test/win22test.mf
-rw-r--r-- markd/staff     623 2024-07-23 15:16 win22test/._win22test-1.vmdk
-rw-r--r-- markd/staff 8348649984 2024-07-23 15:16 win22test/win22test-1.vmdk
-rw-r--r-- markd/staff        624 2024-07-23 15:00 win22test/._win22test-2.nvram
-rw-r--r-- markd/staff     270840 2024-07-23 15:00 win22test/win22test-2.nvram
-rw-r--r-- markd/staff        620 2024-07-23 15:00 win22test/._win22test.ovf
-rw-r--r-- markd/staff      12052 2024-07-23 15:00 win22test/win22test.ovf
2024-07-25 08:55:59 +01:00
Richard W.M. Jones
0119315c8d Version 2.5.5. v2.5.5 2024-07-11 12:22:47 +01:00
Richard W.M. Jones
2b00025238 -o kubevirt: Create a VirtualMachine instead of a VirtualMachineInstance
VMs converted by virt-v2v are pets not cattle so we want to create
permanent non-running machines.  (They may later or even soon
afterwards be started up by some other tool, at which point they also
become Instances.)  Therefore use a different kind and slightly
restructure the yaml around this.

Thanks: Lee Yarwood
2024-07-11 12:14:21 +01:00
Richard W.M. Jones
e0d79e9a2e -o kubevirt: Add metadata labels
Add various information which we have but cannot add to the Kubevirt
yaml in any other place.

Example output:

...
metadata:
  name: fedora-39
  labels:
    libguestfs.org/virt-v2v-version: "2.5.4"
    libguestfs.org/osinfo: fedora39
...

Thanks: Bella Khizgiyaev, Liran Rotenberg
Fixes: https://issues.redhat.com/browse/RHEL-45992
2024-07-11 12:14:21 +01:00
Richard W.M. Jones
9cedbf00c8 docs: Update -oo "?" example to use libvirt instead of RHV mode 2024-07-08 10:04:46 +01:00
Richard W.M. Jones
2a6c242273 Revert "docs: Remove paragraph about -ip passwords and ssh/scp"
Previously we removed this paragraph, believing that the -ip option
now copes with all cases.  However this still isn't true because
libvirt runs this ssh command:

  ssh -l root -T -e none -- [XEN-HOST] sh -c 'which virt-ssh-helper 1>/dev/null 2>&1; if test $? = 0; then     virt-ssh-helper 'xen://'; else    if 'nc' -q 2>&1 | grep "requires an argument" >/dev/null 2>&1; then ARG=-q0;else ARG=;fi;'nc' $ARG -U /var/run/libvirt/libvirt-sock; fi'

I checked with Dan and there is no way to suppress this or pass in a
password, so we still need ssh-agent even with -ip.  Note this applies
to any libvirt ssh connection, thus to Xen or VMware over SSH.

Reported-by: Ming Xie
Fixes: https://issues.redhat.com/browse/RHEL-45527
Thanks: Daniel Berrange

This reverts commit 67fcf66904c7f1f6da858eba35e95dad670427c0.
2024-07-04 11:01:24 +01:00
Richard W.M. Jones
4df3dcf64d inspector: Add more fields to the output
Add more inspection fields in the <operatingsystem> element of
virt-v2v-inspector output.  I've tried to keep these field names
consistent with virt-inspector (if there is a difference then it's a
bug in this tool).

See: https://issues.redhat.com/browse/MTV-1079
2024-07-03 11:39:52 +01:00
Richard W.M. Jones
9f7bb5fc33 docs: Add VDDK prereq that server must not be in maintenance mode
Fixes: https://issues.redhat.com/browse/RHEL-33699
2024-05-16 13:43:29 +01:00
Richard W.M. Jones
70eec57765 convert: windows: Install blnsvr from virtio-win
Also update the common module to get these two commits for the
implementation:

Richard W.M. Jones (2):
      mlcustomize: Add virt-customize --inject-blnsvr generated files
      mlcustomize: Add Inject_virtio_win.inject_blnsvr implementation

Fixes: https://issues.redhat.com/browse/RHEL-36591
2024-05-16 13:29:40 +01:00