Assets Specification¶
Assets define external resources like disk images, ISOs, and other files that your VMs can use. They provide a way to reference and manage external dependencies in your manifests.
Structure¶
spec:
assets:
- name: "asset-name"
type: "virtual_disk"
format: "raw"
url: "https://example.com/image.img"
Required Fields¶
name¶
- Type:
string
- Description: Unique asset identifier within the manifest
- Constraints: DNS-1123 compliant, lowercase, alphanumeric with hyphens
type¶
- Type:
string
- Values:
"virtual_disk"
- Description: Asset type identifier
format¶
- Type:
string
- Values:
"raw"
,"qcow2"
,"iso"
- Description: Asset file format
url¶
- Type:
string
- Description: HTTPS URL to download the asset
- Constraints: Must be HTTPS, publicly accessible
Asset Types¶
Virtual Disk¶
Disk images for VM storage:
- name: "ubuntu-image"
type: "virtual_disk"
format: "raw"
url: "https://storage.googleapis.com/demo-bucket/ubuntu-22.04.img"
ISO Images¶
ISO files for installation or tools:
- name: "install-iso"
type: "virtual_disk"
format: "iso"
url: "https://releases.ubuntu.com/22.04/ubuntu-22.04.3-live-server-amd64.iso"
Usage in Resources¶
Reference assets in storage devices:
storage_devices:
- name: "root-disk"
type: "virtio_disk"
source: "ubuntu-image" # References asset name
capacity: 53687091200
boot: 1
Best Practices¶
- Use versioned URLs for reproducible deployments
- Host assets reliably on CDNs or stable storage
- Optimize sizes for faster deployment
- Use descriptive names that indicate content
- Document asset sources for maintainability
Examples¶
Linux Base Images¶
assets:
- name: "ubuntu-server"
type: "virtual_disk"
format: "raw"
url: "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img"
- name: "centos-stream"
type: "virtual_disk"
format: "qcow2"
url: "https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2"
Windows Images¶
assets:
- name: "windows-server"
type: "virtual_disk"
format: "raw"
url: "https://storage.example.com/windows-server-2022.img"