How to Apply Retention Across Multiple Datastores in SynetoOS 4

Written By Sebastian Sime (Draft Writer)

Updated at February 3rd, 2026

→ Applies to: SynetoOS 4.x

 

Step 1. Connect to SynetoOS appliance via SSH as admin

ssh admin@<your_ip_address_or_hostname>

 

Step 2 (optional). Change into Solaris shell (in case you're directed to an unsupported shell)

un sh

 

Step 3. Get root privileges

sudo su -

 

Step 4. List snapshot services

synetoid list

IMPORTANT
From the list, identify the VMs on which the retention policy should be applied

EXAMPLE OUTPUT

root@syneto-os4:/var/storage/admin# synetoid  list
online         May_19   svc:/system/filesystem/zfs/auto-snapshot:weekly-flash--datastores--VM1
online         May_19   svc:/system/filesystem/zfs/auto-snapshot:weekly-flash--datastores--VM2
online         13:30:04 svc:/system/filesystem/zfs/auto-snapshot:daily-flash--datastores--VM1
online         14:00:05 svc:/system/filesystem/zfs/auto-snapshot:daily-flash--datastores--VM3
online         15:00:04 svc:/system/filesystem/zfs/auto-snapshot:daily-flash--datastores--VM4

 

Step 5. Edit /tmp/apply_retention.sh file (replace services with the corresponding ones from Step 4)

vi /tmp/apply_retention.sh

IMPORTANT
Make sure to copy and paste the exact lines below (replace <type_protection> with the protection name (e.g. weekly), <pool_name> with the pool name, and <datastore_name> with the datastore name)

#!/bin/bash

# List of specific services to process
services=(
    "svc:/system/filesystem/zfs/auto-snapshot:<type_protection>-<pool_name>--datastores--<vm_name>"
    "svc:/system/filesystem/zfs/auto-snapshot:<type_protection>-<pool_name>--datastores--<vm_name>"
    "svc:/system/filesystem/zfs/auto-snapshot:<type_protection>-<pool_name>--datastores--<vm_name>"
    "svc:/system/filesystem/zfs/auto-snapshot:<type_protection>-<pool_name>--datastores--<vm_name>"
    "svc:/system/filesystem/zfs/auto-snapshot:<type_protection>-<pool_name>--datastores--<vm_name>"
)

# Apply command and repeat for every service
for service in "${services[@]}"; do
    echo "Synetoid apply-retention on $service"
    synetoid apply-retention "$service"
    sleep 1  # Add small break to avoid high load
done

echo "Operation completed."

Save and EXIT

:wq

 

Step 6. Give permissions to /tmp/apply_retention.sh

chmod +x /tmp/apply_retention.sh

 

Step 7. Run the script

/tmp/apply_retention.sh