Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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):

  • Linux VM Templates (CentOS/Ubuntu): Update the following values in the

      1. CentOS*


    1. ----------*
      sudo yum update -y
      sudo yum install -y cloud-init

      # Update /etc./cloud/cloud.cfg
      # to allow root and password authentication run the following command
      sudo sed -i 's/ssh_pwauth: false/ssh_pwauth: true/g' /etc./cloud/cloud.cfg
      sudo sed -i 's/disable_root: true/disable_root: false/g' /etc./cloud/cloud.cfg

  1. vim:syntax=yaml
    datasource_list: ["NoCloud", "ConfigDrive"]

    1. CentOS 6.x and below*
    2. ---------------------------*
  2. 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

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

...