Skip to content

Managing VM Operating System Templates

This section outlines the different types of VM OS templates supported by MetalSoft. The method used to deploy a VM template depends on whether the underlying infrastructure is cloud-init based (pulling images) or uses a copy mechanism (pre-configured virtual machines).


VM Templates are generally categorized into two distinct types based on their source and deployment methodology.

1. Cloud-Init Based VM Templates (Incus Installations)

Section titled “1. Cloud-Init Based VM Templates (Incus Installations)”

These templates rely on pulling base images directly from a registry, typically associated with environments like Incus. This method ensures the VM starts with a clean slate image that is then configured using cloud-init assets.

You can find a sample template here

Structure and Assets: For proper deployment, these templates require four critical assets:

  1. Network Configuration (network-config): Defines networking settings.
  2. User Data (user-data): Provides initial user setup details.
  3. Vendor Data (vendor-data): Contains vendor-specific configuration information.
  4. Source Asset: Specifies the location of the base OS image.

Example Source Asset: The source asset instructs Incus to pull a specific, versioned image from a remote repository:

{
"server": "https://images.linuxcontainers.org",
"alias": "ubuntu/24.04/cloud",
"protocol": "simplestreams",
"mode": "pull"
}

Requirements: Templates utilizing this method require the following installation parameters:

  • install.method: ds_lxd
  • install.readymethod: wait_for_api_response
  • When creating via the API (This is set automatically in the UI): device.type: vm

2. Copy Based VM Templates (vSphere Installations)

Section titled “2. Copy Based VM Templates (vSphere Installations)”

These templates are used when deploying VMs within virtual environments like vSphere, where the template is a direct copy of an existing, pre-configured machine instance.

Structure and Assets: This process requires only one critical asset:

  • Source Asset: Contains the reference name of the VM that was converted into a template on vSphere. It also defines the minimum disk size for the resulting VMs.

Example Source Asset: The template specifies the existing VCenter Template Name and required resources:

{
"templateName": "Ubuntu-22.04-template",
"diskSizeGB": 30
}

Deployment Workflow (Copy Method):

  1. Admin Preparation: An administrator logs into vSphere, creates a VM with the desired OS, installs all necessary packages and tools.
  2. Template Conversion: Once fully configured, the admin converts this working VM into an official Template using standard vSphere tools (UI or CLI).
  3. MetalSoft Configuration: The admin then creates the MetalSoft VM Template entry, specifying the name of the converted template as it appears within vSphere.
  4. Deployment: MetalSoft subsequently provisions new VMs by making copies of this source Template and automatically injecting network and other necessary settings into each individual instance.

Requirements: Templates utilizing this method require the following installation parameters:

  • install.method: copy
  • install.readymethod: wait_for_api_response
  • When creating via the API (This is set automatically in the UI): device.type: vm

Available since 7.5

Container templates are designed for deploying isolated, lightweight containerized environments using technologies like LXC or Incus. These templates follow a structure similar to cloud-init based VM templates, as they pull base images from registries.

Structure and Assets: For proper deployment, these containers require four critical assets:

  1. Network Configuration (network-config): Defines container networking settings.
  2. User Data (user-data): Provides initial user setup details inside the container.
  3. Vendor Data (vendor-data): Contains vendor-specific configuration information.
  4. Source Asset: Specifies the location of the base OS image.

Example Source Asset: This example instructs Incus to pull an Ubuntu cloud image directly from a public registry:

{
"server": "https://images.linuxcontainers.org",
"alias": "ubuntu/24.04/cloud",
"protocol": "simplestreams",
"mode": "pull"
}

Requirements: Container templates require the following installation parameters:

  • install.method: ds_lxd
  • install.readymethod: wait_for_api_response
  • When creating via the API (This is set automatically in the UI): device.type: container