PowerShell script exchange
Post Reply
cczinski
Novice
Posts: 5
Liked: 1 time
Joined: Apr 23, 2021 8:01 pm
Full Name: Carl Czinski
Contact:

Set-NetAppHost Slowly Diminishes Include list?

Post by cczinski »

I shall explain...

We need to add some volumes to our include list for each NetApp host on our VBR. So, I wrote some PowerShell to go ahead and loop through each NetApp Host on the VBR and run the following Veeam PowerShell commands to do this:

This to grab all the volumes for a NetApp Host

Code: Select all

 $volumes = Get-NetAppInfrastructureVolume -Host $appHost
Some other code is run to filter out the volumes we need to add to eventually populate this variable

Code: Select all

$volumesToAdd = $volumes | Where-Object {$missingVolumes.Name -contains $_.Name}
Then we just need to add the volumes to the include list with this

Code: Select all

Set-NetAppHost -Host $appHost -VolumeScanType Include -IncludedVolume $volumesToAdd
Wait about 2-5 mins for the list to update (not sure if that’s normal) and then it will have the new volumes I added.

Code: Select all

(Get-NetAppVolume -Host $appHost).Count
65
This is great until you check about 15 minutes or so later to see that the list you added volumes to, has now lost 8 volumes and is slowly going down every few minutes or so.

Code: Select all

(Get-NetAppVolume -Host $appHost).Count
57
I’m not quite sure what is going. I could maybe understand it removing the volumes I added which were like 2. But for it to then remove like 30 over the course of a few hours is kind of crazy.

Hoping I'm missing something like another parameter to actually not kill off the include list or something.

(side question) Is it normal that it takes like 2-5 minutes for the list to update after the command was successful?
cczinski
Novice
Posts: 5
Liked: 1 time
Joined: Apr 23, 2021 8:01 pm
Full Name: Carl Czinski
Contact:

Re: Set-NetAppHost Slowly Diminishes Include list?

Post by cczinski » 1 person likes this post

Nevermind this post, I miss understood how the IncludedVolume worked. I thought it would add to the list, not make the list what I gave it.

After giving the command all the volumes plus the 2 new ones I wanted, the list properly updated instantly in the GUI and a couple minutes later showed up properly from the PowerShell command.

Sorry about that.
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Set-NetAppHost Slowly Diminishes Include list?

Post by oleg.feoktistov »

Hi Carl,

Glad you could figure it out. That's the idea of all Set cmdlets. If you want to expand an array of included objects, you need to do it primarily to passing this array to the cmdlet parameter.

Thanks,
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests