> For the complete documentation index, see [llms.txt](https://docs.stg.ai.neevcloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stg.ai.neevcloud.com/ai-storage/deletion-and-data-management.md).

# Deletion & Data Management

Properly managing the deletion of GPU instances and storage volumes is critical to prevent accidental data loss and control costs.

## Deleting GPU Instances

When you delete a GPU instance that has storage attached, NeevCloud protects you from accidental data loss with clear warnings and options.

### Deletion Workflow

1. You initiate GPU instance deletion from the dashboard.
2. You're presented with two options:
   * **Cancel**: Abort the deletion and keep everything running.
   * **Delete**: Proceed with instance deletion.

### What Happens to Your Storage

| Storage Type               | What Happens                 |
| -------------------------- | ---------------------------- |
| Ephemeral                  | Always deleted with instance |
| Persistent Local Disk      | Deleted with instance        |
| Persistent Network Storage | Deleted with instance        |

> **Important**: Persistent local disk storage is always deleted when the GPU instance terminates, regardless of retention policy, because it's physically tied to that specific node.

## Deleting Storage Volumes

When you want to delete a storage volume directly (not as part of instance deletion), NeevCloud ensures you understand the permanent nature of this action.

### Deletion Workflow

1. You select a storage volume and click "Delete".
2. A warning appears:

   > "Deleting storage attached to GPU instances will permanently remove data and it cannot be recovered."
3. You must type the exact **Storage Name** to confirm deletion.
4. You're presented with two options:
   * **Cancel**: Abort the deletion.
   * **Delete**: Permanently remove the storage volume.

### Why This Is Important

Storage deletion is irreversible. Once you delete a storage volume:

* All data on that volume is permanently lost.
* You cannot recover files, checkpoints, or datasets.
* Any GPU instances using that storage will lose access.
* There is no "recycle bin" or recovery period.

## Data Protection Best Practices

Before deleting any persistent storage:

1. **Verify you have backups of critical data**:

   ```bash
   # Download important checkpoints
   scp -r root@<IP>:/data/checkpoints ./local_backup/
      
   # Export final models
   scp root@<IP>:/data/final_model.pth ./production_models/
   ```
2. **Check if any running instances are using the storage**:
   * Review your instance dashboard.
   * Confirm no active training jobs depend on this data.
3. **Document what you're deleting**:
   * Note the storage name, size, and contents.
   * Keep records of why you're deleting it.
   * Update any documentation that references this storage.
4. **Use external backup solutions for production data**:
   * Push critical checkpoints to S3, GCS, or Zata Storage.
   * Use version control (DVC, Git LFS) for datasets and models.
   * Maintain off-platform backups of irreplaceable data.

### For Production Workflows

Consider implementing a backup strategy:

```bash
# Regular backup script example
#!/bin/bash
# Sync important data to external storage
rsync -avz /data/checkpoints/ user@backup-server:/backups/project-checkpoints/
aws s3 sync /data/models/ s3://my-bucket/model-archive/
```

## Retention Policy Management (Coming Soon)

Future NeevCloud releases will give you more granular control over data retention:

* Define how long storage persists after GPU termination.

> ⚠️ **Warning**: Always ensure important data is backed up before deleting persistent storage.
