Last Modified: Jun 19, 2025
Affected Product(s):
BIG-IQ 1UX Deploy - Evaluate & Deploy
Known Affected Versions:
6.1.0, 7.0.0, 7.0.0.1, 7.0.0.2, 7.1.0, 7.1.0.1, 7.1.0.2, 7.1.0.3, 7.1.6, 7.1.6.1, 7.1.7, 7.1.7.1, 7.1.7.2, 7.1.8, 7.1.8.1, 7.1.8.2, 7.1.8.3, 7.1.8.4, 7.1.8.5, 7.1.9, 7.1.9.7, 7.1.9.8, 7.1.9.9
Opened: Mar 10, 2020 Severity: 4-Minor
When creating an Evaluation or Deployment that creates a Snapshot, you are unable to delete this Snapshot from the Snapshots page. Deleting the original Evaluation or Deployment which, created this Snapshot does not automatically delete the Snapshot. Deleting the Evaluation or Deployment Snapshot prematurely via CLI or Snapshot Properties page causes the undesirable effect of a dangling Evaluation/Deployment
You may be unable to delete certain Snapshots. You may have an Evaluation or Deployment which no longer has an associated Snapshot, which can cause errors when viewing the Evaluation or Deployment.
You create an Evaluation or Deployment.
From the Snapshots page, click the link to view the properties page for the Snapshot you wish to delete. The properties page displays a Delete button at the upper right which will allow you to delete the snapshot. Upon doing so, be sure to delete the corresponding Evaluation or Deployment. If you create/delete deployments frequently and have accumulated a large numbers of stale snapshots (from deleted deployments) then it may become cumbersome to delete each one individually from the properties page. For this you may utilize the following scripts (ones below are tailored to AFM deployments) 1. First script saves snapshots that are in an error state in a new file 2. Second script parses the contents of the generated file and deletes the snapshots Create scripts on the BIG-IQ device with the following code snippets and execute them with the sample usage specified for each one. Script 1: IdentifyDanglingSnapshots.sh Usage: sh IdentifyDanglingSnapshots.sh [username] [password] ##################### IdentifyDanglingSnapshots.sh ############################# # To use, run in bash prompt "sh IdentifyDanglingSnapshots.sh" # the last file generated will be used for the deletion script # the 2nd file from the last has all the names of the Snapshots in question #!/bin/bash datestamp="`date +"%Y%m%dT%H%M"`" filedeployall="/shared/tmp/Deployment-ALL-$datestamp.txt" filesnapall="/shared/tmp/Snapshot-ALL-$datestamp.txt" filedepref="/shared/tmp/deploy-TASKid-$datestamp.txt" filesnapref="/shared/tmp/Snapshot-TASKid-$datestamp.txt" filenodep="/shared/tmp/INFO-ONLY-Nodeploy-$datestamp.txt" filenodslink="/shared/tmp/USE-THIS-TO-DELETE-$datestamp.txt" filenodslinktemp="/shared/tmp/temp-$datestamp.txt" varsnap="cm/firewall/tasks/snapshot-config" vardep="cm/firewall/tasks/deploy-configuration" echo "Export all Deployments to $filedeployall" restcurl -X GET $vardep > $filedeployall echo "Export all Snapshot to $filesnapall" restcurl -X GET $varsnap > $filesnapall echo "Exacting all Reference Task ID from $filesnapall to $filesnapref" cat $filesnapall | jq -r .items[].parentTaskReference.link > $filesnapref DEPCHILD=$(cat $filedeployall | jq -r .items[].childDeployTasks[].parentTaskReference.link 2>/dev/null) if [ -z "$DEPCHILD" ] then echo "No ChildDeployTask" cat $filedeployall | jq -r .items[].parentTaskReference.link > $filedepref else echo "With ChildDeployTask" cat $filedeployall | jq -r .items[].childDeployTasks[].parentTaskReference.link > $filedepref fi while read line; do if [ ! -z "$line" ] then SNAPREF=`cat $filedepref |grep $line` MGTPREF=`echo $line |grep 'declare-mgmt-authority'` if [ -z "$SNAPREF" ] && [ -z "$MGTPREF" ] then snapname=$(cat $filesnapall | jq -r '.items[] | select(.parentTaskReference.link == '\"$line\"') | .name') snapslink=$(cat $filesnapall | jq -r '.items[] | select(.parentTaskReference.link == '\"$line\"') | .id') echo $snapslink >> $filenodslink echo "Snapshot Name: $snapname (Slink: $snapslink) (Task: $line) has no deployment" >> $filenodep fi fi done < "$filesnapref" echo "INFO of Snapshot with no Deployments: $filenodep" echo " " echo "!!! Use this File to delete Snapshot selflinks with no Deployments: $filenodslink" echo " -- Completed Generating Files -- " ######################################################################################### Script 2: DeleteDanglingSnapshots.sh Usage: sh DeleteDanglingSnapshots.sh [username] [password] [/shared/tmp/xxxx-DanglingSnapshotSelfLinks.txt (from above script)] ##################### DeleteDanglingSnapshots.sh ##################### usrname=$1 passwordz=$2 filename=$3 datestamp="`date +"%Y%m%dT%H%M"`" varsnp="/mgmt/cm/firewall/tasks/snapshot-config/" while read line; do if [ ! -z "$line" ] then restcurl -u $usrname:$passwordz -X DELETE $varsnp$line >> /shared/tmp/$datestamp-DeleteDanglingSnapshotsLog.txt sleep 1 fi done < "$filename" #################################################################################
None