Cloud-Init

How Cloud-init Works in CloudCIX

Reference Documentation

Full generic documentation for Cloud-init from the developers of Cloud-init, Canonical, is available at Cloud-init.

Warning

The text below describes how Cloud-init is implemented in CloudCIX. Other Cloud providers may deploy it differently.

What is Cloud-init

Cloud-init is the industry standard multi-distribution method for cross-platform cloud instance initialization. On instance boot, cloud-init will identify the cloud it is running on, read any provided metadata from the cloud, and initialize the system accordingly. This may involve setting up the network and storage devices, configuring SSH access keys, and setting up many other aspects of a system. Later in the install process, cloud-init will parse and process any optional user or vendor data that is passed to the instance.

Where is the metadata server located

Metadata is provided by a metadata server. The metadata server responds with both metadata (required to configure the VM), and later during the install, userdata that is passed to the VM instance. The URLs for both data types are:

http://169.254.169.254/v1/metadata

http://169.254.169.254/v1/userdata

v1 refers to the CloudCIX Cloud-init version number and may be updated in the future.

CloudCIX and most Cloud providers, by convention, use the IP Address 169.254.169.254 as the IP Address for the metadata server.

Every VM in a project is connected to one or more private RFC 1918 networks. One of those networks must be a ‘gateway network’ and it contains one IP address that is called the gateway address. If a VM is only connected to one network then by default that network is the gateway network. All traffic, not intended for directly attached networks is sent to the gateway address. Every project has a VRF that provides it network requirements (routing, NAT, firewall etc.) The gateway address is on the VRF. Therefore if a VM requests metadata from 169.254.169.254, that request will be sent to the gateway which has a direct connection to the metadata server because the same Linux network namespace (aka VRF) provides the gateway IP address and the meta data server IP address.

MAC Addresses

In order for Cloud-init to deploy, early in the boot sequence, network information for the VM is provided by DHCP. Each VM will potentially have different metadata and the correct metadata will be served based on the source IP address of the request. The VM will have an interface with a different MAC address for each network it’s connected to, and will make a DHCP request on each of these interfaces to fetch the IP addresses specified by the user.

Each VM has an interface for each network it is connected to. Each interface has a MAC address. VMs make a DHCP request on each interface to fetch the associated IP address specified by the user. Only one network (the )

The metadata server will use the VM’s IP address to return the correct metadata.

Note

In CloudCIX, routers are implemented as network namespaces within the Podnet project. If a network has a VM, requiring Cloud-init and using that network as a gateway, then a DHCP server is provided, by Podnet, from the gateway address. The DHCP server maps a unique MAC address to the IP Address selected by the user.

Locally Administered MAC Addresses

There are four ranges of MAC addresses that can be used in Cloud environments that will not clash with manufacturer assigned MAC addresses. Because networks can span Regions, CloudCIX keeps MAC addresses unique on a per COP basis.

MAC Range

Hypervisor Type

x2-xx-xx-yy-yy-yy

KVM

x6-xx-xx-yy-yy-yy

Hyper-V

xA-xx-xx-yy-yy-yy

Reserved for future use

xE-xx-xx-yy-yy-yy

Reserved for future use

  • Every Project has one VRF.

  • Every Network in a Project has one interface on that VRF.

  • Every Network has a DHCP server.

  • Every VM is connected to one or more Networks.

  • Every VM has one interface for each Network it is connected to.

  • Every Interface is assigned a MAC address.

  • “x” is the hexadecimal of the ID of the region for the VM

  • “y” is the hexadecimal of the ID of the interface for the VM

Using Cloud-init in CloudCIX

CloudCIX supports Cloud-init with the following images.

Operating System Images supporting Cloud-Init in CloudCIX

Image Operating System

Version

Ubuntu

22.04

Ubuntu

24.04

Rocky

8.5

Rocky

9.0