# VM Configuration Defaults
#
# Default values for VM configurations
# Migrated from provisioning/kcl/vm.k

let contracts = import "contracts.ncl" in

{
  default_vm_config = {
    name = "default-vm",
    base_image = "ubuntu-22.04",
    cpu = 2,
    memory_mb = 4096,
    disk_gb = 20,
    backend = 'libvirt,
    permanent = false,
    temporary = false,
    auto_cleanup = false,
    taskservs = [],
    network_mode = 'bridge,
    nested_virt = false,
    graphics_enable = false,
    serial_console = true,
  } | contracts.VmConfig,

  default_vm_image = {
    name = "ubuntu-base",
    format = 'qcow2,
    path = "/var/lib/libvirt/images/ubuntu-22.04.qcow2",
    size_gb = 20,
    base_os = 'ubuntu,
    os_version = "22.04",
  } | contracts.VmImage,

  default_vm_network = {
    name = "default",
    type = 'nat,
  } | contracts.VmNetwork,

  default_vm_volume = {
    name = "data",
    size_gb = 10,
    format = 'qcow2,
  } | contracts.VmVolume,

  default_vm_state = {
    vm_name = "default",
    state = 'stopped,
    permanent = false,
    created_at = "2025-01-01T00:00:00Z",
  } | contracts.VmState,

  default_vm_capacity = {
    host_name = "localhost",
    total_cpu_cores = 8,
    used_cpu_cores = 0,
    total_memory_mb = 16384,
    used_memory_mb = 0,
    total_disk_gb = 500,
    used_disk_gb = 0,
    max_vms = 10,
    running_vms = 0,
  } | contracts.VmCapacity,

  # Common VM templates
  test_vm = {
    name = "test-vm",
    base_image = "ubuntu-22.04",
    cpu = 2,
    memory_mb = 2048,
    disk_gb = 10,
    temporary = true,
    auto_cleanup = true,
    auto_cleanup_hours = 24,
  } | contracts.VmConfig,

  dev_vm = {
    name = "dev-vm",
    base_image = "ubuntu-22.04",
    cpu = 4,
    memory_mb = 8192,
    disk_gb = 50,
    permanent = true,
    taskservs = ["git", "docker", "rust"],
  } | contracts.VmConfig,
}
