How to Identify VM Storage Folders via CLI in SynetoOS 5

Written By Sebastian Sime (Draft Writer)

Updated at January 29th, 2026

→ Applies to: SynetoOS 5.x

 

Step 1. Connect to SynetoOS appliance via SSH as admin

ssh admin@<your_ip_address_or_hostname>

 

Step 2. Become Super User

sudo su

 

Step 3. Edit /tmp/vmlist file

vi /tmp/vmlist

IMPORTANT
Make sure to copy and paste the exact lines below (replace <pool_name> with the correct pool name)

#!/bin/bash

# Initialize arrays to store VM names and dataset names
vm_names=()
datasets=()

# Loop through each directory in /hybrid/syn-volumes/
for dir in /<pool_name>/syn-volumes/*; do
    # Extract the last part of the directory path as the ZFS dataset name
    dataset=$(basename "$dir")

    # Remove the leading slash from the dataset path
    dataset="${dir#/}"

    # Find the path to the VMX file within the dataset directory
    vmx_file=$(find "$dir" -type f -name "*.vmx" | head -n 1)

    # If VMX file is found, extract the VM name
    if [ -n "$vmx_file" ]; then
        vm_name=$(grep -oP 'displayName\s*=\s*"\K[^"]+' "$vmx_file")
        
        # Add VM name and dataset name to arrays
        vm_names+=("$vm_name")
        datasets+=("$dataset")
    fi
done

# Calculate the maximum length of VM names and dataset names
max_vm_length=$(printf "%s\n" "${vm_names[@]}" | awk '{print length}' | sort -nr | head -n1)
max_dataset_length=$(printf "%s\n" "${datasets[@]}" | awk '{print length}' | sort -nr | head -n1)

# Loop through the arrays and print in columns
for ((i=0; i<${#vm_names[@]}; i++)); do
    # Print the first column in green and the second column as it is
    printf "\e[32m%-*s\e[0m   %s\n" "$max_vm_length" "${vm_names[i]}" "${datasets[i]}"
done

Save and EXIT

:wq

 

Step 4.  Give permissions to /tmp/vmlist file

chmod +x /tmp/vmlist

 

Step 5.  Run the script

/tmp/vmlist

EXAMPLE OUTPUT

Server3    hybrid/syn-volumes/f0a29015-54b1-4458-b2e1-59acb96f1c3a
MailServer hybrid/syn-volumes/a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8