PowerShell script exchange
Post Reply
matteu
Veeam Legend
Posts: 824
Liked: 128 times
Joined: May 11, 2018 8:42 am
Contact:

Get storage infrastructure information

Post by matteu »

Hello,

I don't find any cmdlet to get all different storage integration I can have on Veeam without to know what is integrated.
I mean, if I know there is netapp, I can use the cmdlet get-netappHost but I would like to know the cmdlet to get all the storage integration and then use the associated cmdlet to have more option.

The scenario :
I execute an audit script to get the storage configuration of a customer and I don't know anything about what hardware he has.

I checked on documentation but maybe I missed the cmdlet.
david.domask
Veeam Software
Posts: 2340
Liked: 554 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get storage infrastructure information

Post by david.domask »

Hi matteu,

I'm not sure if this works for the hosts going through the Universal Storage API (USAPI) Integration as I don't have any in lab, but can you try:

Get-VBRServer | Where-Object {$_.Type -eq 'SANHost'}| Select Name, Type

That should give you a quick list of the added storages under Storage Infrastructure Tab; the properties are a bit different for the type of host checked, and the information is limited, but for quick reporting I think this will work.
David Domask | Product Management: Principal Analyst
matteu
Veeam Legend
Posts: 824
Liked: 128 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get storage infrastructure information

Post by matteu »

Hello,

Thanks for your answer.
Unfortunately, I don't find a property in the result object to identify if environment contains Netapp or Hp3par or other hardware to have more details !

I already make the code for Netapp storage array :

Code: Select all

$Netapp = Get-NetappHost
foreach ($obj in $Netapp )
{
    if ($obj.GetRoles() -contains "ViBackup")
    {
        $ConnectionProtocol = $obj.GetViAccessOptions().SelectedProtocols -join ","
        $Volumes = $obj.GetViAccessOptions().VolumesRescanMode
        $ProxiesAuto = $obj.GetViAccessOptions().SelectproxyAutomatically
    }
    elseif ($obj.GetRoles() -contains "EpBackup")
    {
        $ConnectionProtocol = $obj.GetEpAccessOptions().SelectedProtocols -join ","
        $Volumes = $obj.GetEpAccessOptions().VolumesRescanMode
        $ProxiesAuto = $obj.GetEpAccessOptions().SelectproxyAutomatically

    }
    #Else = NasBackup value
    else
    {
        $ConnectionProtocol = $obj.GetNasAccessOptions().SelectedProtocols -join ","
        $Volumes = $obj.GetNasAccessOptions().VolumesRescanMode
        $ProxiesAuto = $obj.GetNasAccessOptions().SelectproxyAutomatically
    }

    [PSCustomObject]@{
        Name = $obj.Name
        #Adresse de connexion
        ConnectionPoint = $obj.info.ConnPoint
        Role = $obj.GetRoles()
        Credentials = $obj.GetConnectionCredentials().Name
        AdmProtocol = $obj.ConnectionOptions.Protocol
        AdmPort = $obj.ConnectionOptions.Port
        ConnectionProtocol = $ConnectionProtocol
        Volumes = $Volumes
        ProxiesAuto = $ProxiesAuto
    }
}
However if I don't have a way to identify I have netapp in the environment it can't work :/
Or I would have to check for each hardware vendor if it's present like :
if (netapp)
if(hp3par)
if(nimble)
...
Is there a better way :) ?
david.domask
Veeam Software
Posts: 2340
Liked: 554 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get storage infrastructure information

Post by david.domask »

Hi matteu,

Regrettably, the method I listed would require some fairly arcane string validation to be sensible and I don't like the idea of having you go through that.

I think what might make sense is to run the cmdlet I used above to check if any SANHosts exist in the environment -- as I get it, you won't know when running the script what a client has in the environment, so first you can do this check to see if they have _any_ storage integration added; if "No", then continue on in your script, if so, then engage additional processing by just running through each of the cmdlets for retrieving the hosts and checking if they returned anything.

I checked if there was a way via unsupported methods, but it looks not very clean nor reliable. Will discuss if there is a better way of checking this, but for now your idea is likely what you'll need to do (check the cmdlets one by one and see if they return results if you see SANHosts in the Get-VBRServer results)
David Domask | Product Management: Principal Analyst
matteu
Veeam Legend
Posts: 824
Liked: 128 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get storage infrastructure information

Post by matteu »

Thanks for your detailed answer and I hope there is a better way thand the one I provided or maybe it could be added on future version :)
Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 14 guests