# Maintenance by the CloudAMQP team

CloudAMQP keeps all software on your servers up to date with security patches and updates that can be installed without affecting the availability of your service. However, some updates require the service, or the whole server, to be restarted. That is why CloudAMQP has scheduled maintenance to ensure our customers always have the latest security updates regardless of their operating system and setup.

CloudAMQP handles these scheduled maintenance upgrades, and customers do not have to take any actions. Log into your CloudAMQP console and navigate to the maintenance settings. ![maintenance schedule](/img/docs/maintenance/scheduled-maintenances.png)Here you can view both upcoming maintenance and previous maintenance history. You can also adjust the time of the scheduled maintenance.

Customers notify when the instance is scheduled for reboot; this notification includes a time frame of the reboot, with an option to reschedule within the maintenance window. Notifications are sent to the recipients of the [Notice Alarm](/docs/cloudamqp-alarms/#notice) under the Alarm settings. We recommend adding a Notice Alarm trigger from the CloudAMQP console to keep track of important events.

![CloudAMQP Notice Alarm](/img/docs/maintenance/notice-alarm.png)

## Preferred maintenance window

By selecting a preferred maintenance window, you can choose when your maintenance will occur. Maintenance windows are 3 hours long, and CloudAMQP will attempt to start the maintenance as close to the beginning of that window as possible.

![maintenance schedule](/img/docs/maintenance/maintenance-settings.png)

| Day | Choose the day of the week that you prefer. |
| Time | Set preferred maintenance start time. Time zone: UTC |

## Automatic version updates

LavinMQ instances have automatic version updates enabled by default. When a new LavinMQ version is made available on CloudAMQP, instances running an older version get a maintenance scheduled to update them, and you are notified.

### When the update happens

The update is scheduled to start between one and two weeks after you are notified. If you have set a [preferred maintenance window](/docs/cloudamqp-maintenance/#preferred-maintenance-window), the update is placed in it.

### Which version is installed

Each update targets the newest release series, such as 2.10 or 3.0, available when the maintenance was scheduled. This includes new major versions. When the maintenance runs, the latest patch release of that series is installed, to include any fixes released since the maintenance was scheduled.

A newer release series that comes out in the meantime is not included. While an update is pending, no other update is scheduled for the instance. Once it has completed, a new maintenance is scheduled if a newer version is available. For example:

1. LavinMQ 2.10.3 is made available. Your instance on 2.10.2 gets an update to 2.10 scheduled.
2. A few days later, LavinMQ 2.11.0 is made available. Your instance already has an update pending, so nothing changes.
3. The maintenance runs and installs 2.10.3, the latest 2.10 patch release.
4. A new maintenance is scheduled to update your instance to 2.11.

### Updating manually

You can update LavinMQ yourself at any time from the Nodes page in the CloudAMQP console. Doing so cancels any pending automatic update for the instance.

### What happens during the update

Nodes are updated one at a time, and LavinMQ restarts on each node as it is updated. Clients can be briefly disconnected during the restart, so make sure they reconnect automatically. On clusters with three or more nodes, a node is only updated once replication between the nodes is in sync.

### Turning automatic updates off

You can turn automatic updates off, or back on, in the maintenance settings in the CloudAMQP console, with the [Instance API](https://docs.cloudamqp.com/cloudamqp_api.html#maintenance-settings), or with the `automatic_updates` argument of the `cloudamqp_maintenance_window` Terraform resource.

![automatic updates](/img/docs/maintenance/automatic-updates.png)

RabbitMQ instances will have the ability to opt-in to automatic updates in the future.
