**Language / Язык:** [English](storage.md) | [Русский](../ru/domains/storage.md)

# Storage

Datastores, datastore file metadata, host storage devices, and storage
policies:
[`app/vsphere/rest/router.py`](../../app/vsphere/rest/router.py),
[`content_rest.py`](../../app/vsphere/rest/content_rest.py),
[`platform_rest.py`](../../app/vsphere/rest/platform_rest.py),
[`app/vsphere/domain/content.py`](../../app/vsphere/domain/content.py).

## Endpoints

| Method | Path | Notes |
|---|---|---|
| GET | `/api/vcenter/datastore[/{datastore}]` | Type (`VMFS`/`NFS`), capacity, free space, `multiple_host_access` |
| GET/POST | `/api/vcenter/datastore/{datastore}/files` | List / register file metadata (ISOs, VMX, VMDK paths) |
| GET | `/api/vcenter/host/{host}/storage/storage-device` | Seeded local disk devices (`naa.*`, capacity, SSD flag) |
| GET | `/api/vcenter/storage/policies[/{policy}/vm]` | Storage-based policy management, incl. `policy_type: VSAN` lab policies |

Legacy `GET /rest/vcenter/datastore` mirrors the list in a
`{ "value": … }` envelope.

## Highlights

- Datastore rows are seeded with realistic capacity/free-space pairs
  (`type`, `capacity`, `free_space`, `accessible`,
  `multiple_host_access`) — see
  [`app/vsphere/profiles.py`](../../app/vsphere/profiles.py).
- File metadata lives in `vsphere_datastore_files` (`path`, `size`, `type`);
  the seed pre-populates ISOs and a VM's `.vmx`/`.vmdk` entries
  (`seed_platform_extras`).
- Storage policies include a lab `RAID1` vSAN-labelled policy — see the
  "Platform surfaces" table in [API coverage](../api-coverage.md) for the
  vSAN caveat (seeded lab data, not a real vSAN cluster).
- Host storage devices are per-host synthetic disks, not real ESXi VMFS
  extents — capacity/SSD flags vary deterministically by host index.
