Before You Begin
...
Important Note: For older Linux distributions remove the /etc./udev/rules.d/70-persistent-net.rules file before shutting down the VM
Important Note: Remove the NIC on the VM prior to converting the VM to Template. Refer VM Template Preparation (Installing Cloud-Init)
VMware vCloud Director: Not Supported
VM Template Preparation (Installing Cloud-init):
- vim:syntax=yaml
datasource_list: ["NoCloud", "ConfigDrive"]
- CentOS 6.x and below*
- ---------------------------*
- remove udev rules for network adapters
rm /etc./udev/rules.d/70-persistent-net.rules
#Ubuntu
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install cloud-init -y
- Edit 90_dpkg.cfg to remove items in datasource_list except the following
datasource_list: [ NoCloud, ConfigDrive, None ]|
- Windows VM Templates (Window 2016): Windows VM require cloudbase-init for Guest Customization. Run the following command to install Cloudbase-init
...
C:\Program Files\Cloudbase Solutions\Cloudbase-Init\confcloudbase-init-unattend.conf |
[DEFAULT] username=Admin groups=Administrators first_logon_behaviour=no inject_user_password=false config_drive_raw_hhd=true config_drive_cdrom=true config_drive_vfat=true bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\ verbose=true debug=true logdir=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log\ logfile=cloudbase-init-unattend.log default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN,requests=WARN logging_serial_port_settings= mtu_use_dhcp_config=true ntp_use_dhcp_config=true local_scripts_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\LocalScripts\ metadata_services= plugins= allow_reboot=false stop_service_on_exit=false check_latest_version=false |
Important Note: Ensure the Administrator default password is configured. In this example – HyperGrid123
C:\Program Files\Cloudbase Solutions\Cloudbase-Init\confunattend.xml |
<?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="generalize"> <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <PersistAllDeviceInstalls>true</PersistAllDeviceInstalls> </component> </settings> <settings pass="oobeSystem"> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"> <OOBE> <HideEULAPage>true</HideEULAPage> <NetworkLocation>Work</NetworkLocation> <ProtectYourPC>3</ProtectYourPC> <SkipMachineOOBE>true</SkipMachineOOBE> <SkipUserOOBE>true</SkipUserOOBE> </OOBE> <UserAccounts> <AdministratorPassword> <Value>SAB5AHAAZQByAEcAcgBpAGQAMQAyADMAQQBkAG0AaQBuAGkAcwB0AHIAYQB0AG8AcgBQAGEAcwBzAHcAbwByAGQA</Value> <PlainText>false</PlainText> </AdministratorPassword> </UserAccounts> </component> </settings> <settings pass="specialize"> <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <RunSynchronous> <RunSynchronousCommand wcm:action="add"> <Order>1</Order> <Path>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" && exit 1 | exit 2"</Path> <Description>Run Cloudbase-Init to set the hostname</Description> <WillReboot>OnRequest</WillReboot> </RunSynchronousCommand> </RunSynchronous> </component> </settings> </unattend> |
---|
...