PowerShell script exchange
Post Reply
aaron@ARB
Expert
Posts: 138
Liked: 14 times
Joined: Feb 21, 2014 3:12 am
Full Name: ARBCorporationPtyLtd
Contact:

get-VBRBackup returning more than 2 backup?

Post by aaron@ARB »

Veeam,

Support case ID is [ID# 00996892]

I have just noticed that get-VBRBackup seems to return more than one backup even though I am passing it a name to return. If I run get-VBRBackup by itself it appears to return what it should but if i use it as part of a command to remove a backup, it seems to return a backup that is not even being referred to...

See what I mean below

Code: Select all

PS C:\install> Get-VBRBackup -Name ARBackup | Remove-VBRBackup -FromDisk -Confirm:$false -WhatIf:$true


Info                  : Veeam.Backup.Model.CBackupInfo
Id                    : 5114f49b-7874-48bf-a864-8396a4f803e0
JobName               : ARBBackup
Name                  : ARBBackup
Path                  : ARBBackup
CreationTime          : 14/08/2015 10:37:05 PM
LastPointCreationTime : 14/08/2015 10:37:07 PM
VmCount               : 2
JobTargetHostId       : 6745a759-2205-4cd2-b172-8ec8f7e60ef8
JobTargetHostProtocol : Auto
JobType               : Backup
JobSourceType         : VDDK
BackupPlatform        : EVmware
JobTargetType         : Other
TypeToString          : VMware Backup
JobId                 : eab77c28-f0fa-4648-90cb-a1a4e901ba20
RepositoryId          : 49b2b617-fcb5-440d-a354-cfcf19b62500
ParentBackupId        : 
DirPath               : D:\Veeam8\ARBBackup
MetaFileName          : ARBBackup.vbm
MetaUpdateTime        : 14/08/2015 10:37:41 PM
MetaVersion           : 3
IsMetaExist           : True
IsSnapReplica         : False
IsViReplica           : False
IsHvReplica           : False
IsLegacyReplica       : False
IsReplica             : False
IsBackup              : True
IsBackupSync          : False
IsSqlBackup           : False
IsEndPointBackup      : False
IsTapeBackup          : False
DbAccessorId          : 00000000-0000-0000-0000-000000000000
DbMethods             : Veeam.Backup.Core.CLocalDbMethodsInterceptor
LastUsedCryptoSpec    : 

Info                  : Veeam.Backup.Model.CBackupInfo
Id                    : 0c81804d-21ae-4167-acb9-df016e71cb6d
JobName               : JDEBackup
Name                  : JDEBackup
Path                  : JDEBackup
CreationTime          : 9/08/2015 9:01:54 AM
LastPointCreationTime : 13/08/2015 7:36:10 PM
VmCount               : 15
JobTargetHostId       : 6745a759-2205-4cd2-b172-8ec8f7e60ef8
JobTargetHostProtocol : Auto
JobType               : Backup
JobSourceType         : VDDK
BackupPlatform        : EVmware
JobTargetType         : Other
TypeToString          : VMware Backup
JobId                 : ed1fb3e6-5e15-4ce7-9627-4ede8b2fbf5a
RepositoryId          : 88788f9e-d8f5-4eb4-bc4f-9b3f5403bcec
ParentBackupId        : 
DirPath               : F:\Backup\JDEBackup
MetaFileName          : JDEBackup.vbm
MetaUpdateTime        : 13/08/2015 8:22:16 PM
MetaVersion           : 160
IsMetaExist           : True
IsSnapReplica         : False
IsViReplica           : False
IsHvReplica           : False
IsLegacyReplica       : False
IsReplica             : False
IsBackup              : True
IsBackupSync          : False
IsSqlBackup           : False
IsEndPointBackup      : False
IsTapeBackup          : False
DbAccessorId          : 00000000-0000-0000-0000-000000000000
DbMethods             : Veeam.Backup.Core.CLocalDbMethodsInterceptor
LastUsedCryptoSpec    :
can someone please explain why it returns JDEBAckup also? is this an issue in that i dont see it removing the wrong backup from disk (there is only ever ONE of each as in one group of ARBBackups and one group of JDEBackups)
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: get-VBRBackup returning more than 2 backup?

Post by veremin »

Strange thing. You might want to check whether -Name parameter works as expected. In order to do that try to replace it with different filter:

Code: Select all

Get-VBRBackup | where {$_.Name -eq "ARBackup"}
If this also returns two entities, it would mean that something is wrong with db. For instance, it has wrong or obsolete references, etc.

Otherwise, it would point out a problem with commandlet itself.

Thanks.
aaron@ARB
Expert
Posts: 138
Liked: 14 times
Joined: Feb 21, 2014 3:12 am
Full Name: ARBCorporationPtyLtd
Contact:

Re: get-VBRBackup returning more than 2 backup?

Post by aaron@ARB »

Okay I ran your test and it returned as i would expect

Code: Select all

PS C:\Users\administrator.ENSAT> Get-VBRBackup | where {$_.Name -eq "ARBBackup"}


Info                  : Veeam.Backup.Model.CBackupInfo
Id                    : 5114f49b-7874-48bf-a864-8396a4f803e0
JobName               : ARBBackup
Name                  : ARBBackup
Path                  : ARBBackup
CreationTime          : 14/08/2015 10:37:05 PM
LastPointCreationTime : 17/08/2015 10:31:51 PM
VmCount               : 22
JobTargetHostId       : 6745a759-2205-4cd2-b172-8ec8f7e60ef8
JobTargetHostProtocol : Auto
JobType               : Backup
JobSourceType         : VDDK
BackupPlatform        : EVmware
JobTargetType         : Other
TypeToString          : VMware Backup
JobId                 : eab77c28-f0fa-4648-90cb-a1a4e901ba20
RepositoryId          : 49b2b617-fcb5-440d-a354-cfcf19b62500
ParentBackupId        : 
DirPath               : D:\Veeam8\ARBBackup
MetaFileName          : ARBBackup.vbm
MetaUpdateTime        : 17/08/2015 10:54:28 PM
MetaVersion           : 92
IsMetaExist           : True
IsSnapReplica         : False
IsViReplica           : False
IsHvReplica           : False
IsLegacyReplica       : False
IsReplica             : False
IsBackup              : True
IsBackupSync          : False
IsSqlBackup           : False
IsEndPointBackup      : False
IsTapeBackup          : False
DbAccessorId          : 00000000-0000-0000-0000-000000000000
DbMethods             : Veeam.Backup.Core.CLocalDbMethodsInterceptor
LastUsedCryptoSpec    : 
I also created a new backup just so that there were 3 backup sets now sitting there and the below was returned

Code: Select all

PS C:\Users\administrator.ENSAT> Get-VBRBackup -Name ARBBackup | Remove-VBRBackup -FromDisk -Confirm:$true -WhatIf:$true
What if: Performing operation "Remove-VBRBackup" on Target "ARBBackup".


Info                  : Veeam.Backup.Model.CBackupInfo
Id                    : 5114f49b-7874-48bf-a864-8396a4f803e0
JobName               : ARBBackup
Name                  : ARBBackup
Path                  : ARBBackup
CreationTime          : 14/08/2015 10:37:05 PM
LastPointCreationTime : 17/08/2015 10:31:51 PM
VmCount               : 22
JobTargetHostId       : 6745a759-2205-4cd2-b172-8ec8f7e60ef8
JobTargetHostProtocol : Auto
JobType               : Backup
JobSourceType         : VDDK
BackupPlatform        : EVmware
JobTargetType         : Other
TypeToString          : VMware Backup
JobId                 : eab77c28-f0fa-4648-90cb-a1a4e901ba20
RepositoryId          : 49b2b617-fcb5-440d-a354-cfcf19b62500
ParentBackupId        : 
DirPath               : D:\Veeam8\ARBBackup
MetaFileName          : ARBBackup.vbm
MetaUpdateTime        : 17/08/2015 10:54:28 PM
MetaVersion           : 92
IsMetaExist           : True
IsSnapReplica         : False
IsViReplica           : False
IsHvReplica           : False
IsLegacyReplica       : False
IsReplica             : False
IsBackup              : True
IsBackupSync          : False
IsSqlBackup           : False
IsEndPointBackup      : False
IsTapeBackup          : False
DbAccessorId          : 00000000-0000-0000-0000-000000000000
DbMethods             : Veeam.Backup.Core.CLocalDbMethodsInterceptor
LastUsedCryptoSpec    : 

Info                  : Veeam.Backup.Model.CBackupInfo
Id                    : 07294b76-1c5d-4d2f-b202-f1a466be64ee
JobName               : ARBTest
Name                  : ARBTest
Path                  : ARBTest
CreationTime          : 15/08/2015 4:23:24 PM
LastPointCreationTime : 15/08/2015 4:23:26 PM
VmCount               : 1
JobTargetHostId       : 6745a759-2205-4cd2-b172-8ec8f7e60ef8
JobTargetHostProtocol : Auto
JobType               : Backup
JobSourceType         : VDDK
BackupPlatform        : EVmware
JobTargetType         : Other
TypeToString          : VMware Backup
JobId                 : 4c5a94ff-77f8-453e-80b3-e231718bbdfe
RepositoryId          : 49b2b617-fcb5-440d-a354-cfcf19b62500
ParentBackupId        : 
DirPath               : D:\Veeam8\ARBTest
MetaFileName          : ARBTest.vbm
MetaUpdateTime        : 15/08/2015 4:25:50 PM
MetaVersion           : 4
IsMetaExist           : True
IsSnapReplica         : False
IsViReplica           : False
IsHvReplica           : False
IsLegacyReplica       : False
IsReplica             : False
IsBackup              : True
IsBackupSync          : False
IsSqlBackup           : False
IsEndPointBackup      : False
IsTapeBackup          : False
DbAccessorId          : 00000000-0000-0000-0000-000000000000
DbMethods             : Veeam.Backup.Core.CLocalDbMethodsInterceptor
LastUsedCryptoSpec    : 

Info                  : Veeam.Backup.Model.CBackupInfo
Id                    : 468d4f97-7400-4160-8f4a-fc2aaff724d7
JobName               : JDEBackup
Name                  : JDEBackup
Path                  : JDEBackup
CreationTime          : 16/08/2015 9:02:12 AM
LastPointCreationTime : 17/08/2015 7:36:32 PM
VmCount               : 15
JobTargetHostId       : 6745a759-2205-4cd2-b172-8ec8f7e60ef8
JobTargetHostProtocol : Auto
JobType               : Backup
JobSourceType         : VDDK
BackupPlatform        : EVmware
JobTargetType         : Other
TypeToString          : VMware Backup
JobId                 : ed1fb3e6-5e15-4ce7-9627-4ede8b2fbf5a
RepositoryId          : 88788f9e-d8f5-4eb4-bc4f-9b3f5403bcec
ParentBackupId        : 
DirPath               : F:\Backup\JDEBackup
MetaFileName          : JDEBackup.vbm
MetaUpdateTime        : 17/08/2015 8:21:36 PM
MetaVersion           : 64
IsMetaExist           : True
IsSnapReplica         : False
IsViReplica           : False
IsHvReplica           : False
IsLegacyReplica       : False
IsReplica             : False
IsBackup              : True
IsBackupSync          : False
IsSqlBackup           : False
IsEndPointBackup      : False
IsTapeBackup          : False
DbAccessorId          : 00000000-0000-0000-0000-000000000000
DbMethods             : Veeam.Backup.Core.CLocalDbMethodsInterceptor
LastUsedCryptoSpec    : 
Just as a test, what would be the way that I pass your command to remove-vbrbackup? as in pipe your where into the get-vbrbackup and then have THAT result piped to remove-vbrbackup ? strategically placed brackets?

I suspect its just a display thing, but i want to check
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: get-VBRBackup returning more than 2 backup?

Post by veremin »

The following should work:

Code: Select all

Get-VBRBackup | where {$_.Name -eq "ARBBackup"} | Remove-VBRBackup
Or assign a backup to a variable first and then pass it to the commandlet:

Code: Select all

$Backup = Get-VBRBackup | where {$_.Name -eq "ARBBackup"}
Remove-VBRBackup -Backup $Backup -FromDisk
Thanks.
aaron@ARB
Expert
Posts: 138
Liked: 14 times
Joined: Feb 21, 2014 3:12 am
Full Name: ARBCorporationPtyLtd
Contact:

Re: get-VBRBackup returning more than 2 backup?

Post by aaron@ARB »

okay I will follow the variable route I think
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: get-VBRBackup returning more than 2 backup?

Post by veremin »

Kindly, let me know how well the process goes. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests