Habitat Upgrade Assistant - Scheduler Not Working

Support forums for the Habitat Automate plugin
Post Reply
mmiller_ITA
Posts: 4
Joined: Thu Apr 16, 2020 3:44 pm

Habitat Upgrade Assistant - Scheduler Not Working

Post by mmiller_ITA »

I have everything set up (policy created, policy applied) and I scheduled an upgrade via "Schedule Upgrade" by specifying a date and time. However, it never queued the OS upgrade script at the time specified. Is there something I am missing? The Master Switch is on and when I manually run via Upgrade Now, it works fine. See screenshot.. you will see the schedule as well as the actual run time (via my manually kicking it off)
Attachments
screenshot.png
screenshot.png (4.95 KiB) Viewed 3512 times

edward.cossett
Posts: 8
Joined: Tue Feb 11, 2020 4:23 pm

Re: Habitat Upgrade Assistant - Scheduler Not Working

Post by edward.cossett »

Seems we are having the same issue with scheduling upgrades. Works fine while manually pushing them. I scheduled updates for a good 8hours in advance yesterday, and it still didn't run at all.

mmiller_ITA
Posts: 4
Joined: Thu Apr 16, 2020 3:44 pm

Re: Habitat Upgrade Assistant - Scheduler Not Working

Post by mmiller_ITA »

Any reply from the dev team? Is this our path to support? Talk to me Goose!

User avatar
Cubert
Posts: 1483
Joined: Tue Dec 29, 2015 7:57 pm
Contact:

Re: Habitat Upgrade Assistant - Scheduler Not Working

Post by Cubert »

Sorry guys missed the tread...

I am working on a few new updates today and will have a peek at this to see if there is a problem with the timers. I'll let you know what I find later today.

User avatar
Cubert
Posts: 1483
Joined: Tue Dec 29, 2015 7:57 pm
Contact:

Re: Habitat Upgrade Assistant - Scheduler Not Working

Post by Cubert »

Ok just had a peek at this and here is the skinny,


The Windows OS upgrade scheduler runs once a day at midnight-ish(+/- 10 minutes)
When it start, it logs "Habitat Operations (Windows Upgrade Scheduler) Started. " in the habitat plugin log.


It queries "SELECT * FROM plugin_p4a_habitat_win10upgrades_agents WHERE date(`Schedule`) = curdate();" to get a list of agent-ID's to schedule script against. It then uses that date as the schedule time to run script.

The 2 drawbacks in this method is that you can not schedule policy for same day, You must cross that midnight boundary to get the query to list the agents. The second drawback is with time zones. The Automate server schedules scripts differently based on time zones so if you want a client in a different time zone to install at a given time make sure what TZ its in and make adjustments accordingly.

If an agent is found by query it will show in plugin logs as a agent count
"Habitat Operations (Windows Upgrade Scheduler) scripted for [{0}] agents."

edward.cossett
Posts: 8
Joined: Tue Feb 11, 2020 4:23 pm

Re: Habitat Upgrade Assistant - Scheduler Not Working

Post by edward.cossett »

Awesome, thanks for the Update! Good to know that it runs around midnight. I'll keep that in mind for future testing!

mmiller_ITA
Posts: 4
Joined: Thu Apr 16, 2020 3:44 pm

Re: Habitat Upgrade Assistant - Scheduler Not Working

Post by mmiller_ITA »

Thanks for the info!! I will keep both pieces of information in mind.

For anyone else following this thread and running on-prem Automate, and schedule an upgrade or apply a policy and want to remove either, it can be done in the db by deleting the record for the associated computerID. The record is located in the "plugin_p4a_habitat_win10upgrades_agents" table. The GUI does not allow for removal of a previously assigned policy or schedule.

mmiller_ITA
Posts: 4
Joined: Thu Apr 16, 2020 3:44 pm

Re: Habitat Upgrade Assistant - Scheduler Not Working

Post by mmiller_ITA »

Cubert wrote:
Tue May 05, 2020 2:58 pm
Ok just had a peek at this and here is the skinny,


The Windows OS upgrade scheduler runs once a day at midnight-ish(+/- 10 minutes)
When it start, it logs "Habitat Operations (Windows Upgrade Scheduler) Started. " in the habitat plugin log.


It queries "SELECT * FROM plugin_p4a_habitat_win10upgrades_agents WHERE date(`Schedule`) = curdate();" to get a list of agent-ID's to schedule script against. It then uses that date as the schedule time to run script.

The 2 drawbacks in this method is that you can not schedule policy for same day, You must cross that midnight boundary to get the query to list the agents. The second drawback is with time zones. The Automate server schedules scripts differently based on time zones so if you want a client in a different time zone to install at a given time make sure what TZ its in and make adjustments accordingly.

If an agent is found by query it will show in plugin logs as a agent count
"Habitat Operations (Windows Upgrade Scheduler) scripted for [{0}] agents."

Can the Windows OS upgrade scheduler be modified? Is it a stored procedure? A client scheduled script?

User avatar
Cubert
Posts: 1483
Joined: Tue Dec 29, 2015 7:57 pm
Contact:

Re: Habitat Upgrade Assistant - Scheduler Not Working

Post by Cubert »

Can the Windows OS upgrade scheduler be modified? Is it a stored procedure? A client scheduled script?
No, but I am looking at identifying the date you enter as same day and will add in to schedule script right away using datetime you provide. This will resolve the issue of whether or not to use the schedules for later deployment. If we just schedule everyone at the time you set and you set for a date weeks into the future then Automate will remove script schedule as it sits in queue over 5 days (i believe). This is why we are looking for dates daily and only schedule the scripts on the day you requested.

I'll post back here when this has been added. We are currently live on build 1.0.0.41 so look for it in .42 or .43

Post Reply