Bug 2114809

Summary: Can't install qemu-ga because of network address error after converting MD-RAID1 win11 host by virt-p2v
Product: Red Hat Enterprise Linux 9 Reporter: mxie <mxie>
Component: virt-v2vAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.1CC: chhu, hongzliu, juzhou, kkiwi, lersek, mzhan, rjones, tyan, tzheng, vwu, xiaodwan
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-03 14:37:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mxie@redhat.com 2022-08-03 10:05:36 UTC
Description of problem:
Can't install qemu-ga because of network address error after converting MD-RAID1 win11 host by virt-p2v

Version-Release number of selected component (if applicable):
livecd-p2v-202207151220.iso
virt-v2v-2.0.7-4.el9.x86_64
libguestfs-1.48.4-1.el9.x86_64
guestfs-tools-1.48.2-5.el9.x86_64


How reproducible:
100%

Steps to Reproduce:
1.Convert a MD-RAID1 win11 host to rhv by virt-p2v

2.Check the guest after p2v finishing conversion, found qemu-guest-agent can't be installed because network address is invaild, pls check logs and sreenshot


Actual results:
As above description

Expected results:
Qemu-guest-agent should be installed successfully after converting a MD-RAID1 win11 host to rhv by p2v

Additional info:
Can't reproduce the bug when convert a win11 guest from VMware to rhv by virt-v2v

Comment 4 Laszlo Ersek 2022-08-03 14:37:57 UTC
We can correlate the screenshot from comment 1 with the virt-v2v source code:

convert/convert_windows.ml:

       add "Write-Host Removing any previously scheduled qemu-ga installation";
       add "schtasks.exe /Delete /TN Firstboot-qemu-ga /F";
       add "";
       add (sprintf
              "Write-Host Scheduling delayed installation of qemu-ga from %s"
              msi_path);
       add "$d = (get-date).AddSeconds(120)";
       add "$dtfinfo = [System.Globalization.DateTimeFormatInfo]::CurrentInfo";
       add "$sdp = $dtfinfo.ShortDatePattern";
       add "$sdp = $sdp -replace 'y+', 'yyyy'";
       add "$sdp = $sdp -replace 'M+', 'MM'";
       add "$sdp = $sdp -replace 'd+', 'dd'";
       add "schtasks.exe /Create /SC ONCE `";
       add "  /ST $d.ToString('HH:mm') /SD $d.ToString($sdp) `";
       add "  /RU SYSTEM /TN Firstboot-qemu-ga `";

In the screenshot, we can see

  ERROR: The network address is invalid

*between* "Removing any previously..." and "Scheduling delayed installation..."

In the script, there is only one command between those two "Write-Host" commands:

  schtasks.exe /Delete /TN Firstboot-qemu-ga /F

Therefore, we may believe that this "schtasks" command is what emits "ERROR: The network address is invalid".

... No, that makes absolutely no sense. "schtasks.exe" should not deal with the network at all.

Instead, this is effectively a duplicate of bug 2068361. I'm basing this in particular on my earlier comments <https://bugzilla.redhat.com/show_bug.cgi?id=2068361#c12> and <https://bugzilla.redhat.com/show_bug.cgi?id=2068361#c19>.

We have some general, obscure, deep breakage in the windows firstboot machinery, where not even the batch files that we queue strictly serially are executed serially. What happens here is that

  ERROR: The network address is invalid

comes from "v2vnetcf.ps1", even though it is not visible yet in the screenshot, and then issues with that break the whole thing. I can't make any progress on this until we get some deep analysis help from the Windows experts.

I do claim though that this symptom stems from the same root cause as bug 2068361, so I'm closing this one as a duplicate.

*** This bug has been marked as a duplicate of bug 2068361 ***

Comment 5 Laszlo Ersek 2022-08-03 14:46:15 UTC
Wow, it could be the other way around. I've googled "ERROR: The network address is invalid", and many users do associate it with "schtasks.exe" (meaning that they also report that "schtasks.exe" emits this error message totally inexplicably). Of course, nothing on the web explains or solves the problem. So anyway, it's likely not "v2vnetcf.ps1" breaking the firstboot machinery, but "schtasks.exe" (with its unfathomable dependency on some network address?) breaking the firstboot stuff *including* "v2vnetcf.ps1".

Whichever way we spin it, we need help from the Windows guys to debug it.