Skip to main content

Running and removing instances

Listing and inspecting​

An instance's own page carries its state, its host names, its containers and the actions that act on them.

Remote or localagainst pelmo
$ ohm instance list --server pelmo
Local only
$ sudo ohm instance info --instance fanes
Remote or localagainst pelmo
$ ohm instance size --instance fanes

Starting and stopping​

Remote or localagainst pelmo
$ ohm instance container start --instance fanes
Remote or localagainst pelmo
$ ohm instance container stop --instance fanes
Remote or localagainst pelmo
$ ohm instance container restart --instance fanes

While as many instances run as the license allows, starting another one is refused. Restarting an instance that runs never is. An instance the license stopped because a lower license allows fewer says so on its page, and starts again by itself when a license allows it; see When the license changes.

A shell inside the instance container, for when you need Odoo's own tooling. It has no remote form - an interactive terminal is not something a queued job can hand back - so it runs on the server, and it is never license-restricted. No server is locked out of its own containers from its own shell.

Local only
$ sudo ohm instance container shell --instance fanes

The console opens the same shell in a browser, from the instance's page, and that convenience is what carries an edition:

Images​

Each instance runs an image built for its Odoo version. You can rebuild it, list what exists and switch which one the instance uses. The console's Images page shows every image on the server at once, which is the view that explains a disk filling up. An image's Size counts every layer it uses, the Odoo base it shares with other images included; its Own size is what deleting it alone frees. The line beside the buttons gives what the images really take on disk, each layer counted once, and what Clean up would free.

Remote or localagainst pelmo
$ ohm instance image build --instance fanes
Remote or localagainst pelmo
$ ohm instance image list --instance fanes
Remote or localagainst pelmo
$ ohm instance image activate --instance fanes
A corrupt local image layer does not repair itself

Pulling again reuses the existing blob. If an image is damaged, remove the image and prune the builder cache before pulling, or the same broken layer comes straight back.

nginx​

The instance's nginx site is generated from its configuration. If the site and the configuration have drifted, rebuild it:

Remote or localagainst pelmo
$ ohm instance nginx config rebuild --instance fanes

Repair​

Remote or localagainst pelmo
$ ohm instance repair filesystem --instance fanes

Repair fixes the instance's directory tree and permissions. It is the right first move when an instance runs but cannot write, and the wrong move for anything database-shaped.

For everything else that goes quietly wrong - a report address, a web address, a stopped container, a drifted site, a certificate, a missing package - the instance's Health tab has a report and an auto repair. See Instance health.

Removing​

Remote or localagainst pelmo
$ ohm instance remove --instance fanes

The command asks you to type the instance's exact name (ohm- and its id, as the prompt shows it) before it removes anything. A script, a scheduled task or anything else without a terminal gives the name with --confirm instead:

Remote or localagainst pelmo
$ ohm instance remove --instance fanes --confirm ohm-7db76c35291f

A name that does not match exactly, capitals included, refuses the removal, and without a terminal and without --confirm the command refuses at once and says to pass it.

The instance's stored configuration goes with it, as it does in the console. To keep it, add --keep-config:

Remote or localagainst pelmo
$ ohm instance remove --instance fanes --keep-config

--delete-config, the way to ask for this in earlier releases, is still accepted for one release and does nothing.

Removal drops the instance's databases

Removing an instance removes its container, its data tree - the filestore, add-ons and logs included - and the databases it owns. Take a backup first, and be certain the instance's active database is the one you think it is - see the import warning in Configuration.

In the console, the delete button among the instance's buttons opens Delete instance, which says what goes and deletes only once the instance id is typed.

What is kept, and how to get the instance back​

The data tree is deleted, not archived. What survives a removal on a server:

WhatWhereFor how long
The instance's backup archives on the serverThe backup directory, /var/lib/odoo/backup/<id>/Until you delete them: no backup of the instance runs any more, so nothing rotates them away
Its archives at off-site targetsWhere its targets wrote themAs the target's own retention decides; a container Backup storage bound to it is retired with its data
Its configuration, as a JSON file, when you chose to keep it/var/lib/odoo/instances/conf/ohm-<id>.jsonUntil you delete it. The command deletes it unless you pass --keep-config; Delete instance in the console deletes it unless you switch Also permanently delete the stored configuration off

To bring the instance back, restore its newest archive as a new instance with the Production preset: Restore from backup on the Instances page, with Use an archive already on the server and the archive's path, or ohm instance import --archive <path> --preset prod. See Restoring. A configuration file alone brings the instance back without its databases.

On a developer workstation a removal deletes the instance's local backup archives too.