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.
pelmo$ ohm instance list --server pelmo$ sudo ohm instance info --instance fanespelmo$ ohm instance size --instance fanesStarting and stopping
pelmo$ ohm instance container start --instance fanespelmo$ ohm instance container stop --instance fanespelmo$ ohm instance container restart --instance fanesWhile 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.
$ sudo ohm instance container shell --instance fanesThe 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.
pelmo$ ohm instance image build --instance fanespelmo$ ohm instance image list --instance fanespelmo$ ohm instance image activate --instance fanesPulling 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:
pelmo$ ohm instance nginx config rebuild --instance fanesRepair
pelmo$ ohm instance repair filesystem --instance fanesRepair 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
pelmo$ ohm instance remove --instance fanesThe 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:
pelmo$ ohm instance remove --instance fanes --confirm ohm-7db76c35291fA 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:
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.
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:
| What | Where | For how long |
|---|---|---|
| The instance's backup archives on the server | The 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 targets | Where its targets wrote them | As 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>.json | Until 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.