Monitoring and reporting for Veeam Backup & Replication, VMware vSphere and Microsoft Hyper-V
Vitaliy S.
Product Manager
Posts: 23062
Liked: 1582 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

ONEbelievable tricks: Veeam ONE and Automation Services

Post by Vitaliy S. » Nov 14, 2014 5:46 pm 17 people like this post

Guys,

As promised during our VeeamON session, here is the description of every trick that was demoed (including the PowerShell script examples for every scenario). Please note that you have to be using Veeam Availability Suite v8 to make it work.

And kudos to Vladimir for creating these PowerShell scripts! Without his deep knowledge of PowerShell and scripting this would not be possible.

VM with no backup

1. Create VM backup alarm in Veeam ONE via Alarms Management tab
2. Define the required RPO and assign the alarm
3. In the post alarm actions specify a batch file to trigger a backup PowerShell script
4. When alarm is triggered the corresponding PowerShell script will create a quick backup of the VM

If you don't have VMs added to the backup jobs, then you can write a PowerShell script that will create a job for the VM and then run it.

Terminate job after X hours

1. Create backup alarm and select jobs you want to monitor
2. Define jobs maximum duration
3. In the post alarm actions specify a batch file to trigger a backup PowerShell script
4. The PowerShell script can be configured to do one of the following actions:
• Stop the required backup job
• Run a script to check for orphaned VM snapshots and then try to consolidate them

Delete orphaned VM snapshots

1. Use one of the predefined VM snapshot alarms (snapshot size or snapshot age)
2. In the post alarm actions specify a batch file to trigger a backup PowerCLI script which will try to consolidate all VM snapshots

You can even specify the name of the snapshots you want to consolidate in the PowerCLI script.

Automated VM failover

1. Detect failed VMs/hosts/datastores via one of the predefined alarms in Veeam ONE (for example, VM power state, VM Tools state etc.)
2. In the post alarm actions specify a batch file to trigger a backup PowerShell script
3. To make sure it is not a network glitch run additional verifications within the PowerCLI/PowerShell script
4. Once all verifications are performed create a failover plan in Veeam backup console and then run it
4a. As an alternative you can create a PowerShell script to initiate VM failover operation without using failover plans.
4b. Additionally, you can start VM replicas manually via PowerCLI script

VM tags in Veeam ONE and Veeam B&R

1. Navigate to Veeam ONE Business View and create the required categories/groups for automatic categorization rules
2. Create categorization rule or dynamic group via Business View. See online help center web page for more info > Configuring Categorization Rules
3. Configure Veeam ONE to write VM Tags to the vCenter Server > Configuring Options
4. Verify Veeam ONE Reporter collection job schedule (this job is responsible for writing VM tags) > Scheduling Data Collection
5. Open Veeam backup console and start using VM tags as a source for your backup and replication jobs!

Receive alarms via text message

1. Navigate to any alarm you want to configure this action for
2. Set "send email notifications" as post alarm action
3. Specify your cell phone number in the format described below. 10-digit number should be your cell phone number.

Code: Select all

Alltel[10-digit phone number]@message.alltel.com
Example: 1234567890@message.alltel.com

AT&T (formerly Cingular)[10-digit phone number]@txt.att.net
[10-digit phone number]@mms.att.net (MMS)
[10-digit phone number]@cingularme.com
Example: 1234567890@txt.att.net

Boost Mobile[10-digit phone number]@myboostmobile.com
Example: 1234567890@myboostmobile.com

Nextel (now Sprint Nextel)[10-digit telephone number]@messaging.nextel.com
Example: 1234567890@messaging.nextel.com

Sprint PCS (now Sprint Nextel)[10-digit phone number]@messaging.sprintpcs.com
[10-digit phone number]@pm.sprint.com (MMS)
Example: 1234567890@messaging.sprintpcs.com

T-Mobile[10-digit phone number]@tmomail.net
Example: 1234567890@tmomail.net

US Cellular[10-digit phone number]email.uscc.net (SMS)
[10-digit phone number]@mms.uscc.net (MMS)
Example: 1234567890@email.uscc.net

