cloudbase / windows-imaging-tools

Tools to automate the creation of a Windows image for OpenStack, supporting KVM, Hyper-V, ESXi and more.
Apache License 2.0
670 stars 227 forks source link

Add support to configure cloudbase-init service startup type #341

Closed ader1990 closed 4 years ago

ader1990 commented 4 years ago

If sysprep is enabled, then the SetSetupComplete.cmd is executed, which configures the C:\Windows\Setup\Scripts\Setupcomplete.cmd and disables the cloudbase-init service.

C:\Windows\Setup\Scripts\Setupcomplete.cmd content:

sc config cloudbase-init start= auto && net start cloudbase-init

C:\Windows\Setup\Scripts\Setupcomplete.cmd gets executed at the end of the sysprep.

Sometimes we need cloudbase-init service to be set to auto delayed start, to make sure that all the Windows services are up and running when cloudbase-init runs. This scenario might fix the problems with NETLBFO bond, when cloudbase-init tries to create the bonds, but the bonding networking services are not ready and silent failures can occur.

The solution:

[cloudbase_init] cloudbase_init_delayed_start=False

if set to auto, disabled, manual or auto-delayed, then the SetSetupComplete.cmd will not be executed and the service will be set to the desired startup type.