Upgrade to v9

PowerShell script exchange

Upgrade to v9

Veeam Logoby help » Mon Feb 08, 2016 2:09 pm

After upgrade to Veeam v9 powershell command Start-VBRZip wont work processing "VM" error: value cannot be null parameter.

Code: Select all
Add-VBRBackupRepository -Name "ExDisk" -Folder \\10.22.13.124\Srv_backup -Type CifsShare -UserName user -Password Pass
$repository = Get-VBRBackupRepository -Name "ExDisk"
Find-VBRHvEntity -Name ZPS* | Start-VBRZip -BackupRepository $repository -Compression 5 -RunAsyn -AutoDelete In3days
help
Novice
 
Posts: 6
Liked: never
Joined: Fri Feb 05, 2016 11:28 am
Full Name: VP

Re: Upgrade to v9

Veeam Logoby help » Mon Feb 08, 2016 2:20 pm

Updated:
After upgrade to v9 powershell command Start-VBRZip wont work processing "VM" error: value cannot be null parameter name: source
help
Novice
 
Posts: 6
Liked: never
Joined: Fri Feb 05, 2016 11:28 am
Full Name: VP

Re: Upgrade to v9

Veeam Logoby v.Eremin » Mon Feb 08, 2016 3:16 pm

If you run this command alone, will there be anything returned?

Code: Select all
Find-VBRHvEntity -Name ZPS*


Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Upgrade to v9

Veeam Logoby help » Tue Feb 09, 2016 11:08 am

Yes, this:

Code: Select all
ConnHost        : Veeam.Backup.Core.CHvDbHost
Type            : Vm
Reference       : 2186c06f-48ca-4389-a6ce-78720a422137
Id              : 210a69ca-716e-4204-879c-bc9c71c1181f_2186c06f-48ca-4389-a6ce-78720a422137
Name            : ZPS-DC01
Path            : 10.22.13.110\ZPS-DC01
VmHostName      : 10.22.13.110
PowerState      : PoweredOn
ProvisionedSize : 0
UsedSize        : 0
GuestInfo       : Veeam.Backup.Model.CGuestInfo
ConnHostId      : 210a69ca-716e-4204-879c-bc9c71c1181f
Platform        : EHyperV

ConnHost        : Veeam.Backup.Core.CHvDbHost
Type            : Vm
Reference       : d9ced0da-6318-4dbe-b86d-88d2556cd539
Id              : 210a69ca-716e-4204-879c-bc9c71c1181f_d9ced0da-6318-4dbe-b86d-88d2556cd539
Name            : ZPS-EX01
Path            : 10.22.13.110\ZPS-EX01
VmHostName      : 10.22.13.110
PowerState      : PoweredOn
ProvisionedSize : 0
UsedSize        : 0
GuestInfo       : Veeam.Backup.Model.CGuestInfo
ConnHostId      : 210a69ca-716e-4204-879c-bc9c71c1181f
Platform        : EHyperV
help
Novice
 
Posts: 6
Liked: never
Joined: Fri Feb 05, 2016 11:28 am
Full Name: VP

Re: Upgrade to v9

Veeam Logoby v.Eremin » Tue Feb 09, 2016 11:33 am

Hmm, which parameter is claimed to be a null one? Entity, Repository or different one? What happens if you split the script into several lines, like the following:

Code: Select all
Add-VBRBackupRepository -Name "ExDisk" -Folder \\10.22.13.124\Srv_backup -Type CifsShare -UserName user -Password Pass
$repository = Get-VBRBackupRepository -Name "ExDisk"
$Entities = Find-VBRHvEntity -Name ZPS*
Start-VBRZip -entity $Entities -BackupRepository $repository -Compression 5 -RunAsyn -AutoDelete In3days

By the way, aren't you using default Powershell 2.0 (Windows 2008 (R2)) by any chance?

Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Upgrade to v9

Veeam Logoby help » Tue Feb 09, 2016 12:31 pm

No it is Windows Server 2012, PowerShell 3.0:

Code: Select all
PS C:\Users\administrator.ZPS> Start-VBRZip -entity $Entities -BackupRepository $repository -Compression 5 -RunAsyn -AutoDelete In3days
Start-VBRZip : Veeam Backup Free Edition does not allow VeeamZIP of multiple VMs. Specify a single VM, or install a paid product license.
At line:1 char:1
+ Start-VBRZip -entity $Entities -BackupRepository $repository -Compression 5 -Run ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Start-VBRZip], Exception
    + FullyQualifiedErrorId : System.Exception,Veeam.Backup.PowerShell.Commands.Backup.StartVBRZip


