New Question
0

RunOnce Registry Keys with cloudbase-init

asked 2020-12-01 11:39:59 +0200

dngady gravatar image

Hi Cloudbase,

I've to ideas for my environment Win2k12r2, Win2k16, and also Win2k19 where that Win2kxx I want to deploy an image on Openstack (RHOSP13) for the public image to the customers which when someone Launch a windows instance as automatically connect to licenses with our KMS Hosts. That is what I'm expected.

So, I already create and save a script with bat file automatically running and just once running when first starting up windows from this ref: https://docs.microsoft.com/en-us/wind... . After that, I want these windows to want send as an image at Openstack so I install Cloudbase-init. Next, after installed automatically Cloudbase-init sent a shutdown, and after I run these windows again, my script on Regedit has gone and my purpose with that script is not running. I think maybe my script from Regedit has gone because of cloudbase-init.

We need your advice about my expectation, Thank you very much.

Regards, BSC

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2020-12-07 14:21:46 +0200

avladu gravatar image

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...

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-... .

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

https://github.com/cloudbase/cloudbas... .

Thank you,
Adrian Vladu

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2020-12-01 11:39:59 +0200

Seen: 1,395 times

Last updated: Dec 07 '20