You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix markdownlint violations in machine-policies.mdx
CI lints the full content of any touched file, not just the diff, so
this pre-existing lint debt (missing blank lines around headings/lists/
fences, missing image alt text, bold-as-heading, hard tabs, trailing
whitespace, a stale link fragment) was blocking this PR. Converts bold
pseudo-headings to real headings and adds descriptive alt text to
images based on surrounding context.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This machine policy cannot be deleted however it can be edited and any new deployment targets without an explicitly assigned machine policy will use the default one. Other machine policies will also inherit the bash/powershell scripts used for health checking from the default policy unless they have one explicitly set.
@@ -44,13 +45,12 @@ A *healthy* deployment target completes a health check without any errors or war
44
45
You can review the health status of you deployment targets by navigating to **Infrastructure ➜ Deployment Targets**.

48
49
:::
49
50
50
-
51
51
### Health check step
52
52
53
-
It's also possible to run a health check as part of a deployment or runbook using the built-in [health check step](/docs/projects/built-in-step-templates/health-check).
53
+
It's also possible to run a health check as part of a deployment or runbook using the built-in [health check step](/docs/projects/built-in-step-templates/health-check).
54
54
55
55
This step allows a deployment target that was created in the currently executing deployment to be confirmed as healthy and then added to the running deployment for subsequent steps.
56
56
@@ -64,15 +64,16 @@ After creating a new Tentacle or SSH Target, Octopus Deploy will automatically s
64
64
2. Click the ... overflow menu and select **Check Health**. If you have multiple deployment targets that support health checking it will start health checks for each of them.

68
68
:::
69
69
70
70
However if you would like to check the health of a single deployment target you can do the following:
71
+
71
72
1. Select the deployment target you would like to health check.
72
73
2. Click on the **Connectivity** tab then click on the **Check Health** button on the top right of the page.

76
77
:::
77
78
78
79
The first time you complete a health check on a Tentacle or SSH Target, you will see health warnings and that Calamari needs to be installed.
@@ -85,99 +86,106 @@ Octopus will automatically push the latest version of Calamari with your first d
85
86
2. Click the ... overflow menu and select **Upgrade Calamari on Deployment Targets**.

89
90
:::
90
91
91
92
Like with the health check if you would rather just update Calamari on a single deployment target you can achieve this by:
93
+
92
94
1. Select the deployment target you would like to update Calamari on.
93
95
2. Click on the **Connectivity** tab then click on the **Update Calamari** button.
94
96
95
97
## Health check configuration
98
+
96
99
### Health check schedule type
100
+
97
101
A health check can be scheduled in the following ways:
98
102
99
-
**Never**
103
+
#### Never
100
104
101
105
No automatic health checks will be scheduled, when this option is selected. Manual health checks can still be run when desired.

118
122
:::
119
123
120
124
### Health check type
125
+
121
126
You can configure health checks to run scripts on Tentacle or SSH deployment targets, or just check that a connection can be established with the Tentacle or SSH deployment targets.
122
127
123
-
**Run health check script**
128
+
#### Run health check script
124
129
125
130
Machine policies allow the configuration of custom health check scripts for Tentacle and SSH deployment targets. While we do not expose the full underlying script that runs during health checks, we give you an entry point to inject your own custom scripts.