So I tried this:

Code: Select all
PS C:\Users\administrator.ZPS> $Entities = Find-VBRHvEntity -Name ZPS-DC01
PS C:\Users\administrator.ZPS> $Entities


ConnHost        : Veeam.Backup.Core.CHvDbHost
Type            : Vm
Reference       : 2186c06f-48ca-4389-a6ce-78720a422137
Id              : 210a69ca-716e-4204-879c-bc9c71c1181f_2186c06f-48ca-4389-a6ce-78720a422137
Name            : ZPS-DC01
Path            : 10.22.13.110\ZPS-DC01
VmHostName      : 10.22.13.110
PowerState      : PoweredOn
ProvisionedSize : 0
UsedSize        : 0
GuestInfo       : Veeam.Backup.Model.CGuestInfo
ConnHostId      : 210a69ca-716e-4204-879c-bc9c71c1181f
Platform        : EHyperV


And run backup:
Code: Select all
PS C:\Users\administrator.ZPS> Start-VBRZip -entity $Entities -BackupRepository $repository -Compression 5 -RunAsyn -AutoDelete In3days


BottleneckManager            : CJobBottleneckManager
Info                         : Veeam.Backup.Model.CBackupSessionInfo
Progress                     : Veeam.Backup.Model.CBackupProgressData
StartupMode                  : Normal
JobSourceType                : HyperV
CurrentPointId               : 00000000-0000-0000-0000-000000000000
OriginalSessionId            : 5a9f2105-019e-4e9a-becf-1ee3b5209256
IsFullMode                   : True
IsRetryMode                  : False
IsRecheckRetry               : False
IsQuickBackup                : False
IsVeeamZip                   : True
IsPlannedFailover            : False
IsReplicaFromBackup          : False
IsAdHocBackup                : False
PostActivity                 : AskService
Name                         : ZPS-DC01_2016-02-09T132326 (Active Full)
OrigJobName                  : ZPS-DC01_2016-02-09T132326
BackupStats                  : Veeam.Backup.Model.CBackupStats
WorkDetails                  : Veeam.Backup.Core.CBackupSessionWorkDetails
WillBeRetried                : False
IsManuallyStopped            : False
IsTransformLaunched          : False
SessionCryptoSpec            : Veeam.Backup.Crypto.CCryptoSymmetricSpec
UserCryptoSpec               :
SelectiveProcessingSpec      :
BackupVerificationResult     :
IsEncryptionEnabledByOptions : False
IsEncryptionEnabled          : False
SplitStoragesPerVm           :
DataBag                      : {}
SessionInfo                  : Veeam.Backup.Model.CBackupSessionInfo
Id                           : 5a9f2105-019e-4e9a-becf-1ee3b5209256
LeaseId                      : 00000000-0000-0000-0000-000000000000
JobType                      : Backup
JobName                      : ZPS-DC01_2016-02-09T132326
JobSpec                      : <FreeBackupSpec><JobId>a3d18dc1-e632-4e80-8965-cf0c749e5191</JobId><JobName>ZPS-DC01_2016-02-09T132326</JobName><VmName>ZPS-DC01</VmName><Platform>EHyperV</Platform><Ba
                               ckupObjects><ObjectId>049f91d3-578a-4610-84e6-f3e6b0695107</ObjectId></BackupObjects><UseRepository>True</UseRepository><RepositoryId>e334a51f-0f15-4ae5-a82e-92a06689bb
                               02</RepositoryId><FolderName /><CredsId>00000000-0000-0000-0000-000000000000</CredsId><CompressionLevel>5</CompressionLevel><VmToolsQuiesce>True</VmToolsQuiesce><Retain
                               Datetime>12. 2. 2016 0:00:00</RetainDatetime><PwdKeyId>00000000-0000-0000-0000-000000000000</PwdKeyId><ModifiedBy>ZPS\Administrator</ModifiedBy></FreeBackupSpec>
