New Question
0

usage of cloudbase-init.conf and cloudbase-init-unattend.conf

asked 2018-03-19 14:44:33 +0200

mld68 gravatar image

updated 2018-03-19 20:57:24 +0200

Hi all,

Sorry this post is quite long. Today

I would like to know the usage differences between theses two files as they can host the same settings. When each of them are interpreted ? At first boot ? At every boot ?

I made my first Windows 2016 instance. Then I reboot it and I notice 2 log files just written :

  • cloudbase-init.log
  • cloudbase-init-unattend.log,

So AFAIK the 2 configuration file were interpreted by cloudbase-init. Why ?

Here is how I build the image

  • I install Windows as our standards in my company (antivirus, ntp, registry settings...)
  • At the end of setupcomplete.cmd, I added the silent installation of CloudbaseInitSetup0911x64.msi
  • Put settings on cloudbase-init.conf and/or (?) cloudbase-init-unattended.conf
  • Launch sysprep specifying the unattend.xml provided by cloubaseinit installation.
  • System shutdown, ready to copy on openstack

And the corresponding code :

msiexec /i CloudbaseInitSetup__0__9__11__x64.msi /qn /l*v "C:\Logiciels\CloudInit.log" LOGGINGSERIALPORTNAME=COM1
copy personnalized cloudbase-init.conf "%ProgramFiles%\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init.conf"
ipconfig /release  
cd "%ProgramFiles%\Cloudbase Solutions\Cloudbase-Init\conf"
\Windows\System32\Sysprep\Sysprep.exe" /generalize /oobe /shutdown /unattend:Unattend.xml

According Unattend.xml, at first boot, the following will be run : cmd.exe /c ""C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Scripts\cloudbase-init.exe" --config-file "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init-unattend.conf

So, does it mean the cloudbase-init-unattend.conf is used only once at fist boot. So this file should init the user : according theses entries using the pluging : cloudbaseinit.plugins.windows.createuser.CreateUserPlugin

username=Admin
groups=Administrators

As all plugin are executed by defaut, no need for a plugins entry in this ini file

If cloubase-init.conf has also the username/groups entries, it will change the password of the admin user at each reboot ? The only way to automaticaly change this password and be able to get it vith the nova command

If one want to keep the provided password at first boot, one have to remove these entries and specify la limited set of plugin in the plugins= entry ?

Thanks !

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
1

answered 2018-03-27 18:30:51 +0200

mld68 gravatar image

updated 2018-03-27 18:38:48 +0200

Hi Adrian, Thanks for theses explanation. The two .conf files may be identicals in fact.

AFAIU, running Cloudinit at each reboot is for setting the MTU size, ntp provided dhcp (our openstack do not provide it this way) and extending automatically the volume size in needed ?

BTW, I edit your provided unattended.xml with Windowsd SIM. WSIM complain about skiping User and Machine OOBEand setting network as "Work"

I updated the unattend.xml file in order to not discard *OOBE and get french keyboard in console, no question about locale and licences. But infortunately, I can't upload it. Not enough points :-)

I also removed sysprep from my setupcomplete.cmd, it can't run at this place because the synchronous command are run after it. As sysprep play an attended with runsynchronous, It is like the chicken and the egg. Until now, I have to connect to the server to install cloudbase-init then sysprep the server. Hope to find a way to automate this last step.

You did a great job with Cloudbase-init, thank you ! MLD

edit flag offensive delete link more

Comments

Thanks :) for automating your image creation, we have a great tool here: https://github.com/cloudbase/windows-openstack-imaging-tools/tree/experimental Let me know if you have any other questions.

avladu gravatar imageavladu ( 2018-03-27 21:07:24 +0200 )edit
0

answered 2018-03-23 14:21:37 +0200

avladu gravatar image

Hello,

Cloudbase-init is used to provision the Windows instance in an automated manner. The default way to use Windows with cloudbase-init is the following:

  1. Create the Windows image from an ISO and apply all your required patches, applications, etc
  2. Install cloudbase-init using the installer during which you also sysprep the Windows instance using the cloudbase-init's sysprep configuration file
  3. Shutdown the Windows instance and move the backing file to the cloud of choice image repository
  4. Boot a Windows instance from that image. Here is when cloudbase-init is being executed: i. first time during the Sysprep Specialize step as a process started under user LocalSystem. The cloudbase-init configuration for this run is located at " "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init-unattend.conf". After cloudbase-init unattend is executed, sysprep triggers a Windows reboot. Keep in mind that during this stage, some Windows APIs or capabilities are not supported (WMI in special). ii. At every subsequent boot, cloudbase-init process is started by the cloudbase-init Windows service (service which has been installed during step 2) and the process is run under user cloudbase-init (if not specified otherwise during step 2).

To answer this part: "If cloubase-init.conf has also the username/groups entries, it will change the password of the admin user at each reboot ? The only way to automaticaly change this password and be able to get it vith the nova command" >> the cloudbase-init plugins have a saved state in the registry hive, so that they do not get executed twice if the plugin had a successful run. In the case mentioned by you, the setuserpassword plugin will get executed only once if there are no failures during the plugin run.

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

1 follower

Stats

Asked: 2018-03-19 14:44:33 +0200

Seen: 4,157 times

Last updated: Mar 27 '18