Host-based backup of VMware vSphere VMs.
Post Reply
ithark
Enthusiast
Posts: 40
Liked: 6 times
Joined: Sep 30, 2020 11:22 am
Full Name: Karthik
Contact:

Automatic shutdown of Veeam Proxy servers

Post by ithark »

Dear team,
We have a requirement to run the proxy servers only during the backup window.
Our backup window is between 8 PM until 4 AM.
Hence, I was planning to shutdown all proxy servers at 4.30 AM using windows Task scheduler. I will then power on the servers using the powercli.
My only problem is, sometimes, some of the jobs would run outside of the backup window.
Hence, when I initiate the shutdown, I would like to check if any backup job is running and using the current proxy,
If no jobs are running, the proxy would be powered off.
If not, the task would run again after1 hour.
Here, I will need help to find out ways to identify if a proxy server is in use.
Can you please help me with the same?
Thanks in advance!
Regards,
Karthik
Regards,
Karthik
david.domask
Veeam Software
Posts: 2163
Liked: 519 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Automatic shutdown of Veeam Proxy servers

Post by david.domask »

Hi Karthik,

Will you be handling the shutdown manually or you need an automated way to check if jobs are running?

If you're checking manually, you can use the solution in this thread: post478303.html#p478303

The Veeam.Backup.Manager.exe has a few flags it can run with and it will show you current repository and proxy usages.

If you're looking to automate this, you'd probably want to use Powershell and Get-VBRJob to check the current state of each job, and just wait to shutdown the proxies until all jobs are finished.
David Domask | Product Management: Principal Analyst
ithark
Enthusiast
Posts: 40
Liked: 6 times
Joined: Sep 30, 2020 11:22 am
Full Name: Karthik
Contact:

Re: Automatic shutdown of Veeam Proxy servers

Post by ithark »

Hi David,
Thanks a lot for your reply.
I am trying to automate this as much as I can.
I would like to have the ability to check the proxy usage from within the proxy server itself and not to have this validation process dependent on the Veeam instance.
For example, is there a service on the proxy server that would be running only if the backup job is currently using that particular proxy server?
Regards,
Karthik
Regards,
Karthik
david.domask
Veeam Software
Posts: 2163
Liked: 519 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Automatic shutdown of Veeam Proxy servers

Post by david.domask »

Hi Karthik,

Regrettably trying to parse from something on the Proxy itself probably isn't the best idea. I guess you can check for veeamagent.exe (or veeamagent for linux proxies) from Get-Process/ps respectively and if there aren't any running, it should be fine to consider the proxy safe to shutdown.

Why not just check with Veeam's Powershell cmdlet Get-VBRJob? That will tell you the status of the job and if it's running (you can check the IsRunning property for example), and if no jobs are running, you'll know to stop the proxies.
David Domask | Product Management: Principal Analyst
ithark
Enthusiast
Posts: 40
Liked: 6 times
Joined: Sep 30, 2020 11:22 am
Full Name: Karthik
Contact:

Re: Automatic shutdown of Veeam Proxy servers

Post by ithark »

Hi David,
The reason why I was trying to accomplish this from the proxy server is due to my limited scripting experience.
I am of the understanding that if I try to look up with Veeam, I will need to construct a not-so-straightforward script to check and power off the proxies.
Please correct me if I am wrong.
Regards,
Karthik
Regards,
Karthik
david.domask
Veeam Software
Posts: 2163
Liked: 519 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Automatic shutdown of Veeam Proxy servers

Post by david.domask »

Hi Karthik,

I would focus on just monitoring for active jobs from the VBR server then. Start with the Get-VBRJob cmdlet as it will return the jobs and their current state, then you can write commands to power off the proxies, however you intend to do so.

Basically, you can monitor the usage pretty readily, but it depends on how stringent you want to be with shutting off the proxies, like should they stop as soon as they have no more tasks or hard cut-off at the end of the backup window?

I would maybe plan out a workflow for this with your specific business logic, then post on our Powershell forums and we can advise how you might approach that with Powershell.
David Domask | Product Management: Principal Analyst
ithark
Enthusiast
Posts: 40
Liked: 6 times
Joined: Sep 30, 2020 11:22 am
Full Name: Karthik
Contact:

Re: Automatic shutdown of Veeam Proxy servers

Post by ithark »

Hi David,

Thanks for offering your help.

We have 6 proxy servers (Excludes the backup server)

The first job starts at 7:30 PM
The last of the job finishes at 4 AM.

I got this info from Veeam one, on the job calendar for the past 1 month.

Although the last job finishes by 4 AM on average, it does sometimes finish after 4 AM, very rare though!

So I would require to,

1) At 4 AM, check if any backup job is running.
2) If it is running, what is the proxy being used?
3) Except for the proxy being used, shut down all other proxies

4) At 5 AM, we run the same script once again and this time, is to power off any remaining proxies.

5) At 7 PM, the Script will then run on the backup server to power on the proxy servers by accessing the vCenter API. (I have this covered :-))

Regards,
Karthik
Regards,
Karthik
david.domask
Veeam Software
Posts: 2163
Liked: 519 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Automatic shutdown of Veeam Proxy servers

Post by david.domask »

Hi Karthik,

The workflow is clear, and what you'll want from VBR is to use Get-VBRJob and Get-VBRBackupSession.

https://helpcenter.veeam.com/docs/backu ... ml?ver=120

Start with our cmdlet list here and try making a script to check if the jobs are running and their current status; just save the output to some variable and check what properties each object has you can check on. Once you've worked out the basics of a script, if you're having trouble, make a new topic on our Powershell forums and post your script and your challenge, and we'll try to advise.
David Domask | Product Management: Principal Analyst
Origin 2000
Service Provider
Posts: 91
Liked: 23 times
Joined: Sep 24, 2020 2:14 pm
Contact:

Re: Automatic shutdown of Veeam Proxy servers

Post by Origin 2000 »

Why not shutdown the proxies through the backup job it self? You can execute Script before and at the end of a Job. We shutdown ESXi Hosts for example.

Regards,
Joerg
ithark
Enthusiast
Posts: 40
Liked: 6 times
Joined: Sep 30, 2020 11:22 am
Full Name: Karthik
Contact:

Re: Automatic shutdown of Veeam Proxy servers

Post by ithark »

Hi Joerg,
It would have been possible if we were using a single proxy for each job.
Here we are using multiple proxies for multiple jobs and hence the same proxy might be in use by a different job.
Regards,
Karthik
Regards,
Karthik
wsmery
Novice
Posts: 8
Liked: never
Joined: Sep 24, 2019 3:56 pm
Full Name: Wayne Mery
Contact:

Re: Automatic shutdown of Veeam Proxy servers

Post by wsmery »

What problem or fear are you attempting to resolve by having proxy servers shut down for just half the day?
ithark
Enthusiast
Posts: 40
Liked: 6 times
Joined: Sep 30, 2020 11:22 am
Full Name: Karthik
Contact:

Re: Automatic shutdown of Veeam Proxy servers

Post by ithark »

Hi Wayne,

Neither.

There are some requirements within the organization that we have to meet, and this is needed to fulfill this requirement.

Regards,
Karthik
Regards,
Karthik
PetrM
Veeam Software
Posts: 3626
Liked: 608 times
Joined: Aug 28, 2013 8:23 am
Full Name: Petr Makarov
Location: Prague, Czech Republic
Contact:

Re: Automatic shutdown of Veeam Proxy servers

Post by PetrM »

Hello,

An alternative solution could be parsing of RTS.ResourcesUsage.log (C:\ProgramData\Veeam\Backup) but it also requires scripting. You will probably find some useful tips in this blog.

Thanks!
Post Reply

Who is online

Users browsing this forum: pirx and 27 guests