Q: When using cloudbase-init to configure a virtual machine in the Windows operating system, the related configuration does not take effect after the virtual machine is booted for the first time. Why?
A: This issue may occur as a result of a defect in cloudbase-init. The cloudbase-init service does not check the disk mounting status during its operation. In some cases (for example, when the cluster has Boost mode enabled), the virtual machine's services start quickly, and cloudbase-init may run before the operating system has finished mounting all the hard drives. As a result, a failure may occur in detecting the config drive, rendering the configuration ineffective.
This issue can be resolved by delaying the start of the Windows service:
First, set the cloudbase-init service startup item to DelayedAutoStart
:
Click Control Panel > Administrative Tools > Services, right-click on the cloudbase-init service, select Properties, and then change the startup type of the service to Automatic (Delayed Start).
Write to the registry key of the delayed start service which will apply to all DelayedAutoStart
services:
The registry key is located at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\AutoStartDelay
(if it doesn't exist, create a new DWORD 32-bit value). Set the base to decimal and enter the value 4000, which represents a delay of 40 seconds.