For vRealize Automation Cloud Assembly to initialize a Windows machine deployed to vSphere, it needs to be based on a template with Cloudbase-Init installed and configured.
- Use vSphere to make and power on a Windows virtual machine.
- On the virtual machine, log in to Windows.
- Download Cloudbase-Init.
- Start the Cloudbase-Init setup .msi file.
During installation, enter Administrator as the username, and select the option to run as LocalSystem.
Other setup selections can remain as default values.
- Allow the installation to run, but do not close the final Completed page of the setup wizard.
Important: Do not close the final page of the setup wizard.
- With the Completed page of the setup wizard still open, use Windows to navigate to the Cloudbase-Init installation path, and open the following file in a text editor.
- Save and close
- In the same folder, open the following file in a text editor.
first_logon_behaviour=always . . . metadata_services=cloudbaseinit.metadata.services.ovfservice.OvfService . . . plugins=cloudbaseinit.plugins.windows.createuser.CreateUserPlugin,cloudbaseinit.plugins.windows.setuserpassword.SetUserPasswordPlugin,cloudbaseinit.plugins.common.sshpublickeys.SetUserSSHPublicKeysPlugin,cloudbaseinit.plugins.common.userdata.UserDataPlugin . . .
- Save and close
- On the Completed page of the setup wizard, select the options to run Sysprep and to shut down after Sysprep, then click Finish.
Note: VMware has seen cases where running Sysprep prevents deployments of the image from working.
When deploying, vRealize Automation Cloud Assembly applies a dynamically generated customization specification, which disconnects the network interface. The pending Sysprep state in the image might cause the customization specification to fail and leave the deployment disconnected.If you suspect that this is happening in your environment, try leaving the Sysprep options deactivated when creating the image.
- After the virtual machine shuts down, use vSphere to turn it into a template.
The following table expands upon the configuration entries made during setup.
|Username, CreateUserPlugin, and SetUserPasswordPlugin||After Sysprep, first boot uses CreateUserPlugin to create the username Administrator account with a blank password. SetUserPasswordPlugin allows Cloudbase-Init to change the blank password to the remote access password that will be included in the cloud template.|
|First Logon Behavior||This setting prompts the user to change the password upon first login.|
|Metadata services||By listing only OvfService, Cloudbase-Init won’t try to find other metadata services that aren't supported in vCenter. This results in cleaner log files, because the logs would otherwise fill with entries about failing to find those other services.|
|Plugins||By listing only plugins with capabilities supported by OvfService, logs are again cleaner. Cloudbase-Init runs plugins in the order specified.|
|Run as LocalSystem||This setting supports any advanced initialization commands that might require Cloudbase-Init to run under a dedicated administrator account.|