Get unprotected VMs hyperv

PowerShell script exchange

Get unprotected VMs hyperv

Veeam Logoby kuchi » Mon Aug 04, 2014 3:07 pm

Hi!
We have SCVMM and one HyperV-Cluster which is in our Veeam Environment.
Is there any possibility to verify which VMs from both hyperv Environments are not in any backupjob?
kuchi
Novice
 
Posts: 5
Liked: never
Joined: Wed Sep 26, 2012 6:00 am
Full Name: Alexander Kuchelbacher

Re: Get unprotected VMs hyperv

Veeam Logoby Vitaliy S. » Mon Aug 04, 2014 3:23 pm

Hi Alex,

I'm pretty sure our PowerShell experts will help you with this task, but if you have Veeam ONE (part of Veeam Backup Management Suite), you can generate this report in 1-click. Please see this link for more information on predefined "Protected VMs" report template > http://helpcenter.veeam.com/one/70/repo ... d_vms.html

Thanks!
Vitaliy S.
Veeam Software
 
Posts: 19960
Liked: 1145 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov

Re: Get unprotected VMs hyperv

Veeam Logoby kuchi » Tue Aug 05, 2014 6:57 am

thanks, since veeam one is not licensed here I Need to do over powershell. many thanks
kuchi
Novice
 
Posts: 5
Liked: never
Joined: Wed Sep 26, 2012 6:00 am
Full Name: Alexander Kuchelbacher

Re: Get unprotected VMs hyperv

Veeam Logoby v.Eremin » Tue Aug 05, 2014 8:16 am

Can you tell me how VMs are added to a backup job? As individual objects or through container? Thanks.
v.Eremin
Veeam Software
 
Posts: 13709
Liked: 1025 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get unprotected VMs hyperv

Veeam Logoby kuchi » Tue Aug 05, 2014 10:46 am

we have scvmm 2012r2 included and one hyperv 2008 r2 Cluster.
we have several Jobs which have included different virtual machines.
kuchi
Novice
 
Posts: 5
Liked: never
Joined: Wed Sep 26, 2012 6:00 am
Full Name: Alexander Kuchelbacher

Re: Get unprotected VMs hyperv

Veeam Logoby v.Eremin » Tue Aug 05, 2014 10:49 am

In the settings of backup jobs what is selected as a source - individual VMs or cluster (host) as whole? Thanks.
v.Eremin
Veeam Software
 
Posts: 13709
Liked: 1025 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get unprotected VMs hyperv

Veeam Logoby kuchi » Tue Aug 05, 2014 11:16 am

Individual VMs
kuchi
Novice
 
Posts: 5
Liked: never
Joined: Wed Sep 26, 2012 6:00 am
Full Name: Alexander Kuchelbacher

Re: Get unprotected VMs hyperv

Veeam Logoby v.Eremin » Tue Aug 05, 2014 11:35 am

Then, you should get a list of VMs included in backup jobs, using Get-VBRJobObject commandlet. Then, get a list of all VMs residing on a cluster/host, using Get-VM commandlet. After that, compare two lists and output the difference - names of VMs that are present in the second list, but are not in the first one. These will be your unprotected VMs.

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

Re: Get unprotected VMs hyperv

Veeam Logoby kuchi » Tue Aug 05, 2014 11:52 am

I know that, but I am struggling with to get the names of the vm from vbrjobs
kuchi
Novice
 
Posts: 5
Liked: never
Joined: Wed Sep 26, 2012 6:00 am
Full Name: Alexander Kuchelbacher

Re: Get unprotected VMs hyperv

Veeam Logoby v.Eremin » Tue Aug 05, 2014 12:04 pm

The names of Virtual Machines present in backup jobs can be collected in the following way:

Code: Select all
Get-VBRJob | where {$_.Jobtype -eq "Backup"} |  Get-VBRJobObject | select {$_.name}


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

Re: Get unprotected VMs hyperv

Veeam Logoby pizzim13 » Tue Aug 12, 2014 5:50 pm

One quick suggestion, I would do this using the vm's GUID/MoRef and not by name. Names can be duplicated and it will cause you nothing but headaches.
pizzim13
Enthusiast
 
Posts: 87
Liked: 6 times
Joined: Thu Apr 21, 2011 7:37 pm

Re: Get unprotected VMs hyperv

Veeam Logoby v.Eremin » Wed Aug 13, 2014 8:27 am

Names would still be required though, as hardly would you be able to make a sense over IDs. Report containing only long digit numbers wouldn't be very helpful. Thanks.
v.Eremin
Veeam Software
 
Posts: 13709
Liked: 1025 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get unprotected VMs hyperv

Veeam Logoby Ctek » Mon Feb 06, 2017 2:20 pm

Hi,

I am bumping this thread since I am looking to script somewhat the same thing because VeeamOne Reports does not give us the amount of information we need. So far I have a hard time matching a unique VM ID in Hyper-V with a VM ID in veeam backup job. I can't seem to find something to compare backed up VMs precisely with an ID. We are in an environment where duplicate names are involved.

Do you have any tips to share on this matter? Thanks in advance.
VMCE 9 Certified - Systems Administrator
Ctek
Service Provider
 
Posts: 42
Liked: 4 times
Joined: Wed Nov 11, 2015 3:50 pm
Location: Canada

Re: Get unprotected VMs hyperv

Veeam Logoby Shestakov » Mon Feb 06, 2017 3:01 pm

Hi,
I`m curious which Veeam ONE reports you use?
So far I have a hard time matching a unique VM ID in Hyper-V with a VM ID in veeam backup job. I can't seem to find something to compare backed up VMs precisely with an ID. We are in an environment where duplicate names are involved.

I would just use Protected VMs report or new Backup Infrastructure Custom Data with object type = VM, Columns = Name, Computer Name, IP Address, Last backup Date, Last Backup Status.
Thanks!
Shestakov
Veeam Software
 
Posts: 5140
Liked: 430 times
Joined: Wed May 21, 2014 11:03 am
Location: Saint Petersburg
Full Name: Nikita Shestakov

Re: Get unprotected VMs hyperv

Veeam Logoby Ctek » Mon Feb 06, 2017 3:51 pm

Hi Nikita,

Our problem with VeeamOne Protected VMs report is that it's highly inconsistent and unreliable. I get a lot of unprotected VM's (sometimes ALL vms shows unprotected) in the generated report but in reality, they are backed up properly once I verify them one by one. In my homelab with vsphere, I don't have this issue, but at work, a service provider, we have a big Hyper-V environment with SCVMM and backup reports are always hit and miss, with a lot more misses. We create our own scripts to cover these kind of shortcomings.

Should I open a case?
VMCE 9 Certified - Systems Administrator
Ctek
Service Provider
 
Posts: 42
Liked: 4 times
Joined: Wed Nov 11, 2015 3:50 pm
Location: Canada

Next

Return to PowerShell



Who is online

Users browsing this forum: No registered users and 1 guest