User Tools

Site Tools


zededa:workshop:06_persistent_volumes_content_trees

This is an old revision of the document!


Persistent Volumes and Content Trees

Persistent Volumes and Content Trees are the two mechanisms for providing storage to edge applications in ZEDEDA Cloud. They serve different purposes: Persistent Volumes are for stateful read-write storage that survives app restarts and updates, while Content Trees are read-only data volumes sourced from a Datastore and distributed to the node on demand.

Persistent Volumes

What It Is

  • Block or file storage allocated on the edge node's local storage
  • Read-write; data persists across app restarts, config updates, and redeployments
  • Sized at creation time; resizing requires a new volume definition
  • Attached to a specific App Instance at a specified mount path
  • Not shared between multiple app instances unless explicitly designed to be (depends on filesystem type)

ZEDUI

  1. When creating or editing an App Instance, scroll to the Volumes section
  2. Click Add Volume
  3. Enter a volume name, size (GB), and the mount path inside the app (e.g., /data)
  4. Select volume type (block or file)
  5. Save the App Instance; the volume is created on the node at first deployment

Terraform

resource "zedcloud_volume" "app_data" {
  name        = "workshop-app-data"
  title       = "Workshop App Data Volume"
  size_mb     = 10240
  project_id  = zedcloud_project.workshop.id
}
 
resource "zedcloud_application" "workshop_app" {
  # ... other fields ...
  volume_ref {
    volume_id  = zedcloud_volume.app_data.id
    mount_path = "/data"
  }
}

API

# Create the volume
POST /v1/volumes
{
  "name": "workshop-app-data",
  "sizeMB": 10240,
  "projectId": "<project_id>"
}

# Reference in app definition
PATCH /v1/apps/{app_id}
{
  "volumeRefList": [
    { "volumeId": "<volume_id>", "mountDir": "/data" }
  ]
}

What Happens on the Edge Node

  1. EVE-OS allocates the requested volume size from the node's data partition storage pool
  2. The volume is formatted with the appropriate filesystem (ext4 for file volumes, raw block for block volumes)
  3. EVE-OS bind-mounts the volume into the app container or attaches it as a block device to the VM
  4. Data written by the app persists on the node across restarts; it is not automatically synced back to the cloud

Content Trees

What It Is

  • Read-only data volumes sourced from a Datastore
  • Used for distributing large static datasets, ML models, map tiles, firmware blobs, or config bundles to edge nodes
  • The content is fetched from the Datastore at app deployment time and cached on the node
  • Multiple app instances can reference the same content tree (read-only; no write conflicts)

ZEDUI

  1. Navigate to Objects > Content Trees
  2. Click Add Content Tree
  3. Select the Datastore and provide the relative path to the content directory or archive
  4. Enter the expected SHA256 hash for integrity verification
  5. When creating an App Instance, add the Content Tree under the Volumes section and specify the mount path

Terraform

resource "zedcloud_content_tree" "ml_models" {
  name          = "ml-model-v3"
  datastore_id  = zedcloud_datastore.s3_store.id
  rel_url       = "models/v3/model.tar.gz"
  sha256        = "xyz789..."
  project_id    = zedcloud_project.workshop.id
}
 
resource "zedcloud_application" "inference_app" {
  # ... other fields ...
  content_tree_ref {
    content_tree_id = zedcloud_content_tree.ml_models.id
    mount_path      = "/models"
  }
}

API

# Create the content tree
POST /v1/contenttrees
{
  "name": "ml-model-v3",
  "datastoreId": "<datastore_id>",
  "relUrl": "models/v3/model.tar.gz",
  "sha256": "xyz789...",
  "projectId": "<project_id>"
}

# Reference in app definition
PATCH /v1/apps/{app_id}
{
  "contentTreeRefList": [
    { "contentTreeId": "<ct_id>", "mountDir": "/models" }
  ]
}

What Happens on the Edge Node

  1. EVE-OS receives the content tree reference and download instruction from the controller
  2. EVE-OS downloads the content from the Datastore URL, verifies the SHA256 hash
  3. The content is unpacked (if archived) and stored in the EVE-OS volume pool as a read-only image
  4. The content tree is mounted read-only into the app at the specified path
  5. If the content tree version is updated, EVE-OS downloads the new version and remounts on app restart
zededa/workshop/06_persistent_volumes_content_trees.1780243667.txt.gz ยท Last modified: (external edit)