This pages describes the configuration to enable users to automate VM first boot with cloud-init.
In private cloud and VCD, Abiquo implements cloud-init with configuration drive. See Configuration drive.
Cloud-init in Abiquo
Abiquo supports two main kinds of first boot automation with cloud-init:
Abiquo built-in functionality:
Guest initial password
Fully qualified domain name (FQDN)
SSH key injection
Configuration drive data including VM variables as user data
Network configuration injection (when DHCP is not present)
User bootstrap script and variables
Configure guest initial password
Configure FQDN
Abiquo can set a hostname and fully qualified domain name (FQDN) before the VM is deployed.
If a user enters an FQDN when they configure the VM, this will override the defaults because it is the highest priority FQDN
If the user does not enter an FQDN, Abiquo uses the following default:
Abiquo database ID (on Windows) or the
VM_uuid
(on Linux); andVM network domain name (from the network of the VM’s NIC or the VDC default network) or
localdomain
To change the default to always generate the automatic VM name from the database ID:
Login to the Abiquo API Server as administrator
Edit the
abiquo.properties
file and set the following property
# Generate VM name from database ID. If false use VM_uuid on Linux and VM_database ID on Windows abiquo.api.experimental.hostname13charsFromVirtualMachineDatabaseId=true
After the user deploys the VM, the user can change the FQDN in the VM operating system. In this case, Abiquo will update the FQDN stored in the platform.
Prepare templates for cloud-init in private cloud
To enable users to work with cloud init, the administrator prepares VM templates that will run cloud-init services or cloudbase-init services (for Windows) or similar. The compatible version of cloud-init is version 0.7.9 or above, or cloudbase-init.
For VMware (vCenter hosts, vCenter clusters, VCD) and other private cloud hypervisors, where cloud-init uses a configuration drive, you might need to prepare the operating system of your VM templates for this configuration.
Edit the cloud config installer file. The location of this file will vary by operating system. For example, /etc/cloud/cloud.conf.d/99-installer.cfg. Set the datasource to ConfigDrive as shown here.
datasource: ConfigDrive: datasource_list: [ConfigDrive]
In the case of Ubuntu 18+, disable any default network configuration utility.
Remove /etc/cloud/cloud.conf.d/subiquity-disable-cloudinit-networking.cfg
Remove /etc/netplan/00-installer-config.yml
Edit templates for cloud-init in Abiquo
To use cloud-init in private cloud:
Edit a cloud-init template in the platform
Go to the Advanced tab
For the Guest setup option select Cloud-init
Optionally, choose to Set initial guest password.
The platform will log in with the template User and Password and change the password to an initial password as configured. The platform will send the initial password to the user via mail or SMS as configured. It does not store the initial password. It is possible to display the initial password using the key button in the Abiquo UISelect the Operating system and enter an optional Version
For the User, enter a user in the template. For Windows enter “Administrator” or for Linux, enter a user with password access to sudo to change the password
For the Password enter the default password of the user on the VM template.
Optionally, go to Bootstrap and paste your configuration or script in the Bootstrap script text box. This can be a cloud configuration, for examples see https://cloudinit.readthedocs.io/en/latest/topics/examples.html, or another startup script that is compatible with cloud init.
Optionally, go to Variables and set predefined variables for the template. The configuration process may use the variables, it will also make them available through the configuration drive as user data or as VM metadata.
To share this template with users in different cloud tenants, go to Scopes and select scopes that contain the required tenants. See Share VM templates