Verizon[10-digit phone number]@vtext.com
[10-digit phone number]@vzwpix.com (MMS)
Example: 1234567890@vtext.com

Virgin Mobile USA[10-digit phone number]@vmobl.com
Example: 1234567890@vmobl.com
Audible alarms

1. Set a batch script as an action item for the alarm
2. Use “psexec” to execute another *.bat file to play an audio file on any server

Disclaimer: Use these these script examples in your test environment first, and make sure you adapt them to your needs before using them in the production environment.

Thank you!

cpfleger
Veeam Vanguard
Posts: 287
Liked: 24 times
Joined: Aug 31, 2012 7:30 am
Full Name: Claus Pfleger
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by cpfleger » Nov 14, 2014 11:58 pm

Nice!

Regards!

joergr
Expert
Posts: 386
Liked: 39 times
Joined: Jun 08, 2010 2:01 pm
Full Name: Joerg Riether
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by joergr » Nov 18, 2014 2:22 pm

Very nice examples - excellent code - very nice work, Vitaliy!!!!

Joerg

Vitaliy S.
Product Manager
Posts: 23062
Liked: 1582 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by Vitaliy S. » Nov 18, 2014 2:28 pm

...and Vladimir :)

joergr
Expert
Posts: 386
Liked: 39 times
Joined: Jun 08, 2010 2:01 pm
Full Name: Joerg Riether
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by joergr » Nov 18, 2014 2:42 pm 1 person likes this post

VERY nice work Vitaliy and Vladimir!!!! ;-)

alewas
Enthusiast
Posts: 67
Liked: 8 times
Joined: Oct 17, 2013 12:44 pm
Full Name: Alejandro Wasserlauf
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by alewas » Nov 18, 2014 11:32 pm

You guys rock!

Vitaliy S.
Product Manager
Posts: 23062
Liked: 1582 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by Vitaliy S. » Dec 05, 2014 2:08 pm

Another trick that you guys might find helpful is the ability to create your own alerts based on the Windows Event log of the backup server. For example, if you want to be notified when the restore task happens (for auditing purposes), you can use Event 210 from the Windows Event log as a trigger for this alarm.

Create your OWN alarms for Veeam B&R

1. Navigate to Alarm Management tab
2. Select Veeam B&R node as the alarm type
3. Click to create new alarm and select "event" as an alarm trigger
4. Choose any alarm from the list below triggered by Veeam B&R v8

Code: Select all

Event ID	Event Name

23010	Job created
23050	Job modified
23090	Job deleted
23110	Job objects added
32120	Job objects deleted
23130	Job objects modified
23210	SureBackup job created
23220	SureBackup job modified
23230	SureBackup job deleted
23310	SureBackup objects added
23320	SureBackup objects deleted
23330	SureBackup objects modified
110	Backup job started
190	Backup job finished
150	Backup task finished
114	Tape backup job started
194	Tape backup job finished
210	Restore session started
250	Restore vSphere task finished
251	Restore Hyper-V task finished
290	Restore session finished
310	SureBackup job started
350	SureBackup vSphere verification task finished
351	SureBackup vSphere  validation task finished
360	SureBackup Hyper-V verification task finished
361	SureBackup Hyper-V validation task finished
390	SureBackup job finished
410	Backup copy job started
450	Backup copy task finished
490	Backup copy job finished
510	File copy job started
590	File copy job finished
512	VM copy job started
592	VM copy job finished
10010	Restore point created
10050	Restore point removed
10090	Restore point updated
10014	Tape restore point created
20114	Tape updated
21210	Proxy server established connection
21214	Proxy server lost connection
21220	Repository server established connection
21224	Repository server lost connection
21230	WAN accelerator established connection
21234	WAN accelerator lost connection
24010	License installed
24020	License expiring
24022	License evaluation expiring
24030	License expired
24040	License support expiring
24050	License support expired
23410	Second destination job has been assigned
23420	Second destination job has been removed
610	Quick migration job has been finished

jgreenback
Enthusiast
Posts: 31
Liked: 11 times
Joined: Sep 19, 2013 9:26 pm
Full Name: Jason Greenback
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by jgreenback » Mar 19, 2015 4:46 pm