JobTypeString                : Backup
CreationTimeUTC              : 9. 2. 2016 13:23:26
Operation                    :
Description                  :
BaseProgress                 : 0
IsCompleted                  : False
IsWorking                    : False
IsStarting                   : True
IsPostprocessing             : False
JobId                        : a3d18dc1-e632-4e80-8965-cf0c749e5191
Result                       : None
State                        : Starting
EndTime                      : 1. 1. 1900 0:00:00
EndTimeUTC                   : 1. 1. 1900 0:00:00
CreationTime                 : 9. 2. 2016 13:23:26
AuxData                      : <AuxData><SessionStarterInfo Version="1" UserName="Administrator" UserDomainName="ZPS" RunManually="True" /></AuxData>
IsLowerAgentPriority         : True
LogName                      : Job.ZPS-DC01_2016-02-09T132326
LogsSubFolder                : ZPS-DC01_2016-02-09T132326
Logger                       : Veeam.Backup.Core.XmlLogger
Tracer                       : Veeam.Backup.Core.CSessionLogTracer


But same error occurs (lines from job log):
Code: Select all
[09.02.2016 13:23:42] <01> Info     All VMs have been queued for processing
[09.02.2016 13:23:44] <09> Info             [AP] (1fcd) command: 'Invoke: Generic.EnableAgentReconnectPolicy\n{\n  (EBoolean) IsRemoteAgent = true\n}\n'
[09.02.2016 13:23:44] <17> Info                   [AP] (1fcd) output: <VCPCommandResult result="true" exception="" />
[09.02.2016 13:23:44] <06> Info                   [AP] (1fcd) output: <VCPCommandArgs />
[09.02.2016 13:23:44] <06> Info                   [AP] (1fcd) output: >
[09.02.2016 13:23:45] <07> Error    Processing ZPS-DC01
[09.02.2016 13:23:45] <07> Error    Hodnota nemůže být NULL.
[09.02.2016 13:23:45] <07> Error    Název parametru: source (System.ArgumentNullException)
[09.02.2016 13:23:45] <07> Error       v System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
[09.02.2016 13:23:45] <07> Error       v Veeam.Backup.Core.CLocalStorageCommander.FindRepositoryForStorage(Guid storageId)
[09.02.2016 13:23:45] <07> Error       v Veeam.Backup.Core.CLocalStorageCommander.PrepareStorageForWrite(IStorage storage, IBackupClient client)
[09.02.2016 13:23:45] <07> Error       v Veeam.Backup.Core.CLocalStorageCommander.Create(CStorageInfo storageInfo, IStorageName storageName, IBackupClientHolder clientHolder)
[09.02.2016 13:23:45] <07> Error       v Veeam.Backup.Core.CStorageEx.CreateStorageFile(CStorageInfo storageInfo, IStorageName storageName, CBackup backup, IBackupClientHolder agentHolder, IStorageAccessor storageAccessor, IEncryptedBackupSession cryptoBackupSession)
[09.02.2016 13:23:45] <07> Error       v Veeam.Backup.Core.CFreeBackupStorageAlg.InitStorages(IBackupClientHolder agentHolder)
[09.02.2016 13:23:45] <07> Error       v Veeam.Backup.Core.CFreeBackupJobTarget.CreateTaskTarget(ITask task, CBackupTaskSession taskSession)
[09.02.2016 13:23:45] <07> Error       v Veeam.Backup.Core.CFreeHvBackupJobPerformer.ExecuteTask(CHvVmTask task)
[09.02.2016 13:23:45] <07> Error       v Veeam.Backup.Core.CFreeHvBackupJobPerformer.ExecuteTaskAsync(CHvVmTask task)
[09.02.2016 13:23:45] <07> Info     [CHvSnapshotHolder] Task completed. Closing shared snapshot for task 'bd59a906-33a8-4dad-aa9f-185ec8387ef9'
[09.02.2016 13:23:48] <01> Info     Completing storages in full mode
[09.02.2016 13:23:48] <01> Info     Retrieving space info for repository : Id [e334a51f-0f15-4ae5-a82e-92a06689bb02]
[09.02.2016 13:23:48] <01> Info     Physical host volume was not found for path '\\10.22.13.124\Srv_backup' on host 'ZPS-HYPERV01.zps.local'.
help
Novice
 
Posts: 6
Liked: never
Joined: Fri Feb 05, 2016 11:28 am
Full Name: VP

Re: Upgrade to v9

