Host-based backup of Microsoft Hyper-V VMs.
Post Reply
vbr4pppsgv
Influencer
Posts: 10
Liked: 1 time
Joined: Sep 26, 2013 9:00 pm
Full Name: PPPSGV IT Admin
Contact:

V7 - Scripting SCVMM maintenance mode as part of the job?

Post by vbr4pppsgv »

Hi All,
I have a job that backs up a Hyper-V cluster. It currently has 3 hosts . We just added the 3rd host recently, however I only have licenses for 2 hosts until I can make the purchase in 2 months. I've been manually putting one of the hosts into maintenance mode so that the guests would move to the 2 licensed hosts, but this is a chore. I've looked into setting up Task Scheduler jobs on the 3rd host to disable and eventually re-enable the host, but my backup windows are a bit flexible and I was hoping there was a way to run the scripts as part of the job itself.
I see where I can run a post-job command. I'm guessing a powershell script could be created but I'm not a powershell expert. Also, there isn't an option to run a pre-job command. The backup job is scheduled to run after another job, so I'm guessing I could add a post-job command to that job. Seems kind of messy though. Any ideas?
Thanks in advance.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: V7 - Scripting SCVMM maintenance mode as part of the job

Post by veremin »

Haven't thought about updating at least to version 8 that has pre-job activity option and Disable-SCVMHost inside this command? As far as I'm concerned, Disable-SCVMHost should put a given host into maintenance mode.

By the way, I'm wondering what's the reason of running an old software version that is no longer supported.

Thanks.
vbr4pppsgv
Influencer
Posts: 10
Liked: 1 time
Joined: Sep 26, 2013 9:00 pm
Full Name: PPPSGV IT Admin
Contact:

Re: V7 - Scripting SCVMM maintenance mode as part of the job

Post by vbr4pppsgv »

v.Eremin wrote:Haven't thought about updating at least to version 8 that has pre-job activity option and Disable-SCVMHost inside this command? As far as I'm concerned, Disable-SCVMHost should put a given host into maintenance mode.
That's what I figured. May have to consider upgrading sooner than planned. Thanks.
v.Eremin wrote:By the way, I'm wondering what's the reason of running an old software version that is no longer supported.
Cause it ain't broke. It is on my to-do list this year though.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: V7 - Scripting SCVMM maintenance mode as part of the job

Post by veremin »

If you still want to stay on version 7, the best option you have is to run both pre-job activity and backup job itself within the same script. Say, the first portion of the script connects to SCVMM, gets required host and puts it into maintenance mode, while second part executes the backup job (Start-VBRJob -name "Name of your Job"). Thanks.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 31 guests