> ## Documentation 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.

# VM Configuration File Structure and Schema in Ozone

> Ozone stores each virtual machine as a JSON file in vms/. Learn how configs are structured and how the vmparser package maps them to typed Go structs.

Ozone represents every managed virtual machine as a single JSON file stored on disk. When you create or register a VM, Ozone writes a configuration file into a local `vms/` directory. All subsequent operations — starting, inspecting, or modifying a VM — read from that file, making the configuration the single source of truth for the machine's desired state.

## File naming convention

Each configuration file is named after the virtual machine it describes:

```text theme={null}
vms/<vmname>.json
```

For example, a VM named `web-01` is stored at `vms/web-01.json`. The name must be consistent: it is embedded in the `vm.name` field inside the file and also determines the file path used by every `vmparser` read and write function.

## Top-level configuration sections

A VM configuration file contains five top-level JSON objects. Each maps directly to a typed Go struct in the `vmparser` package.

| Section   | Go struct | Purpose                                         |
| --------- | --------- | ----------------------------------------------- |
| `vm`      | `VMInfo`  | Identity — name, UUID, creation timestamp       |
| `cpu`     | `CPU`     | Processor — core count and CPU model            |
| `memory`  | `Memory`  | RAM allocation in megabytes                     |
| `network` | `Network` | Network interface, type, and MAC address        |
| `disk`    | `Disk`    | Block device name, path, size, and image format |

## The `vmparser` package

All file I/O is handled by the `vmparser` package, which uses Go's standard `encoding/json` and `os` packages. There are no external dependencies. Reader functions parse the full JSON file on every call and return typed pointers; writer functions read the existing file first, merge in the new value, then write the updated document back to disk — preserving all other sections.

<CardGroup cols={2}>
  <Card title="Schema Reference" icon="file-code" href="/vm-config/schema">
    Complete field-by-field reference for every JSON key in a VM configuration file.
  </Card>

  <Card title="Reading Configs" icon="magnifying-glass" href="/vm-config/reading">
    Use `VMParser`, `GetCPU`, `GetDisk`, and the full suite of getter functions.
  </Card>

  <Card title="Writing Configs" icon="pen-to-square" href="/vm-config/writing">
    Use `VMParserWriterCPU`, `VMParserWriterDisk`, and the other writer functions.
  </Card>
</CardGroup>