What info can be gathered using the "echo %#" to a txt file?

Examples? does %2 = VM name?

Vitaliy S.
Product Manager
Posts: 23062
Liked: 1582 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by Vitaliy S. » Mar 19, 2015 5:45 pm

Yes, please see our online help center page for more info on the parameters > http://helpcenter.veeam.com/one/80/vsph ... rs%2Balarm

jgreenback
Enthusiast
Posts: 31
Liked: 11 times
Joined: Sep 19, 2013 9:26 pm
Full Name: Jason Greenback
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by jgreenback » Mar 20, 2015 9:24 pm

This is exactly what I needed. Thanks!

Kirststoner12
Veeam Software
Posts: 9
Liked: 3 times
Joined: Aug 18, 2014 5:44 pm
Full Name: Kirsten Stoner
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by Kirststoner12 » Apr 09, 2015 5:42 pm

Cool!

bennytalent
Lurker
Posts: 2
Liked: never
Joined: Sep 17, 2013 11:34 am
Full Name: Benjamin Hornung
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by bennytalent » May 21, 2015 9:41 am

hi guys,

the script examples in first post are not avaiable anymore.
can you re-upload them?

thx alot!

benny

Vitaliy S.
Product Manager
Posts: 23062
Liked: 1582 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by Vitaliy S. » May 21, 2015 10:17 am

Hi Benny,

Sorry for that, was cleaning up my dropbox public folder and for some reason I have decided to delete this archive ;)

P.s. did you come here after the whiteboard episode about these scripts?

Thanks!

bennytalent
Lurker
Posts: 2
Liked: never
Joined: Sep 17, 2013 11:34 am
Full Name: Benjamin Hornung
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by bennytalent » May 21, 2015 10:50 am

no i've read about it in the vtec Newsletter - where can i find the Whiteboard Episode :)

Vitaliy S.
Product Manager
Posts: 23062
Liked: 1582 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by Vitaliy S. » May 21, 2015 11:05 am


jtweath
Novice
Posts: 7
Liked: 1 time
Joined: Jul 21, 2015 7:03 pm
Full Name: Jay W
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by jtweath » Jul 27, 2015 3:33 pm

Has anybody been able to successfully get the automated services to work via batch files/scripts?

Vitaliy S.
Product Manager
Posts: 23062
Liked: 1582 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by Vitaliy S. » Jul 27, 2015 4:58 pm

Jay, do you still have this problem with scripts not being triggered? What did your support engineer say on this?

jtweath
Novice
Posts: 7
Liked: 1 time
Joined: Jul 21, 2015 7:03 pm
Full Name: Jay W
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by jtweath » Jul 28, 2015 2:25 pm

Vitaliy S. wrote:Jay, do you still have this problem with scripts not being triggered? What did your support engineer say on this?
This issue has not been resolved. My support engineer said they are testing it within their lab.

Shestakov
Veeam Software
Posts: 6992
Liked: 717 times
Joined: May 21, 2014 11:03 am
Full Name: Nikita Shestakov
Location: Prague
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by Shestakov » Aug 22, 2015 8:44 pm

Hello Jay, could you provide your support case number for us to follow the investigation? Thanks

Vitaliy S.
Product Manager
Posts: 23062
Liked: 1582 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by Vitaliy S. » Aug 23, 2015 6:29 pm

Nikita, it's this one # 00975173.

john.wood
Service Provider
Posts: 21
Liked: 2 times
Joined: Nov 21, 2016 10:00 pm
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by john.wood » Mar 28, 2017 9:13 pm

The scripts seem to be unavailable. Is there another location to access the scripts from?
VMCE

Vitaliy S.
Product Manager
Posts: 23062
Liked: 1582 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by Vitaliy S. » Mar 29, 2017 11:54 am

Hi John,

This his link. Meanwhile I will ask our support team to create a KB for that.

Thanks!

Vitaliy S.
Product Manager
Posts: 23062
Liked: 1582 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by Vitaliy S. » Mar 30, 2017 8:41 pm

Quick update! We've decided to create a dedicated KB article due to large number of requests for these scripts: https://www.veeam.com/kb2270