Veeam Logoby v.Eremin » Tue Feb 09, 2016 12:48 pm

The first error is PowerShell specific, meaning you have to decrease number of VMs you're about to VeeamZIP to one. Otherwise, cmdlet won't work.

The second error is not specific to PowerShell, as the processing has started successfully. Most likely, you'd get the very same issue, if you execute a backup against that VM via GUI. So, you'd better open a ticket with our support team and let them investigate it directly.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Upgrade to v9

Veeam Logoby help » Tue Feb 09, 2016 2:27 pm

If I use this syntax, backup work

Code: Select all
Find-VBRHvEntity -Name ZPS* | Start-VBRZip -Folder "\\10.22.13.124\Srv_backup" -Compression 5 -RunAsyn -AutoDelete In3days


Strange is that wih v8 backup to repository works. I opened case on this before, but Veeam support cannot help me with this error and ask me to open thread here.
help
Novice
 
Posts: 6
Liked: never
Joined: Fri Feb 05, 2016 11:28 am
Full Name: VP

Re: Upgrade to v9

Veeam Logoby abelal » Wed Feb 10, 2016 10:02 am

I'm also having the exact same issue on a clean v9 install with this script. using -Folder ins start-vbrzip works but backuprepository no longer is accepted :(

Please fix this veeam!!!!

Code: Select all
# Originak author: Vladimir Eremin
# Created Date: 3/24/2015
# http://forums.veeam.com/member31097.html
#

# Modified author: Abu Belal
# email: abu@belalmd.com

##################################################################
#                   User Defined Variables
##################################################################

$ExcludeFromBackups = 'p1-veeam'

Get-PSSnapin -Registered  -Name VMW* | Add-PSSnapin


# Name of vCenter or standalone host VMs to backup reside on (Mandatory)
$HostName = "vcenter.abs.lab"

Connect-VIServer $HostName

$VMNames = Get-VM -name p2-* | Where-Object { $_.Name -notin $ExcludeFromBackups } | Select-Object Name

Disconnect-VIServer $HostName -Confirm:$false

# Directory that VM backups should go to (Mandatory; for instance, C:\Backup)
# CREATE THIS AS A REPOSITORY IN VEEAM BACKUP FIRST (MAY NEED TO SWITCH VIEW TO FULL FUNCTIONALITY IF USING FREE VERSION)
$Directory = '\\10.2.1.1\dsksd_veeam_cifs'

# Desired compression level (Optional; Possible values: 0 - None, 4 - Dedupe-friendly, 5 - Optimal, 6 - High, 9 - Extreme)
$CompressionLevel = "0"

# Quiesce VM when taking snapshot (Optional; VMware Tools are required; Possible values: $True/$False)
$EnableQuiescence = $True

# Protect resulting backup with encryption key (Optional; $True/$False)
$EnableEncryption = $False

# Encryption Key (Optional; path to a secure string)
$EncryptionKey = ""

# Retention settings (Optional; By default, VeeamZIP files are not removed and kept in the specified location for an indefinite period of time.
# Possible values: Never , Tonight, TomorrowNight, In3days, In1Week, In2Weeks, In1Month)
$Retention = "In1Week"

##################################################################
#                   Notification Settings
##################################################################

# Enable notification (Optional)
$EnableNotification = $True

# Email SMTP server
$SMTPServer = "smtpserver.abs.lab"

# Email FROM
$EmailFrom = ('p1veeam@' + $env:COMPUTERNAME + '.local')

# Email TO
$EmailTo = "abu.belal@abs.lab"

# Email subject
$EmailSubject = "veeam backup"

##################################################################
#                   Email formatting
##################################################################

$style = "<style>BODY{font-family: Arial; font-size: 10pt;}"
$style = $style + "TABLE{border: 1px solid black; border-collapse: collapse;}"
$style = $style + "TH{border: 1px solid black; background: #dddddd; padding: 5px; }"
$style = $style + "TD{border: 1px solid black; padding: 5px; }"
$style = $style + "</style>"

##################################################################
#                   End User Defined Variables
##################################################################

#################### DO NOT MODIFY PAST THIS LINE ################
Asnp VeeamPSSnapin

$repo = Get-VBRBackupRepository -Name $Directory

$Server = Get-VBRServer -name $HostName
$MesssagyBody = @()

