Hosts¶
Hosts are the physical servers, virtual machines, and LXC containers managed by Muppy. They are involved in virtually every Muppy operation that touches a server.
Where to find Hosts¶
Hosts are organized under the Muppy ▸ Hosts menu, which exposes several views of the same mpy.host model:
| Menu entry | What it shows |
|---|---|
| Hosts | Non-production Hosts (every Host whose Qualifier's effective category is not Production, plus Hosts with no Qualifier). Defaults to physical/cloud servers (non-VM). |
| Hosts - Production | Hosts whose Qualifier has Production as its effective category. |
| LXC Containers | Hosts flagged as a VM / LXC container (Is VM/LXC). |
| Provisionning ▸ Enroll Host | Opens the Enrollment Wizard used to create and enroll a new Host. |
Info
The same Host can appear in different lists depending on its Qualifier and whether it is a VM/LXC. The lists are just filtered views — there is a single underlying Host record.
Creation and enrollment¶
Before it can be used with Muppy, a Host must first be created (its connection details are recorded) and then enrolled (Muppy configures it so it is ready to be managed).
The recommended path is the Enrollment Wizard (Hosts ▸ Provisionning ▸ Enroll Host), a 3-step guided flow that checks connectivity, prepares a dedicated control user, and launches enrollment in one go. See Host Creation and Enrollment.
Tip
Hosts can also be imported automatically from a supported Cloud Provider (for example OVH), in which case much of the creation step is filled in for you.
After enrollment¶
Once enrolled, a Host moves to the ==Managed== state and its form view exposes the following tabs:
- Firewall — UFW status, default and custom rules, CIDR dynamic ranges. See Firewall UFW.
- Services — systemd units running on the Host.
- Users — the Linux users Muppy knows about on the Host, with SSH helpers.
- Network — network interfaces, exposed ports, and raw
ip --json addrdata. - Metrics — collected host metrics (disk, partitions, benchmarks).
- System Upgrade — what the Host reports about its own updates, and whether it must reboot. See System Upgrade.
- Lifecycle — auto-decommission scheduling and manual decommission. See Auto-decommission.
A few additional tabs (Notes, Task Runs, and an Advanced tab for technical users) are also available. Notes is written in Markdown; the selector above its editor changes the editor's theme, and this browser remembers the choice for every Markdown editor that offers the selector — Muppy Default for this form gives the form's theme back. The App Definition notes offer the same selector.
System Upgrade¶
The System Upgrade tab shows what the Host reports about its own updates. Muppy reads these values on the Host itself, not from the tasks it ran there.
Click Update System Upgrade State to read them now. Update and Upgrade Packages updates the Host itself: see Updating and upgrading the packages. Reboot, at the top of the form, restarts it: see Rebooting the Host.
Package refresh¶
System Upgrade says whether the Host still refreshes its package lists:
| State | Meaning |
|---|---|
| Not collected | Nobody has read this Host yet, or it has not completed its first refresh. |
| Ok | The last successful refresh is recent. |
| Stale | No successful refresh for more days than Settings ▸ Muppy Core ▸ System Packages ▸ System Upgrade Stale After (days) allows. A retired repository, a severed network or a disabled unattended-upgrades all lead here. |
Reboot¶
Reboot says whether the Host must restart to run what is installed on it:
| State | Meaning |
|---|---|
| Not collected | The reboot state was never read on this Host. |
| Required | Ubuntu asks for a reboot (/var/run/reboot-required), or a newer kernel of the running flavour is installed. |
| Not required | The Host runs the newest installed kernel of its flavour, and nothing asks for a reboot. |
| Undetermined | The Host was read, but its answers do not allow a conclusion: update-notifier-common is not installed, the Host did not say whether it is a container, or no installed kernel compares with the running one, as with a kernel supplied by the hosting provider. |
| Kernel on container host | The Host is a container. It runs its hypervisor's kernel, so a kernel update needs the hypervisor to reboot: check the hypervisor's own Host. |
A container still shows Required when a package inside it asks for a restart.
Below the badge:
- Running Kernel — the kernel in use.
- Newest Installed Kernel — the newest kernel installed in the same flavour (
generic,kvm, …). Kernels of other flavours are not compared. Empty on a container. - Packages Asking a Reboot — the packages that asked for it, each listed once.
- Kernel Booted — when the running kernel started. On a container, this is when its hypervisor booted.
- Reboot State Collected — when Muppy last read these values. An older reading keeps its value until the next one.
When the values change¶
- Update System Upgrade State reads them at once.
- Update and Upgrade Packages reads them again at its end, whether the update succeeded or not.
- Reboot reads them again once the restart is proved.
- The Scheduled Action (CRON) Muppy: Collect all Facts for all Hosts reads them on every enrolled Host once a day, in the background. Follow each run in the Qs menu. A new Muppy instance has it active; on an existing one, check it under Settings ▸ Technical ▸ Automation ▸ Scheduled Actions.
- The reboot Task reads them again once the Host is back up.
- A reboot done outside Muppy — from the provider's console, by restarting a container, over SSH — shows at the next reading.
Finding the Hosts to reboot¶
The Hosts and LXC Containers lists show a Reboot column. The Reboot Required filter keeps only the Hosts that must reboot.
Updating and upgrading the packages¶
Update and Upgrade Packages, beside Update System Upgrade State, updates the packages of the Host:
- It refreshes the package lists (
apt-get update). A third-party repository that no longer answers is passed over; a repository of the distribution that fails stops the update. - It upgrades the installed packages and installs the new packages they need (
apt-get upgrade --with-new-pkgs), so a new kernel is installed. Nothing installed is removed at this step. - It removes the packages nothing needs any more (
apt-get autoremove), older kernels included. Ubuntu keeps the running kernel and the two newest. - It reads the System Upgrade values again, so the tab shows at once what changed.
Muppy asks for a confirmation, then queues the update and runs it in the background. Nothing is announced at the click: when the update starts, a Start processing notification says so, with a button to its message. The Qs menu lists it too.
Services restart during the update
An upgraded package restarts its service. A PostgreSQL server restarts with its package, and what uses it loses its connections meanwhile. On the Host that carries the database of the Muppy instance itself, the restart cuts the worker that runs the update: Muppy loses the task in the middle, and the Host may be left with an interrupted upgrade. Update that Host from its own console.
The Host is not rebooted. When the tab then shows Reboot ▸ Required, click Reboot at a time of your choosing: see Rebooting the Host.
When the update fails, its message says what is in place first, then what failed, then what to do. The values are read again in every case, and the packages upgraded before the failure stay upgraded.
| Failure | What to do |
|---|---|
| apt is busy: another apt or dpkg, unattended-upgrades for instance, holds its lock. The update stops at once, without waiting. | Try again later. |
| dpkg was interrupted: an earlier upgrade stopped half-way. | Run sudo dpkg --configure -a on the Host, then try again. |
| Any other error, such as a repository of the distribution that fails | Read the error in the message. |
A Host that is off or does not answer is not updated: a notification says so, the message ends with the reason, and nothing else happens.
At enrollment, the Launch OS update / upgrade flag of the Server Type runs the same update without new packages (apt-get upgrade). A newly enrolled Host gets a new kernel from this button.
An agent can run the same update through the Muppy MCP: see Updating the packages of a host.
Rebooting the Host¶
Reboot, at the top of the Host's form, restarts the Host from inside and checks that it really restarted:
- It runs
sudo shutdown -r nowon the Host. - It waits until the Host answers over SSH with a new boot identifier. Linux draws a new one at each boot of a server or a VM, and LXC mounts a new one at each start of a container, whatever the clock does: that is the proof of the restart, and an old system that still answers a few seconds after the shutdown is not taken for a new one. The boot time is read too, and shown in the message.
- It reads the System Upgrade values of the restarted Host: the tab shows the new Running Kernel, the new Kernel Booted, and Reboot ▸ Not required when the Host now runs its newest kernel. On a container, both are those of its LXD host, and do not change.
Muppy asks for a confirmation, then queues the reboot and runs it in the background. Nothing is announced at the click: when the reboot starts, a Start processing notification says so, with a button to its message. The Qs menu lists it too. A usual reboot ends in a few minutes.
The services of the Host stop until it is back
Everything the Host serves stops during the reboot, and what depends on it loses its connections. Rebooting the Host that carries the database or the worker of the Muppy instance itself cuts the task in the middle: Muppy loses it. Reboot that Host from its own console.
Reboot restarts a container too, from inside: its services stop in order. Its kernel stays the one of its LXD host, so the reboot installs no kernel there.
A LXD guest may take a new address by DHCP when it restarts. When the guest's LXD host is a Host of this Muppy, and the guest has not answered for about a minute, Muppy reads its address again on the LXD host: a new address becomes the guest's Host IP, and the wait goes on there, within the same time. A Host whose LXD host Muppy does not know keeps the address it had.
On a LXD guest, Restart stands beside Reboot. Restart acts from the LXD host and forces the guest: its processes are killed, as in a power cut. Use it when the guest does not answer over SSH, or to apply a change of its LXD configuration. Use Reboot for every other restart.
When the reboot fails, its message says what is in place first, then what failed, then what to do:
| Failure | What to do |
|---|---|
| The Host answers but did not restart: its boot identifier did not change. | Find out why sudo shutdown -r now had no effect: the sudo rights of the control user, the console of the Host. Then try again. |
| The Host did not answer before the end of the wait: Muppy does not know whether it restarted. | Look at the console of the Host, and check whether it came back under another address: a Host that takes its address by DHCP may get a new one at each boot, and Muppy reaches it only at its Host IP. If so, set the new address there; on a LXD guest whose LXD host is in this Muppy, Muppy has already read it there. Once it answers, click Update System Upgrade State. |
| The Host refuses Muppy's key after the restart. | Put the Muppy key back in the authorized_keys of the control user on the Host. |
The Host is still starting at the end of the wait: its SSH accepts the key, then closes the session, with a banner such as System is booting up. Unprivileged users are not permitted to log in yet. The message ends done, with a warning in its journal that quotes the banner: the restart is not proved. |
Wait for the end of the boot, then click Update System Upgrade State. If the Host stays in that state, look at its console: systemd-user-sessions.service removes /run/nologin at the end of the boot. |
Muppy waits for the Host 170 times, 3 seconds apart, or 5 seconds after a session the Host closed while it was starting. A Host that answers without having restarted ends the message after about 10 minutes; a Host that does not come back, after about 17 minutes. Both take longer when the SSH of the Host answers slowly.
A Host that is off or does not answer is not rebooted: a notification says so, the message ends with the reason, and nothing else happens. When the boot identifier cannot be read on a Host that answers, the message ends with a warning in its journal: the restart is not proved.
While a Host starts, its SSH lets only root log in, until systemd-user-sessions.service has run: it accepts Muppy's key, sends a banner and closes the session. Muppy does not count that as a refused key, and goes on waiting. Each closed session is written to the journal with its banner.
The reboot Task, which enrollment runs when the Server Type asks for it, restarts the Host without checking its boot identifier.
An agent can reboot a Host through the Muppy MCP: see Rebooting a host.
Auto-decommission¶
A Host can carry an Auto-Decommission Date: the date at which Muppy destroys it. It is how a development or test environment comes to an end without anyone having to remember it.
What a decommission destroys¶
A decommission applies to two kinds of Hosts:
| Host | What the decommission destroys |
|---|---|
| A cloud instance Muppy owns (Is Linked), such as an OVH instance | The instance, at its provider — see Commission an Instance |
| A container or a VM Muppy created on an LXD host | The container or VM, deleted on its LXD host |
A decommission runs in three steps. When an App Server is to be deprovisioned, a stopped container is started first: the deprovisioning works over SSH. A stopped container that also carries a Production App Server is never started, since its Production App Server would start with it: nothing is deprovisioned, it keeps its date, and every Muppy Administrator gets a sticky alert listing its App Servers and the two ways out — start it yourself, then decommission it again (its other App Servers are deprovisioned, and the Host and its machine kept), or clear the date with Manage Decommission.
- Each App Server on the Host, except the Production ones, goes through Deprovision Server with five of its six options checked: Remove Systemd Units, Remove Reverse Proxy Apps (its Traefik applications and their DNS records), Remove Code Server (unchecked when a kept Production App Server shares that Code Server), Remove Database (its databases and PostgreSQL roles) and Delete Dev Server object. Deprovision Server stays unchecked: the machine is destroyed once, in the next step.
- The machine is destroyed, as the table above says — unless something still depends on it once the deprovisioning ends: a Production App Server, any App Server still on the Host, a container or VM it now runs, or an App Server of another host now using its PostgreSQL cluster or Traefik server. The Host is then kept, with its machine, and its date is cleared; the task's result says why.
- The Host record is deleted.
The App Servers go first because destroying the machine alone would leave their databases, Traefik applications and DNS records in service. App Server Lifetime gives the same steps from the App Server's side.
The localhost Host is never decommissioned. On a Host that is neither a cloud instance Muppy owns nor a container or VM it created, the date has no effect.
Production¶
A Qualifier is Production when its effective category is Production: the category it is based on, or its own when it is based on none. A Qualifier of category Production based on Staging is not Production; one of category Staging based on Production is. The deletion guard of a Host reads it the same way.
- A Production App Server is never deprovisioned by a decommission. The other App Servers of its Host are deprovisioned on the date all the same; the Host and its machine are kept while a Production App Server remains on it, and the Host's date is cleared; Date Changed By then names the user the decommission ran as. The task's result names the App Servers deprovisioned and the Production ones kept.
- A Host whose own Qualifier is Production is never decommissioned: its Lifecycle tab offers no Decommission Now, the sweep passes it by, the Manage Decommission dialog refuses to date it, and it shows no Days Left capsule.
- A Production Host that carries a date is an error to correct, and Muppy says so: every Muppy Administrator gets a sticky error notification, with a button opening the Host, asking to clear the date with Manage Decommission, and to change the qualifier only after: a Host past its date is decommissioned at the next sweep once it is no longer Production. It goes when the sweep finds the Host due — once per date, again when the date or the qualifier changes — and each time someone tries Decommission Now on it, or opens Manage Decommission on it without being allowed to clear the date, naming who. The date shows on the Host's Lifecycle tab, where Manage Decommission lets a Muppy user clear it — the one gesture it offers on such a Host.
A Host that still runs containers or VMs — an LXD host that is itself a cloud instance Muppy owns — is refused until they are gone: decommission its containers and VMs first, since destroying the Host would destroy them and leave the databases, Traefik applications and DNS records of their App Servers in service. A Host whose PostgreSQL cluster or Traefik server serves App Servers placed on other Hosts is refused the same way, naming them: deleting the Host would delete that cluster or Traefik server, and those App Servers' databases or routing with it — move them first.
A decommission cannot be undone
The machine, and the databases and DNS records of every App Server deprovisioned, are destroyed. Back up first anything you want to keep.
The default date¶
The date is set when the Host is created, from the Qualifier of the App Server it is created for:
| Qualifier category | Default Auto-Decommission Date |
|---|---|
| Development, Test | Today plus the default horizon — 30 days unless your administrator changes it |
| Any other (Staging, Demonstration, Production, …) | None: the Host is kept until someone dates it |
The category read is the Qualifier's effective one: a Qualifier based on another category counts as that category — Demo counts as Staging.
The Create App Server wizard shows the date its qualifier proposes, and proposes it again each time the qualifier changes. A Muppy user may change it or clear it; a Manganese user reads the date the qualifier gives. Through the MCP, mgx_create_app_server takes an optional decommission_date and applies the qualifier's date when none is given.
The date lands on the container the creation provisions. An App Server placed on an existing Host leaves that Host's date as it is. A Production Qualifier takes no date: the Create App Server wizard hides it, and a date given with one is refused before anything is created — by the App Server creation, mgx_create_app_server included, and by the LXC Create form and lxc_commission.
The default horizon¶
Settings ▸ Muppy Core ▸ Auto-Decommission ▸ Default Horizon (days) sets the horizon, 30 days by default. It is also the step of Schedule and Extend, two gestures of the Manage Decommission dialog (see Changing the date). A change applies to the Hosts created afterwards: the dates already set stay as they are.
Changing the date¶
The Manage Decommission button opens a dialog on the Host. It sits on the Lifecycle tab of the Host form, and in the header of the App Server form — the Muppy form and the Manganese form alike — where it opens the dialog on the Host the App Server runs on. The dialog offers four gestures:
| Gesture | What it does |
|---|---|
| Schedule | Offered when the Host has no date: dates it the default horizon from now |
| Extend | Pushes the date by the default horizon, from the current date — or from now when the current date has passed |
| Set Date | Gives the Host the New Date chosen, which must be in the future |
| Clear | Removes the date: the Host is kept until someone dates it again |
A Muppy user changes the date of any Host Muppy may decommission, with no limit, and may clear it. A Manganese user is bound by a ceiling and clears the date only when an administrator allows it — see App Server Lifetime.
The Host records who changed the date and when: Date Changed By and Date Changed At, on its Lifecycle tab, under the date. Both stay empty while the date is the one the Host received at its creation.
Changing the Qualifier of an App Server does not change the date of its Host: the date is decided once, at creation. The App Server form warns about it when the Qualifier changes; moved to Production, it adds that the App Server is never deprovisioned by that date, and that the Host is kept while a Production App Server remains on it.
Days Left¶
A dated Host, unless its Qualifier is Production, shows a Days Left capsule beside its date on the Lifecycle tab, and as a column of the Hosts and LXC lists. App Servers show the capsule of their Host, under their Qualifier and in their lists. It reads 12 days beyond the last 24 hours, 7 h within them, < 1 h in the last hour, and Due once the date is reached; both counts round up.
| Colour | When |
|---|---|
| Green | More time left than the first reminder's delay — 7 days by default |
| Orange | Between the first and the last reminder's delays |
| Red | Within the last reminder's delay — 1 day by default — and once the date is reached |
Reminders¶
Muppy emails two reminders before a Host's date, at the delays set in Settings ▸ Muppy Core ▸ Auto-Decommission:
| Setting | Default | Also sets |
|---|---|---|
| First Reminder (days before) | 7 | The end of the green capsule |
| Last Reminder (days before) | 1 | The start of the red capsule |
The last delay must be below the first; the settings refuse it otherwise.
| Host | Recipient |
|---|---|
| Carries App Servers | Each App Server's Owner, one email per App Server, naming it — never the owner of a Production App Server. While a Production App Server remains on the Host, the email says the Host and its machine are kept |
| Carries none — a container created on its own | The user who created the Host |
The email gives the date in the recipient's timezone, the time left, what is destroyed on that date, a link to the record, and how to keep it longer: the Manage Decommission button, or, for a Manganese user whose date has reached the ceiling, their Manganese admin or a Muppy administrator. A recipient with no email address is skipped, and the skip is logged. The emails go through the mail queue.
Each reminder goes once per date. Any change of the date — through the dialog, a script or a creation path — re-arms both, so an extended Host gets its reminders again. A Host dated closer than the last delay gets only the last reminder; a Host whose date is past gets none. The Host shows when each was sent: First Reminder Sent At and Last Reminder Sent At, on its Lifecycle tab.
The scheduled action Muppy: Auto-Decommission Reminders checks every hour for the reminders that are due and queues them as a task, tracked under Muppy ▸ Tasks: a reminder goes within the hour its delay is reached, whatever the hour of the date. None is sent while Muppy: Auto-Decommission due Hosts is disabled: without the sweep, nothing is destroyed on the date. Enabling the sweep enables the reminders. The reminders follow the sweep's Active flag alone: a sweep whose code runs in dry run (dry_run=True, which only logs the due Hosts) counts as enabled, so the reminders go while nothing is destroyed.
Changing the email¶
The email is the template Muppy: Auto-Decommission Reminder, under Settings ▸ Technical ▸ Email ▸ Templates (with developer mode on). Muppy ships it and keeps it up to date: an edit made there is replaced at the next upgrade of Muppy, so change the wording in the template file Muppy ships rather than in the screen. The parts that vary — the subject, the list of what is destroyed, the note when the Host is kept — are composed by Muppy and passed to the template, which only lays them out.
The sweep¶
The scheduled action Muppy: Auto-Decommission due Hosts runs every hour and decommissions every Host whose date has passed, each one in its own task, tracked under Muppy ▸ Tasks. It is disabled by default: an administrator enables it under Settings ▸ Technical ▸ Scheduled Actions. Until then the date records an intent, and Decommission Now acts at once: it sits on the Lifecycle tab of the Host form of every Host Muppy may decommission — a cloud instance Muppy owns, or a container or VM Muppy created on an LXD host.
The dashboard tile Hosts Pending Deprovision lists every dated Host, the nearest date first, with its Qualifier: a Production Qualifier shows in red, since such a Host is never decommissioned and its date is one to clear.






