New Question

Revision history [back]

click to hide/show revision 1
initial version

Sysprep failed while cloudbase-init changed hostname and GPU driver can't be load correctly

Description
I made a win2012r2 64bit image with a gpu passthrough, and I installed the NVIDIA driver correctly. Of course, inside the image there is a cloud-base init.
Then I create a new instance with a gpu card passthrough by the image.But when I logged into the vm I found that the gpu card wasn't recognized by the system. The device manger indicated the gpu card was a Video Controller(VGA Compatiable) categorized as unknown devices. Moreover, the device manager showed that system didn't load any drivers for this device.
Related logs
In setupapi.dev , I found the following errors:
Class installer: Enter 15:59:36.807
inf: AddService=nvlddmkm,0x00000002,nvnvlddmkmserviceInstall,nvnvlddmkmeventlogging__02 (oem12.inf line 2084)
!!! dvi: Add Service: Failed to open service control manager.
!!! dvi: Error 1115: A system shutdown is in progress.
!!! dvi: Error while installing services.
!!! dvi: Error 1115: A system shutdown is in progress.
!!! dvi: Class installer: failed(0x0000045b)!
!!! dvi: Error 1115: A system shutdown is in progress.
dvi: CoInstaller 2: Enter (Post Processing) 15:59:36.823

And I found the cloud-base init log like that:
2018-07-09 15:59:33.771 2472 INFO cloudbaseinit.init [-] Executing plugins for stage 'MAIN':
2018-07-09 15:59:33.771 2472 INFO cloudbaseinit.init [-] Executing plugin 'SetHostNamePlugin'
2018-07-09 15:59:33.787 2472 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' loadclass c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2018-07-09 15:59:33.787 2472 DEBUG cloudbaseinit.metadata.services.base [-] Using cached copy of metadata: 'openstack/latest/meta
data.json' getcache_data c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\metadata\services\base.py:92
2018-07-09 15:59:33.787 2472 INFO cloudbaseinit.utils.hostname [-] Setting hostname: win12-gpu-0709
2018-07-09 15:59:33.802 2472 INFO cloudbaseinit.init [-] Rebooting
2018-07-09 15:59:33.865 1732 INFO cloudbaseinit.init [-] Process execution ended with exit code: 0

Also, I noticed a bug in launchpad and a bug in microsoft community

So can I think this problem's root cause is sethostname cause reboot make sysprep failed?