john.wood
Service Provider
Posts: 21
Liked: 2 times
Joined: Nov 21, 2016 10:00 pm
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by john.wood » Jul 23, 2017 11:48 pm

Hi,

Anyone else getting an issue for the VMs with No backup.

The batch script that is executed from VeeamOne populates the VMswithNoBackups.txt with a "Echo is On"

I've modified the batch script with @ECHO Off but it isnt passing the Vm Object name into the txt file.

Regards

John
VMCE

john.wood
Service Provider
Posts: 21
Liked: 2 times
Joined: Nov 21, 2016 10:00 pm
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by john.wood » Jul 24, 2017 4:49 am 1 person likes this post

Found the answer.

It doesn't really explain that you need to pass the parameters from the alarm in the script field.

For anyone looking the script field needs to pass the %2 "c:\scripts\01.VMswithNoBackups.bat %2"
VMCE

Shestakov
Veeam Software
Posts: 6992
Liked: 717 times
Joined: May 21, 2014 11:03 am
Full Name: Nikita Shestakov
Location: Prague
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by Shestakov » Jul 24, 2017 9:55 am

We are working on alarms automation feature for the next releases, so if you have any feedback, requests, please let us know.
Thanks!

lahad
Novice
Posts: 3
Liked: 1 time
Joined: Nov 29, 2017 9:42 pm
Full Name: Abdou Lahad SYLLA
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by lahad » Dec 02, 2017 7:28 pm

Hello everyone,
I am doing test for my thesis with Veeam ONE.
But when I try to run the 02.TerminateJobAfterXhours scripts, 04.AutoFailover, 03.Orphaned_snapshots I have these following errors:

Le terme «Get-VBRJob» is not recognized as a cmdlet name, function, script file, or executable program. Check the spelling of the name,
or if a path exists, check that the path is correct and try again.
+ CategoryInfo : ObjectNotFound: (Get-VBRJob:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
+ PSComputerName : localhost
+ PSComputerName : localhost





add-pssnapin :No snap-ins have been registered for Windows PowerShell version 4.
Au caractère C:\Scripts\03.Orphaned_snapshots.ps1:6 : 1
+ add-pssnapin VMware.VimAutomation.Core
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument : (VMware.VimAutomation.Core:String) [Add-PSSnapin], PSArgumentException
+ FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand


Set-PowerCLIConfiguration : The term "Set-PowerCLIConfiguration" is not recognized as a cmdlet name, function, script file, or program
executable. Check the spelling of the name, or if a path exists, check that the path is correct and try again.
Au caractère C:\Scripts\03.Orphaned_snapshots.ps1:7 : 1
+ Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -WarningAction Silent ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Set-PowerCLIConfiguration:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException


Can someone help me

lahad
Novice
Posts: 3
Liked: 1 time
Joined: Nov 29, 2017 9:42 pm
Full Name: Abdou Lahad SYLLA
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by lahad » Dec 03, 2017 7:25 pm

Thanks finally I was able to fix the errors by adding the Veeam cmd applet and installing PowerCLi from VMware.
But I still have the following error for the script:

Can not validate the argument on the "Job" parameter. The argument is null. Specify a valid value for the argument and try again.
     + CategoryInfo: InvalidData: (:) [Stop-VBRJob], ParameterBindingValidationException
     + FullyQualifiedErrorId: ParameterArgumentValidationError, Veeam.Backup.PowerShell.Cmdlets.StopVBRJob
     + PSComputerName: localhost

Vitaliy S.
Product Manager
Posts: 23062
Liked: 1582 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by Vitaliy S. » Dec 04, 2017 10:50 am

Abdou, what job name do you set as a part of the script? It seems like the parameter is not specified, that's why you see this error message.

lahad
Novice
Posts: 3
Liked: 1 time
Joined: Nov 29, 2017 9:42 pm
Full Name: Abdou Lahad SYLLA
Contact:

Re: ONEbelievable tricks: Veeam ONE and Automation Services

Post by lahad » Dec 07, 2017 8:42 pm 1 person likes this post

Thank you Vitaliy, your help allowed me to solve the problem.
In fact I had not given the right argument on the parameters #jobname.

It's works!

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests