New Question

Revision history [back]

click to hide/show revision 1
initial version

Hello,

Cloudbase-Init does not remove any scripts from the image. The runonce scripts have been deleted by sysprep.

Sysprep's whole idea is to clean / generalize the image so that it can be used to create multiple instances from that image.

One way to achieve this is to use LocalScriptsPlugin and let cloudbase-init run that script. Make sure you make that script idempotent:

https://cloudbase-init.readthedocs.io/en/latest/plugins.html#local-scripts-execution-main

Another way is to change the sysprep Unattend.xml that cloudbase-init already has, add those runonce scripts in the unattend.xml and perform the sysprep manually. To automate this, you can use the Windows Imaging Tools and set the Unattend.xml template of your choice:

https://github.com/cloudbase/windows-openstack-imaging-tools/blob/master/Config.psm1#L121 .

Make sure you leave the cloudbase-init run command there and put your run command before it:

https://github.com/cloudbase/cloudbase-init-installer/blob/master/CloudbaseInitSetup/Unattend.xml#L23 .

Thank you,
Adrian Vladu