foreach ($VMName in $VMNames)
{
    try
    {
      $VM = Find-VBRViEntity -Name $VMName.Name -Server $Server
     }
    catch
    {
        Write-Host error
        break
    }

  If ($EnableEncryption)
  {
    $EncryptionKey = Add-VBREncryptionKey -Password (cat $EncryptionKey | ConvertTo-SecureString)
   $ZIPSession = Start-VBRZip -Entity $VM -BackupRepository $repo -Compression $CompressionLevel -DisableQuiesce:(!$EnableQuiescence) -AutoDelete $Retention -EncryptionKey $EncryptionKey
  }
 
  Else
  { 
   $ZIPSession = Start-VBRZip -Entity $VM -BackupRepository $repo -Compression $CompressionLevel -DisableQuiesce:(!$EnableQuiescence) -AutoDelete $Retention
  }
 
  If ($EnableNotification)
  {
    $TaskSessions = $ZIPSession.GetTaskSessions().logger.getlog().updatedrecords
    $FailedSessions =  $TaskSessions | where {$_.status -eq "EWarning" -or $_.Status -eq "EFailed"}
 
  if ($FailedSessions -ne $Null)
  {
    $MesssagyBody = $MesssagyBody + ($ZIPSession | Select-Object @{n="Name";e={($_.name).Substring(0, $_.name.LastIndexOf("("))}} ,@{n="Start Time";e={$_.CreationTime}},@{n="End Time";e={$_.EndTime}},Result,@{n="Details";e={$FailedSessions.Title}})
  }
   
  Else
  {
    $MesssagyBody = $MesssagyBody + ($ZIPSession | Select-Object @{n="Name";e={($_.name).Substring(0, $_.name.LastIndexOf("("))}} ,@{n="Start Time";e={$_.CreationTime}},@{n="End Time";e={$_.EndTime}},Result,@{n="Details";e={($TaskSessions | sort creationtime -Descending | select -first 1).Title}})
  }
 
  }   
}
If ($EnableNotification)
{
$Message = New-Object System.Net.Mail.MailMessage $EmailFrom, $EmailTo
$Message.Subject = $EmailSubject
$Message.IsBodyHTML = $True
$message.Body = $MesssagyBody | ConvertTo-Html -head $style | Out-String
$SMTP = New-Object Net.Mail.SmtpClient($SMTPServer)
$SMTP.Send($Message)
}
abelal
Lurker
 
Posts: 1
Liked: never
Joined: Wed Feb 10, 2016 9:53 am
Full Name: Abu Belal

Re: Upgrade to v9

Veeam Logoby v.Eremin » Wed Feb 10, 2016 1:50 pm

VeeamZIP to repository is not allowed in VB&R Free Edition. Neither GUI nor PS allows that. So, you have to use -Folder parameter in Start-VBRZIP, instead. Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Upgrade to v9

Veeam Logoby help » Wed Feb 10, 2016 3:52 pm

But in v8 it was possible to backup to repository, why not in v9?
help
Novice
 
Posts: 6
Liked: never
Joined: Fri Feb 05, 2016 11:28 am
Full Name: VP

Re: Upgrade to v9

Veeam Logoby v.Eremin » Thu Feb 11, 2016 11:18 am

I'd say it was an overlook from our side, as PowerShell snap-in is typically tested a bit less extensively as general product is. Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Upgrade to v9

Veeam Logoby max31294 » Thu Feb 11, 2016 9:37 pm

I think the article on backups with PowerShell is a little misleading:
https://www.veeam.com/blog/veeam-backup ... shell.html

For example, above it has been said: "VeeamZIP to repository is not allowed in VB&R Free Edition. Neither GUI nor PS allows that."

Yet, in the article it says: "Free Edition allows you to store the backup file on a backup repository, on a local folder or on a network share."

I do appreciate the responses though.
max31294
Lurker
 
Posts: 1
Liked: never
Joined: Thu Feb 11, 2016 9:27 pm
Full Name: Max T

Re: Upgrade to v9

Veeam Logoby Vitaliy S. » Fri Feb 12, 2016 1:02 pm

Yes, Max thanks for the feedback. I will pass this feedback about the blog to our web team.
Vitaliy S.
Veeam Software
 
Posts: 19575
Liked: 1104 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov


Return to PowerShell



Who is online

Users browsing this forum: Google [Bot] and 4 guests