Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1620313 - firstboot commands do not run properly on Windows 2012 guest
Summary: firstboot commands do not run properly on Windows 2012 guest
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.6
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard: V2V
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-23 01:22 UTC by Kedar Kulkarni
Modified: 2019-05-13 09:58 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-13 09:58:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Screenshots (383.41 KB, application/zip)
2018-08-23 01:22 UTC, Kedar Kulkarni
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1584678 0 medium CLOSED On W2K12r2 rhev-apt does not run non-interactively, causing race when starting rhev-apt service from the command line 2022-05-16 11:32:56 UTC

Internal Links: 1584678

Description Kedar Kulkarni 2018-08-23 01:22:56 UTC
Created attachment 1478017 [details]
Screenshots

Description of problem:
While migrating windows based guests from VMware to RHV, rhv-apt fails to install. Tested against win10, win2012, win2016. ISO is mounted correct and firstboot scripts seem to have executed from logs but it still does not have required services running on it.

Version-Release number of selected component (if applicable):
python-libguestfs-1.36.10-6.16.rhvpreview.el7ev.x86_64
libguestfs-1.36.10-6.16.rhvpreview.el7ev.x86_64
libguestfs-tools-c-1.36.10-6.16.rhvpreview.el7ev.x86_64
libguestfs-winsupport-7.2-2.el7.x86_64


How reproducible:
Believe 100%

Steps to Reproduce:
1.Migrate Windows guests from VMware to RHV using virt-v2v
2.Boot up guests and check if guest tools and required services are installed by rhv-apt


Actual results:
rhev-apt fails to install

Expected results:
It should install

Additional info:
Attachment includes screenshots for win 2012, win 2016

Comment 2 Richard W.M. Jones 2018-08-23 07:51:58 UTC
For some reason not understood this only fails on Windows 2012
(perhaps even only on a particular instance).  It works on other
Windows versions.

KK saw the following error from virt-v2v:

> starting rhev-apt                                                         
> The system cannot execute the specified program.     #1                   
> .... exit code 1                                                          
> uninstalling firstboot service                                            
> The system cannot execute the specified program.     #2                   

The code which should be running at #1 is:

https://github.com/libguestfs/libguestfs/blob/38f688b8b5fb960213c4c6fcad20a87965ea3335/v2v/convert_windows.ml#L353
("net start rhev-apt").

The code which should be running at #2 is:

https://github.com/libguestfs/libguestfs/blob/38f688b8b5fb960213c4c6fcad20a87965ea3335/customize/firstboot.ml#L313
("rhsrvany -s firstboot uninstall")

KK verified that the net command exists in the guest, and we know
that rhsrvany was installed already.

Therefore it seems to be some issue with paths, or 32 vs 64 bits, or
binary format, or AV software, or something like that.  It is likely
that this affects all commands run from firstboot scripts.

Comment 3 Richard W.M. Jones 2018-08-23 07:56:08 UTC
Possibly a dup of bug 1584678.

Is this Windows 2012 R2?

Comment 4 Kedar Kulkarni 2018-08-23 15:35:52 UTC
Hey Richard,  It indeed is Windows 2012 R2. Although, I see this issue on Windows 10, 2016 as well, it is inconsistent though. I would like to request you to take a look at it before focusing on this bz with respect to 2012 only. Also, does RHEV-APT also install RHEV-Tools? Will it help RHV Manager fetch IP Address/Hostname? I did try mounting RHV Tools ISO, installed RHEV-APT first and did not see IP addresses, so I installed RHEV-Tools and then IP addresses populated in Manager.

Comment 5 Richard W.M. Jones 2018-08-23 15:45:35 UTC
We install RHEV-APT and it's supposed to install everything else.
However that will only work if the ISO is attached, I believe.
Best to ask Tomas or Michal for insight into oVirt agent questions.

Comment 7 Richard W.M. Jones 2018-09-14 13:40:30 UTC
FWIW we now have a regression test upstream for checking that
firstboot functionality works on (some) Windows guests:

https://github.com/libguestfs/libguestfs/commit/4b6341072c6033e559bde988f080ac5107368f75

PASS: test-firstboot-windows-6.2-server.sh
PASS: test-firstboot-windows-6.3-server.sh
PASS: test-firstboot-windows-10.0-server.sh

However it doesn't fail on Windows 2012 (6.2) or 2012 R2 (6.3)
so I don't know.  It might be an intermittent bug although
that seems unlikely.  More likely it's connected to something
in this particular guest such as antivirus scanners or Windows Group
Policy.

Comment 8 Richard W.M. Jones 2019-05-13 09:58:50 UTC
Sorry we were not able to fix this in RHEL 7.  If this bug happens again in RHEL 8
please file a new bug there.


Note You need to log in before you can comment on or make changes to this bug.