TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/stratosphere-ve/ozone/llms.txt
Use this file to discover all available pages before exploring further.
vmparser package is the configuration backbone of Ozone. It reads, deserializes, and writes JSON-based VM definition files stored under the vms/ directory, exposing a structured Go API for every field of a virtual machine’s configuration — from CPU topology and memory allocation through network identity and disk layout.
Types
VM
VM is the top-level struct that represents a complete virtual machine configuration. It is the root object stored in each vms/<name>.json file and is returned by the full-parse functions.
Identity and metadata for the virtual machine. Maps to the
"vm" JSON key.CPU topology configuration. Maps to the
"cpu" JSON key.Memory allocation configuration. Maps to the
"memory" JSON key.Network interface configuration. Maps to the
"network" JSON key.Primary disk configuration. Maps to the
"disk" JSON key.VMInfo
VMInfo holds the identifying metadata for a VM.
Human-readable name of the virtual machine. Also used as the filename stem (
vms/<Name>.json). Maps to the "name" JSON key.Universally unique identifier for the VM. Maps to the
"uuid" JSON key.ISO 8601 timestamp recording when the VM was created. Maps to the
"created_at" JSON key.CPU
CPU describes the processor configuration presented to the guest.
Number of virtual CPU cores allocated to the VM. Maps to the
"cores" JSON key.CPU model string passed to QEMU (e.g.
"host", "qemu64"). Maps to the "type" JSON key.Memory
Memory describes the RAM allocation for the VM.
Amount of memory in mebibytes (MiB) allocated to the VM. Maps to the
"size_mb" JSON key.Network
Network describes the virtual network interface attached to the VM.
Host network interface name (e.g.
"eth0", "virbr0") bridged to the VM. Maps to the "interface" JSON key.QEMU network device model (e.g.
"virtio-net-pci", "e1000"). Maps to the "type" JSON key.MAC address assigned to the VM’s network interface (e.g.
"52:54:00:ab:cd:ef"). Maps to the "mac" JSON key.Disk
Disk describes the primary block device attached to the VM.
Logical name for the disk (e.g.
"primary"). Maps to the "name" JSON key.Filesystem path to the disk image file (e.g.
"images/myvm.qcow2"). Maps to the "path" JSON key.Provisioned size of the disk in gibibytes (GiB). Maps to the
"size_gb" JSON key.Disk image format string (e.g.
"qcow2", "raw"). Maps to the "format" JSON key.Parser Functions
Parser functions each openvms/<vmname>.json, unmarshal the full VM document, and return only the requested section. They return a pointer to the relevant struct together with an error; the error is non-nil if the file cannot be read or the JSON is malformed.
VMParser
vms/<vmname>.json and deserializes the entire document into a VM struct. Returns a pointer to the populated struct, or an error if the file is missing or the JSON cannot be parsed. This is the primary entry point used by most other functions in the package.
VMParserVMInfo
VMInfo section (name, UUID, creation timestamp), leaving all other fields unpopulated in the caller’s scope.
VMParserCPU
CPU section (core count and CPU type string).
VMParserMemory
Memory section (size in MiB).
VMParserNetwork
Network section (interface name, device type, and MAC address).
VMParserDisk
Disk section (name, path, size, and format).
Getter Shortcuts
Getter functions are thin convenience wrappers aroundVMParser. Each calls VMParser internally, checks the error, and returns either the requested value or a zero value alongside the propagated error. Use these when you need a single scalar field without constructing the full VM struct yourself.
GetVM
VM struct for the named machine. Equivalent to calling VMParser directly.
GetCPU
CPU struct for the named VM.
GetCPUCores
GetCPUType
GetMemory
Memory struct for the named VM.
GetMemorySizeMB
GetNetwork
Network struct for the named VM.
GetMAC
GetInterface
GetDisk
Disk struct for the named VM.
GetDiskSizeGB
GetDiskPath
GetVMInfo
VMInfo struct (name, UUID, creation timestamp) for the named VM.
GetVMName
GetVMUUID
Writer Functions
Writer functions perform a read-modify-write cycle: they load the existingvms/<vmname>.json (if it exists), replace only the targeted section with the supplied value, re-serialize the full VM struct with two-space indentation, and write the result back to disk. All sections not explicitly targeted are preserved unchanged.
VMParserWriterInfo
VMInfo value into the existing config file for the VM identified by info.Name, then writes the updated document back to vms/<info.Name>.json. All other sections (CPU, Memory, Network, Disk) are left intact. Returns an error if marshaling or the write operation fails.
VMParserWriterCPU
CPU section of vms/<vmname>.json with the provided CPU value. All other sections are preserved. Returns an error if marshaling or the write operation fails.
VMParserWriterMemory
Memory section of vms/<vmname>.json with the provided Memory value. All other sections are preserved. Returns an error if marshaling or the write operation fails.
VMParserWriterDisk
Disk section of vms/<vmname>.json with the provided Disk value. All other sections are preserved. Returns an error if marshaling or the write operation fails.
VMParserWriterNetwork
Network section of vms/<vmname>.json with the provided Network value. All other sections are preserved. Returns an error if marshaling or the write operation fails.