Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/markitobonito/cloud_repositorio/llms.txt

Use this file to discover all available pages before exploring further.

A flavor defines the CPU, RAM, disk, and base image for a virtual machine. Cloud Repositorio ships with two built-in flavors defined in the Flavor class in models.py. When you add a VM to a slice, you select one of these flavors and the orchestrator uses its specs to size the QEMU process and provision the backing disk image.

Available flavors

NameCoresRAMDiskBase image
cirros10.5 GB1 GB/tmp/vm_images/cirros-0.6.2-x86_64-disk.img
ubuntu10.5 GB2.2 GB/tmp/vm_images/focal-server-cloudimg-amd64.img
The cirros flavor is a minimal Linux image suited for network connectivity testing. The ubuntu flavor boots Ubuntu 20.04 (Focal) and is appropriate for running services. The FLAVORS dict as defined in models.py:
class Flavor:
    FLAVORS = {
        "cirros": {"cores": 1, "ram_gb": 0.5, "disk_gb": 1, "image": "/tmp/vm_images/cirros-0.6.2-x86_64-disk.img"},
        "ubuntu": {"cores": 1, "ram_gb": 0.5, "disk_gb": 2.2, "image": "/tmp/vm_images/focal-server-cloudimg-amd64.img"}
    }

QCOW2 thin provisioning

QCOWManager.create_backing_image() prepares a per-VM disk image on the target worker using QCOW2 backing files:
  1. Checks whether the base image already exists on the worker at ~/vm_images/.
  2. If the base image is missing, SCP-copies it from the manager host to the worker:
    scp /tmp/vm_images/<base_filename> ubuntu@<worker_ip>:~/vm_images/
    
  3. Creates a thin-provisioned QCOW2 image backed by the base image:
    qemu-img create -f qcow2 -b <base_filename> -F qcow2 <vm_name>_img.qcow2
    
Because the new image uses the base image as a backing file, only blocks written by the VM consume additional disk space. This means deploying ten VMs from the same base image does not require ten full copies of the image on the worker.

Base image location

Images must exist at the paths defined in Flavor.FLAVORS on the manager host — these are the SCP source paths. On each worker, images are cached at ~/vm_images/ (the QCOWManager default base_dir). The manager will attempt the SCP copy automatically on first deployment, but pre-staging the images on workers eliminates the transfer delay.

Adding a new flavor

Flavors are hardcoded in the FLAVORS dict in models.py. To add a flavor, edit that dict:
"myflavor": {"cores": 2, "ram_gb": 1.0, "disk_gb": 5, "image": "/tmp/vm_images/myimage.img"}
Then update add_vm_menu() in cli.py to display the new flavor as a selectable option. No other changes are required — the orchestrator reads flavor specs directly from Flavor.FLAVORS at VM creation time.
VMLauncher converts flavor specs to QEMU arguments using flavor.get("cores", 1) for -smp and int(flavor.get("ram_gb", 0.5) * 1024) for -m (converting GB to MB). For example, a flavor with ram_gb: 0.5 produces -m 512 and cores: 1 produces -smp 1.

Build docs developers (and LLMs) love