Restart/Start scheduled machine

I’ve set a machine to run on an hourly schedule. The schedule works. However, it is not possible to manually start/restart the machine.

fly machines update <REDACTED> --schedule=hourly

[
    {
        "id": "<REDACTED>",
        "name": "<REDACTED>",
        "state": "stopped",
        "region": "syd",
        "image_ref": {
            "registry": "registry.fly.io",
            "repository": "<REDACTED>",
            "tag": "deployment-<REDACTED>",
            "digest": <REDACTED>",
        },
        "instance_id": "01JK4HEV8295G2CZ5Q6DW6DJP0",
        "private_ip": "<REDACTED>",
        "created_at": "2025-01-15T03:33:28Z",
        "updated_at": "2025-02-02T23:56:40Z",
        "config": {
            "env": {
                <REDACTED>
            },
            "init": {},
            "guest": {
                "cpu_kind": "shared",
                "cpus": 1,
                "memory_mb": 1024
            },
            "metadata": {
                "fly_flyctl_version": "0.3.72",
                "fly_platform_version": "v2",
                "fly_process_group": "app",
                "fly_release_id": "<REDACTED>",
                "fly_release_version": "85"
            },
            "image": "registry.fly.io/<REDACTED>",
            "schedule": "hourly",
            "restart": {
                "policy": "on-failure",
                "max_retries": 10
            }
        },
        "events": [
            <REDACTED>
        ],
        "host_status": "ok"
    }
]

fly machines stop <REDACTED>

Sending kill signal to machine <REDACTED> has been successfully stopped.

fly machines restart <REDACTED>

Restarting machine <REDACTED>
Error: failed to restart machine <REDACTED>: could not stop machine <REDACTED>: failed to restart VM <REDACTED>: failed_precondition: machine still active, refusing to start (Request ID: 01JK4HWJFGS3MX011DBMST8NB4-syd)

fly machines start <REDACTED>

Error: could not start machine <REDACTED>: failed to start VM <REDACTED>: failed_precondition: machine still active, refusing to start (Request ID: 01JK4HXKDTZFSQVGWCMV3WEH4X-syd)`

Seems to me that I should be able to start/restart a scheduled machine, just like any other machine.

Even if the schedule is set to a new time within the hour, we don’t have a choice when in the hour the machine runs on the hourly schedule anyway, and it is of no consequence to me if the scheduled time changes due to start/restart. I only care that it runs once an hour… and that I can manually start/restart whenever I want).

Hi… This is a known limitation (unfortunately):

Scheduled machines cannot be started via flyctl or Machines API commands, they will only run according to the schedule.

It would definitely be nice to have more flexibility, though…

Curiously, it is possible to start the machine via the cli once after an update.

fly machines restart <REDACTED>

Restarting machine <REDACTED>
Error: failed to restart machine <REDACTED>: could not stop machine <REDACTED>: failed to restart VM <REDACTED>: failed_precondition: machine still active, refusing to start (Request ID: 01JK4JF4EV6TKFYM73MEN83NMF-syd)

fly machines update <REDACTED> --schedule=daily

Configuration changes to be applied to machine: <REDACTED> (<REDACTED>)

        ... // 25 identical lines
          },
          "image": "registry.fly.io/<REDACTED>",
-         "schedule": "hourly",
+         "schedule": "daily",
          "restart": {
            "policy": "on-failure",
        ... // 3 identical lines
  
? Apply changes? Yes
Updating machine <REDACTED>
No health checks found
Machine <REDACTED> updated successfully!
==> Monitoring health checks
No health checks found

fly machines start <REDACTED>

<REDACTED> has been started