#Timeout while deleting many snapshots...

1 messages · Page 1 of 1 (latest)

woven ore
#

Hi there, I am using the latest PS Toolkit from the PS Gallery... I am trying to delete "a lot" of snapshots from different volumes, but the command is very slow and on volumes with many snapshots, it times out with errors like "remove-ncsnapshot : Record doesn't exist" and "Get-NcSnapshot : The operation has timed out"...
The command is fairly simple: Get-NcSnapshot -volume $vol | where-object { $.Created -lt $120days -and $.SnapmirrorLabel -match "Hourly" } | remove-ncsnapshot

It works with volumes that has 10-200 snapshots.. but on volumes with 800 snapshots it takes forever to just get to the point where you confirm that you want to delete... and if you select "A" to delete all, it takes minutes before I can see that i manages to delete one or two snapshots... then it times out...
It is actually faster to delete the snapshots manually in the GUI... only thing is that I need to do it 20 at a time...
Is there any way to make this go faster?
(This is running up against an A300 cluster, not heavy loaded at all....)

wintry stream
#

Get-NcSnapshot pulls a LOT of attributes. Telling it to only get the attrs needed for your task should speed it up. I’m not at a computer yet so if someone else doesn’t respond by the time I look at this again, I’ll help out.

woven ore
wintry stream
#

I think either way will get you what you need and the difference would be negligible.
I do recommend adding some additional uniqueness to the records you're pulling: volume name and snapshot UUID

woven ore
#

Yeah I already do a "filter" with |where-object looks for a snapshots older than a date, and where the snapmirrorlabel is set to "Hourly"... Basically I ended up deleting the most important once via the web GUI because you can filter by searching for "hourly" and then just delete 20 snapshots at a time... still very much faster than powershell which I think is really sad...