VEEAM

HomeLab – Veeam VBR Documentation with AsBuiltReport

Hello everyone!

As you know, due to the impact of the Covid-19 pandemic, I haven’t had much room to do anything but stay confined to my home 😒. Another reason is that many of my family members have tested positive for the virus. So this situation has been the best excuse for me to get into development. Recently I have received many requests from users and friends to develop a report to document the Backup application made by “Veeam”.

For this reason, I took on the task of developing one more report, yes one more 🤣 and it is related to the documentation of “Veeam Backup & Replication” implementations. Currently only the latest version of Veeam is supported but I will evaluate in the future the possibility of adding support for versions prior to 11. This project is based on the AsBuildReport framework created by “Tim Carman” @tpcarman (Project Page).

The report is in an early stage and under constant development, but I have decided to release it to the public to receive recommendations or rather to encourage other developers to contribute to improve its content. The code of the report is in Github so I leave here the link in order that you can see the status and objective of the project.

Important: The module is not yet available in the PowerShell Gallery so I will be installing it manually.

Now, to get started, the following requirements must be met:

  • Windows OS (Veeam modules run on Windows only)
  • PowerShell v5.1+
  • AsBuiltReport.Core module >= 1.1.0
  • Veeam.Backup.PowerShell module >= 1.0

To validate the Powershell version, the variable “$PSVersionTable” can be used from a PowerShell console:

PS C:\Users\jocolon> $PSVersionTable


Name                           Value
----                           -----
PSVersion                      5.1.19041.1320
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1320
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1


PS C:\Users\jocolon>

To confirm if the required modules are present, the “Get-Module” cmdlet can be used as shown in the following example:

PS C:\Users\jocolon> Get-Module -ListAvailable -Name @('Veeam.Backup.PowerShell','AsBuiltReport.Core')



    Directory: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.1.0      AsBuiltReport.Core                  {New-AsBuiltReport, New-AsBui...}


    Directory: C:\Program Files\Veeam\Backup and Replication\Console


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Manifest   1.0        Veeam.Backup.PowerShell             {Get-VBRComputerFileProxyServer, New-VBRSanInt...


PS C:\Users\jocolon> 

If the command does not return any results, it means that the modules are not installed. To install the AsBuiltReport.Core dependency use the traditional “Install-Module” command:

PS C:\Users\jocolon> Install-Module -Name AsBuiltReport.Core 
                                                                                                                                                                                                                                                                              Installing package 'AsBuiltReport.Core'   
                                                                                                                                                                                                                                                     Copying unzipped package to '..\2052046370\AsBuiltReport.Core'  
                                                                                                                                                                                           [oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo]   
 
PS C:\Users\jocolon> 

It is important to point out that the Veeam.Backup.PowerShell modules are available on the Veeam Backup server or on any device where the management console is already installed. Reference:

The remote machine from which you run Veeam PowerShell commands must have the Veeam Backup & Replication Console installed. After you install the Veeam Backup & Replication Console, Veeam PowerShell module will be installed by default

Veeam PowerShell Reference

Once the prerequisites are met the installation of the main module “AsBuiltReport.Veeam.VBR” can continue. Since this report has not yet been publicly released in “PowerShell Gallery” I will perform the installation manually. The first step is to download the code from the Github portal here.

Files can be downloaded through the Powershell console:

$Source = "https://github.com/AsBuiltReport/AsBuiltReport.Veeam.VBR/archive/refs/heads/dev.zip"
$Destination = '.\AsBuiltReport.Veeam.VBR.zip'

PS C:\Users\jocolon> Invoke-WebRequest -Uri $Source -OutFile $Destination

 Writing web request
    Writing request stream... (Number of bytes written: 51202)

PS C:\Users\jocolon> ls AsBuiltReport.Veeam.VBR.zip

    Directory: C:\Users\jocolon

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----             1/7/2022 1:58 PM         86404 AsBuiltReport.Veeam.VBR.zip

PS C:\Users\jocolon>

Once the source code is downloaded, you need to unzip the file, use the “Expand-Archive” cmdlet to achieve this goal.

PS C:\Users\jocolon> Expand-Archive -Path ./AsBuiltReport.Veeam.VBR.zip -DestinationPath .

PS C:\Users\jocolon> Rename-Item -Path .\AsBuiltReport.Veeam.VBR-dev -NewName .\AsBuiltReport.Veeam.VBR

PS C:\Users\jocolon> ls AsBuiltReport.Veeam.VBR

    Directory: C:\Users\jocolon\AsBuiltReport.Veeam.VBR-dev

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----          1/7/2022   2:08 PM                .github
d-----          1/7/2022   2:08 PM                .vscode
d-----          1/7/2022   2:08 PM                Src
-a----          1/5/2022  10:52 AM           1191 AsBuiltreport.Veeam.VBR.json
-a----          1/5/2022  10:52 AM           3996 AsBuiltReport.Veeam.VBR.psd1
-a----          1/5/2022  10:52 AM            542 AsBuiltReport.Veeam.VBR.psm1
-a----          1/5/2022  10:52 AM          56642 AsBuiltReport.Veeam.VBR.Style.ps1
-a----          1/5/2022  10:52 AM           1871 CHANGELOG.md
-a----          1/5/2022  10:52 AM           1070 LICENSE
-a----          1/5/2022  10:52 AM          11796 README.md

PS C:\Users\jocolon> 

Next it is required to copy the unzipped folder “AsBuiltReport.Veeam.VBR” to a path set in $env:PSModulePath. To do this, you must first identify the folder where the content will be copied.

PS C:\Users\jocolon> $env:PSModulePath.split(";")

C:\Users\jocolon\Documents\WindowsPowerShell\Modules
C:\Program Files\WindowsPowerShell\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
C:\Program Files\Veeam\Backup and Replication\Console\
C:\Program Files\Veeam\Backup and Replication\Explorers\Exchange\
C:\Program Files\Veeam\Backup and Replication\Explorers\SharePoint\
C:\Program Files\Veeam\Backup and Replication\Explorers\SQL\
C:\Program Files\Veeam\Backup and Replication\Explorers\ActiveDirectory\
C:\Program Files\Veeam\Backup and Replication\Explorers\Oracle\
C:\Program Files\Veeam\Backup and Replication\Explorers\Teams\
c:\Users\jocolon\.vscode\extensions\ms-vscode.powershell-2021.12.0\modules

PS C:\Users\jocolon> Copy-Item -Path .\AsBuiltReport.Veeam.VBR\ -Destination "C:\Users\jocolon\Documents\WindowsPowerShell\Modules\AsBuiltReport.Veeam.VBR" -PassThru -Recurse

PS C:\Users\jocolon>

The last step is to open a PowerShell window and unlock the downloaded files with the “Unblock-File” cmdlet.

PS C:\Users\jocolon> $path = (Get-Module -Name AsBuiltReport.Veeam.VBR -ListAvailable).ModuleBase; Unblock-File -Path $path\*.*

PS C:\Users\jocolon>


PS C:\Users\jocolon> Get-Module -Name AsBuiltReport.Veeam.VBR -ListAvailable


   Directory: C:\Users\jocolon\Documents\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     0.1.0      AsBuiltReport.Veeam.VBR             {Get-AbrVbrBackupServerCertificat....}


PS C:\Users\jocolon> Import-Module AsBuiltReport.Veeam.VBR -force 

An optional requirement is to build the configuration files that allow you to set the organization parameters needed to create the report. This process builds a JSON file used as template so that you do not have to fill in repetitive information when building the reports. To view the configuration procedure, simply click on the “+” icon.

Configuration Files (AsBuiltReport JSON)

The powershell cmdlet New-AsBuiltConfig allows you to build the template that we will use as the basis of the report. This template sets the non-technical parameters of the report.

PS C:\Users\jocolon>  New-AsBuiltConfig

---------------------------------------------
 <        As Built Report Information      >
---------------------------------------------
Enter the name of the Author for this As Built Report [jocolon]: Jonathan Colon
---------------------------------------------
 <           Company Information           >
---------------------------------------------
Would you like to enter Company information for the As Built Report? (y/n): y
Enter the Full Company Name: Zen PR Solutions
Enter the Company Short Name: ZENPR
Enter the Company Contact: Jonathan Colon
Enter the Company Email Address: jcolonf@zenprsolutions.com
Enter the Company Phone: XXX-XXX-XXXX
Enter the Company Address: Puerto Rico
---------------------------------------------
 <            Email Configuration          >
---------------------------------------------
Would you like to enter SMTP configuration? (y/n): n
----------------------------------------------
 <       As Built Report Configuration      >
----------------------------------------------
Would you like to save the As Built Report configuration file? (y/n): y
Enter a name for the As Built Report configuration file [AsBuiltReport]: AsBuiltReport
Enter the path to save the As Built Report configuration file [C:\Users\jocolon\AsBuiltReport]:

Name                           Value
----                           -----
Email                          {Port, Credentials, Server, To...}
Company                        {FullName, Contact, Phone, Email...}
UserFolder                     {Path}
Report                         {Author}


PS C:\Users\jocolon>

Once the process finishes, a JSON file with the following content will be created:

{
    "Email":  {
                  "Port":  null,
                  "Credentials":  null,
                  "Server":  null,
                  "To":  null,
                  "From":  null,
                  "UseSSL":  null,
                  "Body":  null
              },
    "Company":  {
                    "FullName":  "Zen PR Solutions",
                    "Contact":  "Jonathan Colon",
                    "Phone":  "787-203-XXXX",
                    "Email":  "jcolonf@zenprsolutions.com",
                    "ShortName":  "ZENPR",
                    "Address":  "Puerto Rico"
                },
    "UserFolder":  {
                       "Path":  "C:\Users\jocolon\AsBuiltReport"
                   },
    "Report":  {
                   "Author":  "Jonathan Colon"
               }
}

The New-AsBuiltReportConfig command allows you to set the technical parameters of the report, such as the type of data collected and the “verbose” level.

PS C:\Users\jocolon> New-AsBuiltReportConfig Veeam.VBR -FolderPath C:\Users\jocolon\AsBuiltReport\

Once the process is completed, a JSON file will be created with the following content:

{
    "Report": {
        "Name": "Veeam VBR As Built Report",
        "Version": "1.0",
        "Status": "Released",
        "ShowCoverPageImage": true,
        "ShowTableOfContents": true,
        "ShowHeaderFooter": true,
        "ShowTableCaptions": true
    },
    "Options": {

    },
    "InfoLevel": {
		"_comment_": "Please refer to the AsBuiltReport project contributing guide for information about how to define InfoLevels.",
        "_comment_": "0 = Disabled, 1 = Enabled, 2 = Adv Summary, 3 = Detailed",
        "Infrastructure": {
            "Section": 1,
            "BackupServer": 1,
            "Proxy": 1,
            "Settings": 1,
            "BR": 1,
            "Licenses": 1,
            "SOBR": 1,
            "WANAccel": 1,
            "SureBackup": 1

        },
        "Tape": {
            "Section": 1,
            "Server": 1,
            "Library": 1
        }
    },
    "HealthCheck": {
        "Infrastructure": {
            "Proxy": true,
            "Settings": true,
            "BR": true,
            "SOBR": true,
            "Server": true,
            "Status": true

        },
        "Tape": {
            "Status": true
        }

    }
}

The resulting configuration file can be used to specify the level of detail of the report, as well as the report sessions to be enabled.

Finally, the “New-AsBuiltReport” cmdlet is used to build the report. It is important to note that it is required to use the IP address or the FQDN of the Veeam Backup Server as “Target”.

# Store Credential in a Variable
PS C:\Users\jocolon> $Credential = Get-Credential
PowerShell credential request
Enter your credentials.
User: Veeam_Admin
Password for user Veeam_Admin: ***********

# Final Command 
PS C:\Users\jocolon> New-AsBuiltReport -Report Veeam.VBR -Target veeam-vbr.pharmax.local -AsBuiltConfigFilePath C:\Users\jocolon\AsBuiltReport\AsBuiltReport.json -OutputFolderPath C:\Users\jocolon\AsBuiltReport\ -Credential $Credential -Format HTML -ReportConfigFilePath C:\Users\jocolon\AsBuiltReport\AsBuiltReport.Veeam.VBR.json -EnableHealthCheck -Verbose

VERBOSE: Loading As Built Report configuration from 'C:\Users\jocolon\AsBuiltReport\AsBuiltReport.json'.
VERBOSE: Loading module from path 'C:\Users\jocolon\Documents\WindowsPowerShell\Modules\AsBuiltReport.Veeam.VBR\AsBuiltReport.Veeam.VBR.psm1'.
VERBOSE: Loading AsBuiltReport.Veeam.VBR report configuration file from path 'C:\Users\jocolon\AsBuiltReport\AsBuiltReport.Veeam.VBR.json'.
VERBOSE: Setting report filename to 'Veeam VBR As Built Report'.
VERBOSE: [ 15:04:09:872 ] [ Document ] - Document 'Veeam VBR As Built Report' processing started.
VERBOSE: [ 15:04:10:005 ] [ Document ] - Executing report style script from path 'C:\Users\jocolon\Documents\WindowsPowerShell\Modules\AsBuiltReport.Veeam.VBR\AsBuiltReport.Veeam.VBR.Style.ps1'.
VERBOSE: [ 15:04:10:036 ] [ Document ] - Setting global document options.
VERBOSE: [ 15:04:10:056 ] [ Document ] - Enabling section/heading numbering.
VERBOSE: [ 15:04:10:057 ] [ Document ] - Setting default font(s) to 'Arial'.
VERBOSE: [ 15:04:10:061 ] [ Document ] - Setting page top margin to '25.05'mm.
VERBOSE: [ 15:04:10:067 ] [ Document ] - Setting page right margin to '25.05'mm.
VERBOSE: [ 15:04:10:069 ] [ Document ] - Setting page bottom margin to '25.05'mm.
VERBOSE: [ 15:04:10:070 ] [ Document ] - Setting page left margin to '25.05'mm.
VERBOSE: [ 15:04:10:072 ] [ Document ] - Setting page size to 'A4'.
VERBOSE: [ 15:04:10:074 ] [ Document ] - Setting page orientation to 'Portrait'.
VERBOSE: [ 15:04:10:079 ] [ Document ] - Setting page height to '297'mm.
VERBOSE: [ 15:04:10:081 ] [ Document ] - Setting page width to '210'mm.
VERBOSE: [ 15:04:10:083 ] [ Document ] - Setting document style 'Title'.
VERBOSE: [ 15:04:10:085 ] [ Document ] - Setting document style 'Title2'.
VERBOSE: [ 15:04:10:105 ] [ Document ] - Setting document style 'Title3'.
VERBOSE: [ 15:04:10:110 ] [ Document ] - Setting document style 'Heading1'.
VERBOSE: [ 15:04:10:117 ] [ Document ] - Setting document style 'Heading2'.
VERBOSE: [ 15:04:10:121 ] [ Document ] - Setting document style 'Heading3'.
VERBOSE: [ 15:04:10:126 ] [ Document ] - Setting document style 'Heading4'.
VERBOSE: [ 15:04:10:129 ] [ Document ] - Setting document style 'Heading5'.
VERBOSE: [ 15:04:10:134 ] [ Document ] - Setting document style 'Heading6'.
VERBOSE: [ 15:04:10:136 ] [ Document ] - Setting document style 'Normal'.
VERBOSE: [ 15:04:10:159 ] [ Document ] - Setting document style 'Caption'.
VERBOSE: [ 15:04:10:162 ] [ Document ] - Setting document style 'Header'.
VERBOSE: [ 15:04:10:174 ] [ Document ] - Setting document style 'Footer'.
VERBOSE: [ 15:04:10:176 ] [ Document ] - Setting document style 'TOC'.
VERBOSE: [ 15:04:10:179 ] [ Document ] - Setting document style 'TableDefaultHeading'.
VERBOSE: [ 15:04:10:182 ] [ Document ] - Setting document style 'TableDefaultRow'.
VERBOSE: [ 15:04:10:185 ] [ Document ] - Setting document style 'Critical'.
VERBOSE: [ 15:04:10:192 ] [ Document ] - Setting document style 'Warning'.
VERBOSE: [ 15:04:10:216 ] [ Document ] - Setting document style 'Info'.
VERBOSE: [ 15:04:10:238 ] [ Document ] - Setting document style 'OK'.
VERBOSE: [ 15:04:10:264 ] [ Document ] - Setting table style 'TableDefault'.
VERBOSE: [ 15:04:10:281 ] [ Document ] - Setting table style 'Borderless'.
VERBOSE: [ 15:04:10:285 ] [ Document ] - Processing document header started.
VERBOSE: [ 15:04:10:288 ] [ Document ] - Processing paragraph 'Veeam VBR As Built Report - v1.0'.
VERBOSE: [ 15:04:10:295 ] [ Document ] - Processing document header completed.
VERBOSE: [ 15:04:10:298 ] [ Document ] - Processing document footer started.
VERBOSE: [ 15:04:10:302 ] [ Document ] - Processing paragraph 'Page <!# PageNumber #!>'.
VERBOSE: [ 15:04:10:318 ] [ Document ] - Processing document footer completed.
VERBOSE: [ 15:04:10:320 ] [ Document ] - Processing blank line.
VERBOSE: [ 15:04:10:343 ] [ Document ] - Processing image 'Veeam Logo'.
VERBOSE: [ 15:04:10:394 ] [ Document ] - Processing blank line.
VERBOSE: [ 15:04:10:396 ] [ Document ] - Processing paragraph 'Veeam VBR As Built Report'.
VERBOSE: [ 15:04:10:400 ] [ Document ] - Processing blank line.
VERBOSE: [ 15:04:10:419 ] [ Document ] - Processing paragraph 'Zen Pr Solutions'.
VERBOSE: [ 15:04:10:421 ] [ Document ] - Processing blank line.
VERBOSE: [ 15:04:10:423 ] [ Document ] - Processing table 'Cover Page'.
VERBOSE: [ 15:04:10:449 ] [ Document ] - Processing page break.
VERBOSE: [ 15:04:10:453 ] [ Document ] - Processing table of contents 'Table of Contents'.
VERBOSE: [ 15:04:10:465 ] [ Document ] - Processing page break.
VERBOSE: [ 15:04:10:742 ] [ Document ] - Trying to import Veeam B&R modules.
VERBOSE: [ 15:04:10:993 ] [ Document ] - Identifying Veeam Powershell module version.
VERBOSE: [ 15:04:10:995 ] [ Document ] - Using Veeam Powershell module version 11.
VERBOSE: [ 15:04:11:231 ] [ Document ] - Establishing the initial connection to the Backup Server: veeam-vbr.pharmax.local.
VERBOSE: [ 15:04:11:233 ] [ Document ] - Looking for veeam existing server connection.
VERBOSE: [ 15:04:11:335 ] [ Document ] - Existing veeam server connection found
VERBOSE: [ 15:04:11:337 ] [ Document ] - Validating connection to veeam-vbr.pharmax.local
VERBOSE: [ 15:04:11:460 ] [ Document ] - Successfully connected to veeam-vbr.pharmax.local VBR Server.
VERBOSE: [ 15:04:11:462 ] [ Document ] - Processing section 'Implementation Report' started.
VERBOSE: [ 15:04:11:464 ] [ Document ] - Processing paragraph 'The following section provides a sum[..]'.
VERBOSE: [ 15:04:11:471 ] [ Document ] - Processing blank line.
VERBOSE: [ 15:04:11:486 ] [ Document ] - Backup Infrastructure InfoLevel set at 2.
VERBOSE: [ 15:04:11:488 ] [ Document ] - Processing section 'Backup Infrastructure Summary' started.
VERBOSE: [ 15:04:11:508 ] [ Document ] - Discovering Veeam VBR Infrastructure Summary from veeam-vbr.pharmax.local.
Output Truncated!
VERBOSE: [ 15:06:02:777 ] [ Document ] - Discovered Pharmax - Veeam Tape Vault Type Vault.
VERBOSE: [ 15:06:02:979 ] [ Document ] - Processing table 'Tape Vault - VEEAM-VBR'.
VERBOSE: [ 15:06:02:986 ] [ Document ] - Processing section 'Tape Vault Summary' completed.
VERBOSE: [ 15:06:02:989 ] [ Document ] - Processing section 'Tape Infrastructure Summary' completed.
VERBOSE: [ 15:06:02:991 ] [ Document ] - Processing section 'Implementation Report' completed.
VERBOSE: [ 15:06:03:130 ] [ Document ] - Document 'Veeam VBR As Built Report' processing completed.
VERBOSE: [ 15:06:03:141 ] [ Document ] - Total processing time '1.89' minutes.
Veeam VBR As Built Report 'Veeam VBR As Built Report' has been saved to 'C:\Users\jocolon\AsBuiltReport\'.
PS C:\Users\jocolon> 

Here is an example of the resulting report.

I also include several options on how to build the report.

# Generate a Veeam VBR As Built Report for Backup Server '192.168.7.60' using specified credentials. Export report to HTML & DOCX formats. Use default report style. Append timestamp to report filename. Save reports to 'C:\Users\Jon\Documents'

PS C:\> New-AsBuiltReport -Report Veeam.VBR -Target 192.168.7.60 -Username 'Domain\veeam_admin' -Password 'P@ssw0rd' -Format Html,Word -OutputFolderPath 'C:\Users\Jon\Documents' -Timestamp

# Generate a Veeam VBR As Built Report for Backup Server 192.168.7.60 using specified credentials and report configuration file. Export report to Text, HTML & DOCX formats. Use default report style. Save reports to 'C:\Users\Jon\Documents'. Display verbose messages to the console.

PS C:\> New-AsBuiltReport -Report Veeam.VBR -Target 192.168.7.60 -Username 'Domain\veeam_admin' -Password 'P@ssw0rd' -Format Text,Html,Word -OutputFolderPath 'C:\Users\Jon\Documents' -ReportConfigFilePath 'C:\Users\Jon\AsBuiltReport\AsBuiltReport.Veeam.VBR.json' -Verbose

# Generate a Veeam VBR As Built Report for Backup Server 192.168.7.60 using stored credentials. Export report to HTML & Text formats. Use default report style. Highlight environment issues within the report. Save reports to 'C:\Users\Jon\Documents'.

PS C:\> $Creds = Get-Credential
PS C:\> New-AsBuiltReport -Report Veeam.VBR -Target 192.168.7.60 -Credential $Creds -Format Html,Text -OutputFolderPath 'C:\Users\Jon\Documents' -EnableHealthCheck

# Generate a Veeam VBR As Built Report for Backup Server 192.168.7.60 using stored credentials. Export report to HTML & DOCX formats. Use default report style. Reports are saved to the user profile folder by default. Attach and send reports via e-mail.

PS C:\> New-AsBuiltReport -Report Veeam.VBR -Target 192.168.7.60 -Username 'Domain\veeam_admin' -Password 'P@ssw0rd' -Format Html,Word -OutputFolderPath 'C:\Users\Jon\Documents' -SendEmail

Hasta Luego Amigos!

Veeam – Powershell get Backup Repository Information

Hello everyone,

These last days I have been performing several support services related to Veeam Backup & Replication where I have had the opportunity to use more Veeam Powershell modules. So in this opportunity I will be showing you in a basic way how to get information related to the repositories connected to the Backup server. As always it is necessary to establish a connection to the Backup server using the “Connect-VBRServer” command.

PS C:\Users\jocolon> Connect-VBRServer -Server veeam-vbr.pharmax.local -Credential (Get-Credential)

cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
User: pharmax\administrator
Password for user pharmax\administrator: ********

PS C:\Users\jocolon> 

After connecting to the server you can use the “Get-VBRBackupRepository” command to identify the repositories connected to the Backup server.

PS C:\Users\jocolon> Get-VBRBackupRepository                                           

Name                      Type         Host            FriendlyPath    Description
----                      ----         ----            ------------    -----------
VEEAM-DD                  DDBoost      VEEAM-VBR.ph... ddboost://VE... Created by PHARMAX\administrator
ONTAP Snapshot            SanSnapsh... VEEAM-VBR.ph... ONTAP Storage   Primary storage snapshot only
VEEAM-HPE-StoreOnce-VSA   HPStoreOn... VEEAM-VBR.ph... storeonce://... Created by PHARMAX\administrator
Linux - Hardened Repos... LinuxLocal   veeam-lnx-px... /backup_data... Created by PHARMAX\jocolon

PS C:\Users\jocolon>

As you can see the result of the cmdlet seems a bit incomplete as it does not show some important information such as the used space. In order to obtain this information I provide you with a basic example that allows you to obtain more relevant information.

$OutObj = @()
if ((Get-VBRServerSession).Server) {
    try {
        [Array]$BackupRepos = Get-VBRBackupRepository | Where-Object {$_.Type -ne "SanSnapshotOnly"}
        [Array]$ScaleOuts = Get-VBRBackupRepository -ScaleOut
        if ($ScaleOuts) {
            foreach ($ScaleOut in $ScaleOuts) {
                $Extents = Get-VBRRepositoryExtent -Repository $ScaleOut
                foreach ($Extent in $Extents) {
                    $BackupRepos = $BackupRepos + $Extent.repository
                }
            }
        }
        foreach ($BackupRepo in $BackupRepos) {
            $PercentFree = 0
            if (@($($BackupRepo.GetContainer().CachedTotalSpace.InGigabytes),$($BackupRepo.GetContainer().CachedFreeSpace.InGigabytes)) -ne 0) {
                $UsedSpace = ($($BackupRepo.GetContainer().CachedTotalSpace.InGigabytes-$($BackupRepo.GetContainer().CachedFreeSpace.InGigabytes)))
                if ($UsedSpace -ne 0) {
                    $PercentFree = ($UsedSpace/$($BackupRepo.GetContainer().CachedTotalSpace.InGigabytes)).tostring("P")
                }
            }
            $inObj = [ordered] @{
                'Name' = $BackupRepo.Name
                'Total Space' = "$($BackupRepo.GetContainer().CachedTotalSpace.InGigabytes)Gb"
                'Free Space' = "$($BackupRepo.GetContainer().CachedFreeSpace.InGigabytes)Gb"
                'Percent Used' = $PercentFree
                'Status' = Switch ($BackupRepo.IsUnavailable) {
                    'False' {'Available'}
                    'True' {'Unavailable'}
                    default {$BackupRepo.IsUnavailable}
                }
            }
            $OutObj += [pscustomobject]$inobj
        }
        $OutObj | Format-Table -Wrap -AutoSize
    }
    catch {
        Write-Output $_.Exception.Message
    }
}

In the following example I show you the output of the resulting code to get the information about the repositories connected to the Veeam Backup server.

Name                                  Total Space Free Space Percent Used Status     
----                                  ----------- ---------- ------------ ------
VEEAM-DD                              351Gb       292Gb      16.81%       Available
VEEAM-HPE-StoreOnce-VSA               0Gb         0Gb        0            Unavailable
Linux - Hardened Repository           199Gb       198Gb      0.50%        Available
E - Backup Repository                 499Gb       461Gb      7.62%        Available
F - Backup Repository                 99Gb        99Gb       0            Available
E - Backup Repository - VEEAM-VBR-02V 99Gb        5Gb        94.95%       Available
F - Backup Repository - VEEAM-VBR-02V 99Gb        98Gb       1.01%        Available

I hope you enjoyed this post and find it useful in your professional journey.

Hasta Luego Amigos!

Veeam – Powershell get Backup Proxies Information

Hello friends,

In this opportunity I will be showing you how to obtain Backup Proxy related information from powershell in a Veeam Backup & Replication infrastructure. To begin with it is necessary to establish the initial connection to the Backup Server using the “Connect-VBRServer” command. In my case the FQDN of my Backup Server is “veeam-vbr.pharmax.local”.

PS C:\Users\jocolon> Connect-VBRServer -Server veeam-vbr.pharmax.local -Credential (Get-Credential)

cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
User: pharmax\administrator
Password for user pharmax\administrator: ********
PS C:\Users\jocolon> 

After connecting to the server you can use the “Get-VBRViProxy” cmdlet to identify which Backup Proxy servers are in your infrastructure.

PS C:\Users\jocolon> Get-VBRViProxy | Format-Table -Wrap -AutoSize


Name                        Type Host                        IsDisabled Description
----                        ---- ----                        ---------- -----------
veeam-lnx-px.pharmax.local  Vi   veeam-lnx-px.pharmax.local  False      Created by PHARMAX\jocolon...
VMware Backup Proxy         Vi   VEEAM-VBR.pharmax.local     False      Created by Veeam Backu...
VEEAM-VBR-02V.pharmax.local Vi   VEEAM-VBR-02V.pharmax.local False      Created by PHARMAX\jocolon ...


PS C:\Users\jocolon>

As you can see this command shows basic information about the Backup Proxy but if you want to see the complete content you can exchange the “Format-Table” command for “Format-list”.

PS C:\Users\jocolon> Get-VBRViProxy | Format-List                 

Id                : ae2cd836-9e0a-440c-9b51-089e71c16ac6
Name              : veeam-lnx-px.pharmax.local
Description       : Created by PHARMAX\jocolon at 12/28/2021 1:24 PM.
Info              : Veeam.Backup.Model.CBackupProxyInfo
HostId            : cd06c723-875d-4da3-a633-ccac571ee296 
Host              : Veeam.Backup.Core.Common.CHost       
Type              : Vi
IsDisabled        : False
Options           : Veeam.Backup.Model.CDomViProxyOptions
MaxTasksCount     : 2
UseSsl            : False
FailoverToNetwork : True
TransportMode     : Auto
ChosenVm          : 
ChassisType       : ViVirtual

Id                : 18b661c1-d9dc-4233-90a0-7e7b10dc2d09
Name              : VMware Backup Proxy
Description       : Created by Veeam Backup & Replication
Info              : Veeam.Backup.Model.CBackupProxyInfo
HostId            : 6745a759-2205-4cd2-b172-8ec8f7e60ef8
Host              : Veeam.Backup.Core.Common.CHost
Type              : Vi
IsDisabled        : False
Options           : Veeam.Backup.Model.CDomViProxyOptions
MaxTasksCount     : 2
UseSsl            : False
FailoverToNetwork : True
TransportMode     : Auto
ChosenVm          :
ChassisType       : ViVirtual

Id                : 07c6322d-8e42-4929-8015-87c002ec0838
Name              : VEEAM-VBR-02V.pharmax.local
Description       : Created by PHARMAX\jocolon at 12/22/2021 8:46 PM.
Info              : Veeam.Backup.Model.CBackupProxyInfo
HostId            : 8452413e-92ee-4461-951d-516c7cf27cec
Host              : Veeam.Backup.Core.Common.CHost
Type              : Vi
IsDisabled        : False
Options           : Veeam.Backup.Model.CDomViProxyOptions
MaxTasksCount     : 2
UseSsl            : False
FailoverToNetwork : True
TransportMode     : Auto
ChosenVm          :
ChassisType       : ViVirtual


PS C:\Users\jocolon> 

Finally, I leave you a short piece of code to better visualize the content of the Veeam Backup Proxy:

$BackupProxies = Get-VBRViProxy
$Outobj = @()
foreach ($BackupProxy in $BackupProxies) {
    $inObj = [ordered] @{
        'Name' = $BackupProxy.Name
        'Host Name' = $BackupProxy.Host.Name
        'Disabled' = $BackupProxy.IsDisabled
        'Max Tasks Count' = $BackupProxy.MaxTasksCount
        'Use Ssl' = $BackupProxy.UseSsl
        'Failover To Network' = $BackupProxy.FailoverToNetwork
        'Transport Mode' = $BackupProxy.TransportMode
        'Chassis Type' = $BackupProxy.ChassisType
        'OS Type' = $BackupProxy.Host.Type
        'Services Credential' = $BackupProxy.Host.ProxyServicesCreds.Name
        'Status' = Switch (($BackupProxy.Host).IsUnavailable) {
            'False' {'Available'}
            'True' {'Unavailable'}
            default {($BackupProxy.Host).IsUnavailable}
        }
    }
    $OutObj += [pscustomobject]$inobj
}
$OutObj | Format-Table -Wrap -AutoSize

Here is the output of the resulting code.

Hasta Luego Amigos!

Veeam – Powershell Module Introduction

Hello to everyone,

This time I will be showing an introduction of the Veeam Powershell module and how to make the initial connection to the backup server. In Veeam Backup & Replication version 11 a new powershell module called “Veeam.Backup.PowerShell” was introduced. According to the Veeam documentation portal there are two ways to use this powershell module:

  1. Accessing Powershell from the Veeam Backup & Replication console.
  1. Importing the module from a traditional Powershell console.
PS C:\Users\jocolon> Import-Module -Name Veeam.Backup.PowerShell

WARNING: The names of some imported commands from the module 'Veeam.Backup.PowerShell' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
PS C:\Users\jocolon> 

It is important to mention that the Powershell module is available on the Veeam Backup server or on any device where the management console is installed. Reference:

The remote machine from which you run Veeam PowerShell commands must have the Veeam Backup & Replication Console installed. After you install the Veeam Backup & Replication Console, Veeam PowerShell module will be installed by default

Veeam PowerShell Reference

To validate if the module was loaded successfully you can use the “Get-Module” command. As you can see in the example version 1.0 of “Veeam.Backup.PowerShell” was loaded on the system.

PS C:\Users\jocolon> Get-Module -ListAvailable -Name Veeam.Backup.PowerShell



    Directory: C:\Program Files\Veeam\Backup and Replication\Console


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Manifest   1.0        Veeam.Backup.PowerShell             {Get-VBRComputerFileProxyServer, New-VBRSanI


PS C:\Users\jocolon>

Speaking a bit of history, the traditional way to load the Powershell module in pre-V11 versions was to use the following command:

 Add-PSSnapin -Name VeeamPSSnapIn #Veeam Powershell Pre11

Now in Veeam VBR version 11 the traditional “Import-Module” command is used like any other Powershell module. In the case of Veeam 11 we use the command referring to the module called “Veeam.Backup.PowerShell”. Once the module is loaded you can verify which cmdlets are available with the “Get-Command” cmdlet.

PS C:\Users\jocolon> Get-Command -Module Veeam.Backup.PowerShell


CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Alias           Add-VBRCloudTenantToTapeJob                        1.0        Veeam.Backup.PowerShell
Alias           Add-VBRHPSnapshot                                  1.0        Veeam.Backup.PowerShell
Alias           Add-VBRHPStorage                                   1.0        Veeam.Backup.PowerShell
Alias           Clone-VBRJob                                       1.0        Veeam.Backup.PowerShell
Alias           Get-VBRHPCluster                                   1.0        Veeam.Backup.PowerShell
Alias           Get-VBRHPSnapshot                                  1.0        Veeam.Backup.PowerShell
Alias           Get-VBRHPStorage                                   1.0        Veeam.Backup.PowerShell
Alias           Get-VBRHPVolume                                    1.0        Veeam.Backup.PowerShell
Alias           Remove-VBRHPSnapshot                               1.0        Veeam.Backup.PowerShell
Alias           Remove-VBRHPStorage                                1.0        Veeam.Backup.PowerShell
Alias           Set-VBRCloudTenantToTapeJob                        1.0        Veeam.Backup.PowerShell
Truncated.......
PS C:\Users\jocolon>

Now that everything is ready you can establish the initial connection to your Backup server. To accomplish this process use the command “Connect-VBRServer”. In the following example we use the option to request credentials but Veeam modules accept traditional methods to provide credentials in Powershell (Referencias).

PS C:\Users\jocolon> Connect-VBRServer -Server veeam-vbr.pharmax.local -Credential (Get-Credential)

cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
User: pharmax\veeam_admin
Password for user pharmax\veeam_admin: ********
PS C:\Users\jocolon> 

In this example I connect to the server with the name “veeam-vbr.pharmax.local” with the username “pharmax\veeam_admin”. It is important to mention that only users with the “Veeam Backup Administrator” role can establish connection via powershell. If you try to connect with an account that does not have this privilege level, you will get the following error:

PS C:\Users\jocolon> Connect-VBRServer -Server veeam-vbr.pharmax.local -Credential (Get-Credential)

cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
User: pharmax\vrauser
Password for user pharmax\vrauser: ********
Connect-VBRServer : Only users with Veeam Backup Administrator role assigned can use Veeam Backup PowerShell Snap-in
At line:1 char:1
+ Connect-VBRServer -Server veeam-vbr.pharmax.local -Credential (Get-Cr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Connect-VBRServer], Exception
    + FullyQualifiedErrorId : AccessCheckerErrorId,Veeam.Backup.PowerShell.Cmdlets.ConnectVBRServer

PS C:\Users\jocolon> 

To validate existing sessions use the command “Get-VBRServerSession”. The following example shows the connection to the “veeam-vbr” server using the “veeam_admin” user.

PS C:\Users\jocolon> Get-VBRServerSession                 


User        Server                  Port
----        ------                  ----
veeam_admin veeam-vbr.pharmax.local 9392


PS C:\Users\jocolon>

Once connected to the Veeam server you can run any cmdlet to extract the required information. As an example I will show you the backup tasks that are created on my Veeam test server.

PS C:\Users\jocolon> Get-VBRJob

WARNING: This cmdlet is no longer supported for computer backup jobs. Use "Get-VBRComputerBackupJob" instead.

Job Name                  Type            State      Last Result  Description
--------                  ----            -----      -----------  -----------
Server With Netapp LUN... Windows Agen... Stopped    None         Created by PHARMAX\administrator
HyperV-Backup-Job         Hyper-V Backup  Stopped    None         Created by PHARMAX\administrator 
WIN HyperV VM Backup      Hyper-V Backup  Stopped    Success      Created by PHARMAX\jocolon
PHARMAX-HQ-SVR            VMware Backup   Stopped    None         Created by PHARMAX\administrator
SOBR - TEST               VMware Backup   Stopped    None         Created by PHARMAX\administrator
COMP-CLUSTER-NFS          VMware Backup   Stopped    None         Created by PHARMAX\administrator 
HPE-StoreOnce-Copy-Job    VMware Backu... Stopped    Success      Created by PHARMAX\administrator
VM - Test - AWS           VMware Backup   Stopped    Failed       Created by PHARMAX\jocolon

PS C:\Users\jocolon> 

I hope this information is helpful. If you have any doubts or questions about this post, leave them in the comments. Hasta Luego Amigos!

HomeLab: How to obtain a Veeam Not for Resale (NFR) license for your HomeLab protection

In this opportunity I come to show you how to get free Veeam licenses that you can use to protect your “HomeLab” or can be used to practice if you are planning to get certified as a “Veeam Certified Engineer” (VMCE). I am currently protecting my virtual environment with these licenses that can be obtained if you meet one of these requirements:

Who is eligible?

  • Veeam Certified Engineers (VMCE)
  • VMware: vExperts, VMware Certified Professionals (VCPs & VCAPs)
  • Microsoft: Most Valuable Professionals (MVPs), Microsoft Certified Solutions Experts (MCSEs)
  • AWS: AWS Heroes & Certified Professionals
  • Nutanix AHV: ALL Nutanix technical personnel
  • VMware, Microsoft, AWS trainers, bloggers and other certified professionals

To request this free license just access the link “Veeam FREE NFR Key for Veeam Availability Suite” and fill out the form which is shown in the following image:

After filling out the form, you will receive an email with the attached NFR licenses that you can install on your Veeam B&R Server.

Although there is a “Veeam Community” version that is also freely available, this license does not have all the features of the NFR edition. I have included the link of the Veeam portal where you can compare the features available for each type of edition. Here is the link “Veeam Feature comparison”.

I hope you liked this post. If you have any questions or comments about it, leave them in comments. Regards.

Hasta Luego Amigos!

Installing Minio on Centos Linux 8

The Problem

In the last few months I have been studying for the “VEEAM VMCE Arquitect” certification and one of the requirements is to implement the “Scale Out Backup Repository” option. A simple way to achieve this is by using the Minio service.

About Minio

Minio is an open source object storage service compatible with the Amazon S3 cloud storage service. Applications that have been configured to communicate with Amazon S3 can also be configured to communicate with Minio, allowing Minio to be a viable alternative to S3.

Installation

[Adding the minio user]

[root@VEEAM-MINIO ~]# useradd -r minio-user -s /sbin/nologin

[Creating the configuration file]

[root@VEEAM-MINIO ~]# cat <<EOT >> /etc/default/minio

# Volume to be used for MinIO server.

MINIO_VOLUMES="/usr/local/share/minio/"

# Use if you want to run MinIO on a custom port.

MINIO_OPTS="-C /etc/minio --address <your_server_ip>:9000"

# User for the server.

MINIO_ACCESS_KEY="<change me>"

# Password for the server

MINIO_SECRET_KEY="<change me>"

# Root user for the server. 

MINIO_ROOT_USER="<change me>"

# Root secret for the server. 

MINIO_ROOT_PASSWORD="<change me>"

EOT

[Downloading the application]

[root@VEEAM-MINIO ~]# wget https://dl.min.io/server/minio/release/linux-amd64/minio

[root@VEEAM-MINIO ~]# chmod +x minio #assigning privileges to run

[root@VEEAM-MINIO ~]# mv minio /usr/local/bin #moving executable to directory

[root@VEEAM-MINIO ~]# chown minio-user:minio-user /usr/local/bin/minio #changing user permissions

[Creating directories and assigning permissions]

[root@VEEAM-MINIO ~]# mkdir /usr/local/share/minio

[root@VEEAM-MINIO ~]# chmod 755 /usr/local/share/minio

[root@VEEAM-MINIO ~]# chown minio-user:minio-user /usr/local/share/minio

[root@VEEAM-MINIO ~]# mkdir /etc/minio

[root@VEEAM-MINIO ~]# chown minio-user:minio-user /etc/minio

[Downloading and activating Minio service]

[root@VEEAM-MINIO ~]# wget https://raw.githubusercontent.com/minio/minio-service/master/linux-systemd/minio.service -O /etc/systemd/system/minio.service

[root@VEEAM-MINIO ~]# systemctl daemon-reload

[root@VEEAM-MINIO ~]# systemctl enable minio

[Initializing and verifying the service]

[root@VEEAM-MINIO ~]# systemctl start minio

[root@VEEAM-MINIO ~]# systemctl status minio

[Allowing traffic through the local firewall]

[root@VEEAM-MINIO ~]# firewall-cmd --zone=public --add-port=9000/tcp --permanent

[root@VEEAM-MINIO ~]# firewall-cmd --reload