# cloudhv_vm_create

Create a new Cloud Hypervisor virtual machine.

```rhai
cloudhv_vm_create(spec) -> string
```

## Parameters

- `spec` (map): VM specification with the following fields:
  - `id` (string, required): Unique VM identifier
  - `disk_path` (string, required): Path to disk image
  - `kernel_path` (string, optional): Path to kernel (for direct boot)
  - `firmware_path` (string, optional): Path to firmware (for UEFI boot)
  - `api_socket` (string, optional): API socket path (defaults to auto-generated)
  - `vcpus` (int, optional): Number of virtual CPUs (default: 1)
  - `memory_mb` (int, optional): Memory in MB (default: 512)
  - `cmdline` (string, optional): Kernel command line
  - `extra_args` (array, optional): Additional cloud-hypervisor arguments

## Returns

Returns the VM ID as a string.

## Examples

```rhai
// Create a VM with kernel boot
let vm_spec = #{
    id: "myvm",
    kernel_path: "/path/to/vmlinux",
    disk_path: "/path/to/disk.qcow2",
    vcpus: 2,
    memory_mb: 1024,
    cmdline: "console=ttyS0 root=/dev/vda1"
};

let vm_id = cloudhv_vm_create(vm_spec);
print("VM created: " + vm_id);

// Create a VM with UEFI boot
let uefi_spec = #{
    id: "uefi-vm",
    firmware_path: "/path/to/OVMF.fd",
    disk_path: "/path/to/disk.qcow2",
    vcpus: 4,
    memory_mb: 2048
};

let vm_id2 = cloudhv_vm_create(uefi_spec);
```

## Notes

- Either `kernel_path` or `firmware_path` must be specified
- VM is created but not started automatically
- Use `cloudhv_vm_start()` to start the VM
