I am writing a script to list all the vm's that are being backuped in our environment. vCenter combined with vCloud.
But for some reason some vm's are having different values which makes it difficult to filter in them.
I have 3 issues:
First: Jobs are having duplicates objects. The only difference seems to be the Type and PolicyType:
Id : 7f8b3c22-0d3a-4a4d-a54f-d132847036a4
ObjectId : d66e5b49-720d-4d47-9e02-ce937c8334f1
Object : Name: ICCPROXY02 (69de819d-460f-4401-8e75-5532f8cf53fb)
Filter :
Role : EPolicy
Name : ICCPROXY02 (69de819d-460f-4401-8e75-5532f8cf53fb)
Type : GuestCredsChild
Location : BEANONDVC01.ad.ondit.net\ant.ondit.net\BEADONDVCLUS01\IRIS_ICC ovDC (a6c0c97d-3b7a-4da6-ab58-306c7991faa6)\ICCPROXY02 (69de819d-460f-4401-8e75-5532f8cf53fb)
OrderNo : 0
ApproxSizeString : 0,0 B
Info : Veeam.Backup.Model.CDbObjectInJobInfo
JobId : d12a769e-1931-49ca-963b-e4bddca8b2a2
IsFolder : False
IsIncluded : False
IsVssChild : False
IsExcludeDisksChild : False
IsExcluded : False
IsExtended : False
PolicyType : GuestCreds
Problem with this is that I can't filter on this because then I filter other VM's not part of an oVDC because they might also have this type.Id : 0b53197b-adcc-4272-96fd-7a7c994ed8bb
ObjectId : d66e5b49-720d-4d47-9e02-ce937c8334f1
Object : Name: ICCPROXY02 (69de819d-460f-4401-8e75-5532f8cf53fb)
Filter :
Role : EPolicy
Name : ICCPROXY02 (69de819d-460f-4401-8e75-5532f8cf53fb)
Type : ExtendedChild
Location : BEANONDVC01.ad.ondit.net\ant.ondit.net\BEADONDVCLUS01\IRIS_ICC ovDC (a6c0c97d-3b7a-4da6-ab58-306c7991faa6)\ICCPROXY02 (69de819d-460f-4401-8e75-5532f8cf53fb)
OrderNo : 0
ApproxSizeString : 0,0 B
Info : Veeam.Backup.Model.CDbObjectInJobInfo
JobId : d12a769e-1931-49ca-963b-e4bddca8b2a2
IsFolder : False
IsIncluded : False
IsVssChild : False
IsExcludeDisksChild : False
IsExcluded : False
IsExtended : True
PolicyType : Extended
Second problem: An oVDC with 7 VM's in 2 vapps (1 excluded) doesn't have any objects I can use. The only objects in that job is the oVDC itself and the excluded machine.
In veeam B&R you can see all the 6 machines being backed-up just fine.
Type: VM
Policy: None
Name: TTS
Type: Template
Policy: None
BEADSPADB02 (b6070796-f4bb-4fe8-ac23-05731d537460)
Third: I saw that some machines have the type "NfcDir". What is this type ?
This is the code I am using
Code: Select all
$objects = $Jobs.GetObjectsInJob()
$type = $objects.GetObject().Type
foreach ($object in $objects) {
$type = $object.GetObject().Type
Write-Output ""
Write-Output "Type:",$type
Write-Output "Policy:",$object.PolicyType
if ($type -eq "VM") {
Write-Output "Name",$object.Name
} else {
Write-Output "No HIT:", $object.Name
}
}