128
133
:::
129
-
By default, machine policies will inherit the script from the default machine policy if one has not been defined. For more details on providing a custom script see the section [Custom health check script](#custom-health-check-script)
134
+
By default, machine policies will inherit the script from the default machine policy if one has not been defined. For more details on providing a custom script see the section [Custom health check script](#custom-health-check-scripts)
130
135
131
-
**Connection test**
136
+
#### Connection test
132
137
133
138
The health check will only perform a basic connection test to see if the deployment target is reachable. This option is recommended if you are using the raw scripting feature.

136
141
:::
137
142
138
143
### Machine behavior during health checks
144
+
139
145
This setting controls what the expected behavior of machines should be during a health check.
140
146
141
-
**Unavailable causes health checks to fail**
147
+
#### Unavailable causes health checks to fail
142
148
143
149
If a machine is unavailable during an attempted health check it will cause the check to be failed.

146
152
:::
147
153
148
-
**Ignore machines that are unavailable during health checks**
154
+
#### Ignore machines that are unavailable during health checks
149
155
150
156
By default, health checks fail if any deployment targets are unavailable during the health check. Machine policies offer an option to ignore machines if they are unavailable during a health check:

154
160
:::
155
161
156
162
By selecting **Unavailable machines will not cause health checks to fail,** any deployment targets that Octopus cannot contact during a health check will be skipped and the health check marked as successful. If the target is contactable but encounters an error or warning, the usual health check behavior will proceed (i.e., a warning will be reported or the health check will fail with an error).
157
163
158
164
### Custom health check script \{#custom-health-check-scripts}
165
+
159
166
When the selected health check type is "Run health check scripts" you can provide script(s) that will execute during the health check.
160
167
161
-
**Default PowerShell health check script**
168
+
#### Default PowerShell health check script
162
169
163
170
Here is the default custom health check script for PowerShell that checks disk space:
The function *CheckDriveCapacity* informs you about how much space is available on your deployment target's local hard disk and will write a warning if the free disk space is less than this threshold. You can add additional PowerShell to this script to customize your health checks as you wish, modify or remove the disk space checking altogether. It's entirely up to you! Just remember, you can copy and paste the original script above *back* into your machine policy if you run into any problems and wish to get back to the default behavior.
175
183
176
-
**Set the status**
184
+
#### Set the status
177
185
178
186
A health check script can set the status of a target by returning a non-zero exit code or by writing a service message during the health check. PowerShell based deployment targets can use *Write-Warning*, *Write-Error* and *Fail-HealthCheck* to convey a healthy with warnings or unhealthy status:
179
187
180
-
**PowerShell health check service messages**
188
+
#### PowerShell health check service messages
181
189
182
190
```powershell
183
191
# For setting a health status of Healthy with Warnings:
@@ -191,7 +199,7 @@ Bash targets do not include a disk space check by default like PowerShell target
191
199
192
200
Bash deployment targets can use *echo\_warning*, *echo\_error* and *fail\_healthcheck* to convey a *healthy with warnings* or *unhealthy* status:
193
201
194
-
**Bash Health Check Service Messages**
202
+
#### Bash Health Check Service Messages
195
203
196
204
```bash
197
205
# For setting a health status of Healthy with Warnings:
@@ -209,7 +217,7 @@ When using a custom health check script, the script execution through Calamari i
209
217
210
218
## Configure how Calamari, Tentacle and Kubernetes agents are updated \{#configure-machine-updates}
211
219
212
-
Brand new Tentacle, Kubernetes agent and SSH endpoints require the installation of Calamari to perform a deployment. Also, if Calamari is updated, the Octopus Server will push the update to Tentacle, Kubernetes agent and SSH endpoints.
220
+
Brand new Tentacle, Kubernetes agent and SSH endpoints require the installation of Calamari to perform a deployment. Also, if Calamari is updated, the Octopus Server will push the update to Tentacle, Kubernetes agent and SSH endpoints.
213
221
When there is a Tentacle or Kubernetes agent update, Octopus can automatically update Tentacle and Kubernetes agent endpoints. Machine policies allow the customization of when Calamari, Tentacle and Kubernetes agent updates occur.
214
222
215
223
:::figure
@@ -221,7 +229,7 @@ By default, Calamari will be installed or updated when a machine is involved in
221
229
- the first time a machine is added to Octopus and then subsequently when it is involved in a deployment.
222
230
- any time Octopus detects Calamari is out of date (after health checks for example).
223
231
224
-
Tentacle and Kubernetes agents can be toggled to manually or automatically update. If **Automatically** is selected, Octopus will start a task to update Tentacles and Kubernetes agents whenever Octopus detects that there is a pending Tentacle or Kubernetes agents upgrade (after health checks for example).
232
+
Tentacle and Kubernetes agents can be toggled to manually or automatically update. If **Automatically** is selected, Octopus will start a task to update Tentacles and Kubernetes agents whenever Octopus detects that there is a pending Tentacle or Kubernetes agents upgrade (after health checks for example).
225
233
226
234
Conversely, Octopus will not automatically update Tentacle or Kubernetes agents but instead will display a prompt to begin a Tentacle and Kubernetes agents update on the Deployment Targets and Environments screens.
227
235
@@ -251,30 +259,31 @@ You can configure whether Octopus Deploy should re-attempt failed communications
251
259
252
260
- With this setting **Enabled**, if a network error occurs, Octopus will re-attempt communication with the Tentacle for the amount of time configured. However, continued network errors will cause a failure.
253
261
254
-
255
262
:::div{.warning}
256
263
Using this setting with a Tentacle that runs on ephemeral storage will introduce the possibility that a script could run twice. For example, when running Tentacle in Docker without a mount. It is recommended to run Tentacle on a persistent file system.
257
264
:::
258
265
259
266
### Retry durations
267
+
260
268
You can configure the amount of time allowed for Octopus to re-attempt failed communication with Tentacle. There are two duration configurations available:

267
275
:::
268
276
269
277
### Step Retries and execution timeouts
278
+
270
279
If you would like to retry a particular step within the deployment process for other types of temporary or transient errors, that can be [configured separately](/docs/projects/steps/conditions/#retries-and-execution-timeouts).
271
280
272
281
## Automatically delete machines
273
282
274
283
Machine policies can be configured to automatically remove unavailable machines after a time period. When a health check runs, Octopus detects if machines are unavailable (cannot be contacted). When the **Automatically delete unavailable machines** option is set, Octopus checks how long a machine has been unavailable. If the specified time period has elapsed, the machine is permanently deleted from Octopus.
@@ -286,7 +295,7 @@ Configurable machine package cache retention was introduced in **Octopus 2025.3*
286
295
The machine package cache retention policy ensures that packages are periodically removed from the machine cache. This is handled by Octopus by default, but can be configured per machine policy as required.
@@ -299,48 +308,50 @@ For Tentacles, [Retry Durations](#recover-from-communication-errors) should be u
299
308
300
309
Machine policies define rules for how long to wait for a connection to be established to a Tentacle or SSH target as well as how it should retry the connection if the initial attempts do not succeed.

303
312
:::
304
313
305
-
**Connect timeout**
314
+
#### Connect timeout
306
315
307
316
How long in hours/minutes/seconds to wait for a Listening Tentacle or SSH target respond to a connection before timing out. Depending on what operating system the machine is running could potentially mean the timeout is shorter than expected.
308
317
309
-
**Retry attempts**
318
+
#### Retry attempts
310
319
311
320
How many times the connection to the Listening Tentacle or SSH target should be retried before failing the health check.
312
321
313
-
**Retry wait interval**
322
+
#### Retry wait interval
314
323
315
324
How long to wait between connection retries.
316
325
317
-
**Retry time limit**
326
+
#### Retry time limit
318
327
319
328
Maximum time limit for how long retries can be attempted for.
320
329
For example, if you have the following configuration:
330
+
321
331
- Retry time limit: 1 minute.
322
332
- Retry attempts: 4.
323
333
- Retry interval: 30 seconds.
324
334
325
335
In this scenario only a maximum of 2 retries could be attempted before reaching the time limit.
326
336
327
337
### Polling request queue timeout
338
+
328
339
This setting controls how long Octopus Deploy will wait before cancelling a task in a polling Tentacle's queue. For more details on what the Polling Tentacle queue is see the documentation on [Tentacle communication modes](/docs/infrastructure/deployment-targets/tentacle/tentacle-communication#polling-tentacles)
Assign a machine policy to a machine by selecting a machine from the *Deployment Targets* or *Workers* screen and using the *Policy* drop down to select the machine policy:

339
350
:::
340
351
341
352
Machine policy can also be set from the command line by using the --policy argument:
0 commit comments