15 Feb 2022
06:43 AM
- last edited on
28 Apr 2022
03:35 PM
by
AgataWlodarczyk
Hi Dynatrace lovers,
We have a problem with updating our OneAgents during the defined OneAgent Updates window.
As soon as we update wished version of OA to higher as current, it immediately starts an update and ignores the Update window, which is set in the future.
Update Window is not reoccurring.
Update window created as following:
[ { "schemaVersion": "0.63.1", "scope": "environment", "value": { "enabled": true, "name": "test once", "recurrence": "ONCE", "onceRecurrence": { "recurrenceRange": { "start": "2022-02-15T02:00:00Z", "end": "2022-02-15T04:00:00Z" } } }, "schemaId": "builtin:deployment.management.update-windows" } ]
OA update settings are updated as follows:
{ "setting": "DISABLED", "version": "1.231.249.20220112-164343", "updateWindows": { "windows": [ { "id": "vu9U3hXa3q0AAAABACxidWlsdGluOmRlcGxveW1lbnQubWFuYWdlbWVudC51cGRhdGUtd2luZG93cwAGdGVuYW50AAZ0ZW5hbnQAJGRlYTEwYjc0LWE0NmEtMzQ3OS1iNGM2LTIyMjI2MzViODQyNb7vVN4V2t6t" } ] } }
where id is Update window ID which is set in the future.
Any ideas on how to make it work?
We are not allowed to start updates outside our normal System Maintenance windows which occur at night ...
Thanks in advance!
Ingrida
Solved! Go to Solution.
17 Feb 2022 06:45 AM
Hi @Ingrida if I understand you correctly, your problem is that you've set a OneAgent update schedule that should trigger agent updates at a specific time and date only, but OneAgents are still updating outside of this window?
If yes, is the global/host group/individual host update policy set to 'No automatic updates'? If it is not, then that would be the problem. You'd need to disable auto-updates, after which your update window should work.
https://www.dynatrace.com/support/help/shortlink/oneagent-update
17 Feb 2022 08:32 AM
Hi @andre_vdveen ,
Thanks for checking it. Yes, you understood the problem correct: OA is getting updated imidiatelly despite update window set in the future.
I thought if I do settings: "DISABLED" it will ignore settings on all upper levels? However, checking right now:
env level settings:
{ "metadata": { "configurationVersions": [ 0 ], "clusterVersion": "1.230.136.20211216-085238" }, "setting": "DISABLED", "version": null, "updateWindows": { "windows": [] } }
The host had no host group set.
I tested now with another host with host group existing and setting on host group as:
{ "metadata": { "configurationVersions": [ 2 ], "clusterVersion": "1.230.136.20211216-085238" }, "id": "HOST_GROUP-F14F7A1955434E16", "setting": "INHERITED", "version": null, "updateWindows": { "windows": [] }, "effectiveSetting": "DISABLED", "effectiveVersion": null }
And setting on HOST as following:
{
"setting": "DISABLED",
"version": "1.225.159.20211013-185604",
"updateWindows": {
"windows": [
{
"id": "vu9U3hXa3q0AAAABACxidWlsdGluOmRlcGxveW1lbnQubWFuYWdlbWVudC51cGRhdGUtd2luZG93cwAGdGVuYW50AAZ0ZW5hbnQAJGRlYTEwYjc0LWE0NmEtMzQ3OS1iNGM2LTIyMjI2MzViODQyNb7vVN4V2t6t"
}
]
}
}
It updated again before Window started 😞
I.
18 Feb 2022 03:09 PM - edited 18 Feb 2022 03:19 PM
Did you create the maintenance window via the Dynatrace web UI?
https://www.dynatrace.com/support/help/shortlink/oneagent-update#maintenance-windows
If not, you have to define a OneAgent update maintenance window there, as it is currently not possible to create a OneAgent maintenance window for updates via the API (unless I'm missing something? 🤔).
After that's done, you have to set the agents to update based on the created OneAgent maintenance window, created in the previous step above.
https://www.dynatrace.com/support/help/setup-and-configuration/dynatrace-oneagent/oneagent-update#ex...
You can use the API to set the agent/host group/global setting
https://www.dynatrace.com/support/help/dynatrace-api/configuration-api/oneagent-configuration
What I'm struggling with here, is getting the ID for the OneAgent update maintenance window I've created; it doesn't seem to be listed under the normal maintenance windows API?
https://www.dynatrace.com/support/help/dynatrace-api/configuration-api/maintenance-windows-api
Perhaps I'm looking at the wrong API and someone can help me out here? 😶
25 Feb 2022
08:10 AM
- last edited on
25 Feb 2022
08:38 AM
by
andre_vdveen
Thanks for the reply, we did both actually. and there is a way to create an OA Update window via Settings API with the following schema:
{
"schemaId": "builtin:deployment.management.update-windows",
"displayName": "Maintenance windows for OneAgent updates",
"latestSchemaVersion": "0.63.1"
}
So, you can set or list your windows using settings API and this schema.
However, we had Support Ticket open for this problem, and meanwhile, it was confirmed that it is a bug and a fix is on the way.
Hope in clarifies,
Best Regards,
Ingrida
25 Feb 2022 08:55 AM
Hi @Ingrida, thank you for the feedback, it is always helpful to post findings and outcomes here, as it helps others too (like myself, in this case 🤓).
Did Support indicate in which version the bug will be fixed?
11 Mar 2022 10:21 AM
Hi @andre_vdveen ,
So far I got very cloudy answer from suppot:
The Dev team has determined this is a bug and is going to work to improve here but it won't be immediate. Here is what we know:
So, while we can't do what you are looking for now, we are discussing updates to the API which would handle this situation much better. Long term we are looking to improve the autoUpdate process as a whole.
Best regards,
Ingrida
17 Mar 2022 05:15 PM
Hi @andre_vdveen ,
From our support ticket:
"Development has made us aware that they have fixed this bug, and the fix will be rolled out in v238. To be clear, this fix involves invalidation of the scenario that you experienced - specifically the use of the Dynatrace API to create a Maintenance Window while the AutoUpdate was disabled. This specific use case has led the team to begin working on improvements for Maintenance Windows as a whole, however this is a long term fix that will take some time to implement with no current date set in sight"
So, fix is actually removing not working feature and we habe to wait for new MW improvements.
Best regards,
Ingrida
18 Mar 2022 12:17 PM
Thanks a lot for sharing, @Ingrida!
21 Apr 2022 05:19 PM
Hi @andre_vdveen ,
Late update to this one with somepartial good news: during internal discussions "how should we do it now" , @mark_bley propossed to use OneAgent Maintence window without nailing down OneAgent versino to be updated, so that latest available on Cluster will be used. So, we tested it. And it works!
So, if you set up Mainenance window and do not touch verion, it actually works.
This is how we define OA MW:
.../api/v2/settings/objects?validateOnly=false
[
{
"schemaId": "builtin:deployment.management.update-windows",
"scope": "environment",
"value": {
"enabled": true,
"name": "Update test for a window with latest version",
"recurrence": "ONCE",
"onceRecurrence": {
"recurrenceRange": {
"start": "2022-04-06T18:00:00Z",
"end": "2022-04-06T19:00:00Z"
}
}
}
}
and here setting it up:
.../api/config/v1/hosts/HOST-DB5D6286AC7F0E11/autoupdate
{ "setting": "ENABLED",
"version": null,
"updateWindows": {
"windows": [
{
"id": "vu9U3hXa3q0AAAABACxidWlsdGluOmRlcGxveW1lbnQubWFuYWdlbWVudC51cGRhdGUtd2luZG93cwAGdGVuYW50AAZ0ZW5hbnQAJDBiZjgwMmIzLTdmMDQtMzQ0Mi1iM2ZkLWFlMDlmNDM2ZDQxMb7vVN4V2t6t"
}
]
}
}
So, only thing we need to be carefull about is to make sure latest version of OA is always the one we want to update... It's kinda semisolution but better as to set up update dynamically last minute.
Hope it helps.
Best regards,
Ingrida