Skip to content

Automation: recipes, blueprints and scheduler

PxVault saves you from repeating the same steps by hand. This page covers three complementary tools:

  • recipes: post-installation scripts (sequences of commands) run inside your VMs and containers;
  • blueprints: ready-to-use profiles (OS, size, network, recipes) to create a machine in one click;
  • the scheduler: recurring scheduled tasks (snapshots, backups, recipes, power, cleanup) and automatic expiry of ephemeral machines.

All three are in the side menu: Recipes, Blueprints and Scheduler. Access to them depends on your permissions (see Users and access).

Recipes (post-installation scripts)

A recipe is an ordered list of steps. Each step has a name and a command:

  • Linux recipe: sh commands, on KVM VMs and LXC containers;
  • Windows recipe: PowerShell commands, on Windows VMs.

How the command reaches the machine:

Machine Channel used
Linux VM (KVM) QEMU guest agent (qemu-guest-agent), output and exit code captured
Windows VM (KVM) QEMU guest agent, PowerShell, output and exit code captured
LXC container pct exec over SSH on the node if the hypervisor is SSH-enrolled, otherwise the Proxmox console (exit code only)

Important: on a VM, the QEMU guest agent must be installed and running, otherwise the recipe cannot run.

Browse the recipe catalog

The Recipes page shows your recipes as cards. PxVault ships with built-in recipes (web server, Docker, monitoring, UFW firewall, etc.).

  • Filter by family with All, Linux or Windows.
  • Type in Search recipes…: the search covers the name, the description, the tags and even the content of the commands.
  • Click a tag to keep only the recipes that carry it (clear tags to return to the full list).

The ⋯ menu at the top right offers:

Action Effect
Restore built-ins Recreates the built-in recipes you may have deleted
Export to JSON Downloads all recipes to a recipes-AAAA-MM-JJ.json file
Import from JSON Imports an exported file (or a plain array of recipes)
External catalogs Manages remote recipe sources (see below)

Create a recipe

  1. Click New recipe.

  2. Fill in the fields:

    Field Purpose
    Name Required, e.g. "Web Server (nginx)"
    OS family Linux (sh - KVM + LXC) or Windows (PowerShell)
    Description What the recipe does
    Tags Type a word then Enter; used for filtering
  3. In Steps, for each step enter a name (e.g. "Install nginx") and the command (e.g. apt-get install -y nginx). Click Add step to add more; drag steps to reorder them.

  4. Check Continue even if this step fails for a non-blocking step. Without this box, a failure stops the recipe.

  5. Click Create recipe.

A step is interrupted if it exceeds the Recipe Step Timeout (600 seconds by default), which can be set in Settings > System > Advanced Timeouts (see Settings and maintenance).

To edit a recipe, open its card then Save changes. To delete several, check them then Delete selected; the run history is kept.

Add parameters to a recipe

Parameters make a recipe reusable: the value is asked for when the recipe is applied and replaces {{nom}} in the commands.

  1. In the Parameters section, click Add parameter.
  2. Enter the variable name (letters, digits and _, starting with a letter), a label (e.g. "Domain name"), the type (String, Number, Password, Boolean), an optional default value and placeholder text, and check Required if needed.
  3. Use it in a command, for example:
echo "server_name {{domain}};" > /etc/nginx/conf.d/site.conf

Built-in variables are always available: {{vmid}}, {{vmName}}, {{ip}} (the primary IP address PxVault knows for the machine, empty if it does not have one yet), {{node}}, {{hypervisorName}}.

Default values, required parameters and passwords

  • The default value applies everywhere, not only in the form: a recipe run through the API, by a blueprint, by a scheduled task or at machine creation receives the default value of every parameter it was not given. An optional parameter with no value and no default is replaced by an empty string, never by the text {{nom}}.
  • A required parameter with no value and no default blocks the run before it starts: applying the recipe, creating the machine or saving the scheduled task is rejected with a message that names the missing parameter.
  • Text between {{ }} that is neither a declared parameter nor a built-in variable is left as is (useful for Jinja, Helm or docker --format templates).
  • The default value of a Password parameter is encrypted in the database and is never shown again: the form shows ********. Leave ******** to keep it, or type a new value to replace it. Export to JSON does not include it (it could not be decrypted on another instance): enter it again after an import.
  • In the history, secret values are replaced by ********: Password parameters, values stored encrypted (scheduled task, blueprint) and parameters whose name suggests a secret (password, token, secret, api_key…).

Tip: give a default value to the parameters of recipes you plan to schedule or include in a blueprint: these two screens do not ask for parameters.

Run a recipe automatically at creation

Check Run automatically when a machine is created: the recipe will run on every new machine of the same OS family. You can restrict it to certain templates by checking them; leave everything unchecked to apply it to all new machines of that family. The card then shows the auto badge. See also Create machines.

Apply a recipe to machines

  1. On the recipe's card, click Apply. For several recipes at once, check them then click Run selected.
  2. Fill in any parameters (required fields must be filled in).
  3. Choose the machines from the list. Only machines of the right OS family are targeted by each recipe.
  4. Click Apply (or Run for several recipes).

Limits: 100 machines and 20 recipes at most per run. Everything runs in the background; if some runs cannot start, the window lists them one by one.

Warning: if even one of the selected machines is outside your access scope, the whole request is rejected.

Track the run history

The History tab of the Recipes page lists each run, most recent first and page by page: recipe → machine, hypervisor, time and status. The Search a recipe, a machine or a VMID... field and the All statuses filter cover the whole history, not only the displayed page. Click a row to see, step by step, the command, the exit code (exit N), the duration and the captured output. A partial status means a non-blocking step failed; failed means a blocking step stopped the recipe.

Use external catalogs

⋯ > External catalogs lets you add a URL that serves recipes in the export format ({ recipes: [...] }). Enter a Name and the URL, then Add. Sync imports the new recipes; those that already exist (same name) are skipped.

Blueprints (creation profiles)

A blueprint is a reusable provisioning profile: OS or template, CPU, RAM, disk, network and recipes to run at launch. It creates nothing until you launch it.

Create a blueprint

  1. On the Blueprints page, click New blueprint (or Import built-ins to get the provided examples).
  2. Fill in Name, Icon, Description, then Type: KVM (virtual machine) or LXC (container).
  3. Choose the Template or the Operating System, then CPU (vCPU), RAM (MB) and Disk (GB).
  4. Optional: Bridge (e.g. vmbr0) and IP mode: Auto (IPAM) or Manual. For a Windows system (KVM type), Screen resolution sets the console resolution of the machines launched (see Create a VM › Windows VM).
  5. Check the Recipes to run on launch and add Tags.
  6. Click Create blueprint.

Editing or deleting a blueprint does not affect machines already created with it.

Launch a blueprint

  1. On the blueprint's card, click Launch.
  2. Hypervisor: leave Auto (least loaded) or choose one.
  3. Name: optional, generated automatically if empty.
  4. Auto-expiry (TTL): Keep (no expiry), 1 hour, 24 hours or 7 days. When it expires, the machine is stopped (not deleted).
  5. Adjust CPU, RAM and disk if needed; an empty field uses the blueprint's value.
  6. Click Launch. The usual creation summary appears (VMID, IP, credentials, progress).

The scheduler (scheduled tasks)

The Scheduler page has three tabs: Tasks, Ephemeral VMs and History.

Schedule a task

  1. Click New task.

  2. Give it a Name and choose the Type:

    Type What it does Options
    Snapshot (snapshot) Takes a Proxmox snapshot then deletes the oldest ones Snapshot prefix (auto by default), Keep (most recent) (5 by default, 1 to 50)
    Backup (backup) Runs a vzdump backup Mode (Snapshot, Suspend, Stop), Compression (zstd, gzip, lzo, none), Storage (optional), Keep (most recent) (applied only if a storage is specified)
    Recipe (recipe) Runs a recipe on each target the Recipe to run
    Power (power) Starts, stops or restarts Power action: Start, Stop, Restart
    Cleanup (cleanup) Deletes machines older than N days Delete machines older than (days) (7 by default)
  3. In Schedule, click a shortcut (e.g. "Every day at 02:00", "Every 15 minutes") or type a 5-field cron expression. The plain-language translation is shown below it.

  4. In Targets, choose All machines or Specific machines (then check them).

  5. Leave Enabled (runs automatically on schedule) checked and click Create.

Important: times are in UTC. 0 2 * * * runs at 02:00 UTC, which is 04:00 in Paris in summer time and 03:00 in winter.

Good to know: a Snapshot or Backup task waits for the Proxmox task to finish on each machine before moving to the next one. A snapshot or backup that fails on the hypervisor (full storage, locked machine…) therefore counts as a failure in the run status, and old snapshots or archives are only deleted once the new one has finished. On many machines, a Backup task therefore lasts as long as the backups themselves.

Warning: a Cleanup task on All machines deletes every unprotected machine older than the specified delay. Target specific machines. Protected machines are never deleted, nor is a machine whose creation date is unknown.

Cron reminder: minute heure jour-du-mois mois jour-de-semaine (minute, hour, day of month, month, day of week). Examples: 0 * * * * (every hour), 0 8 * * 1-5 (08:00 on weekdays), */15 * * * * (every 15 minutes). Each field is numeric (value, range 1-5, list 1,15, step */15): day or month names (MON, JAN) are not supported, and an expression the scheduler cannot evaluate is rejected when you save.

Manage scheduled tasks

Each task in the Tasks tab shows its type, its schedule, its targets, the next run (next …) and its last status (never run at first). Available buttons: Run now, Disable / Enable, Edit, Delete (past history is kept).

The History tab lists runs, page by page: success, partial (some targets failed) or failed. The Search a task or a message... field and the status filter cover the whole history. In the Tasks tab, Search a task... filters the cards by name.

Scope restriction: "All machines"

If your account is limited to certain hypervisors or machines, you cannot use the fleet-wide All machines targeting: the request is rejected and you must choose Specific machines. A single target outside your scope gets the whole task rejected. Global tasks created by an administrator are not visible to you. See Users and access.

Create a power schedule (presets)

The Power schedule button creates a stop + start task pair in one go to save resources:

Preset Stop Start
Off for the weekend Friday 20:00 Monday 08:00
Off every night (weekdays) 20:00 Monday to Friday 08:00 Monday to Friday
Off nights & weekends 20:00 every day 08:00 on weekdays
  1. Choose the Preset and a Name prefix (e.g. "Dev VMs").
  2. In Target machines, check machines or All machines.
  3. Click Create schedule. The two tasks appear in the Tasks tab (UTC times).

Set an automatic expiry (ephemeral VMs)

Ideal for labs, demos and CI: the machine is stopped or deleted after a delay.

  1. Click Auto-expiry (or Add expiry in the Ephemeral VMs tab).
  2. Choose the Machine, then Expires in: 1 hour, 6 hours, 24 hours, 3 days, 7 days or 30 days.
  3. Then: Delete (the default) or Stop.
  4. Add a Note (optional) then Set expiry.

Warning: by default the action is Delete: the machine is destroyed when it expires. Choose Stop if you only want to power it off.

A protected machine is never deleted when it expires, whether the protection was set in PxVault or directly in Proxmox: the expiry is set aside (vm.ttl.expired, protected in the audit log) and is not retried; set it again once the protection is removed. A Stop expiry that finds the machine already powered off is simply considered done.

The Ephemeral VMs tab lists pending expiries, soonest first and page by page, with the time remaining (overdue if the deadline has passed). Find a machine with Search by name or VMID..., or keep only the Delete or Stop ones. Cancel removes the expiry without touching the machine. Setting an expiry again on the same machine replaces the previous one.

An expiry never follows another machine

A VM number (VMID) is reused by later creations. So that an expiry never hits the wrong machine:

  • Deleting a machine removes its expiry (and removes it from scheduled task targets; a task with no targets left is disabled, not deleted). This is also the case when a machine disappears from Proxmox without going through PxVault.
  • An expiry is tied to the machine's name at the time it is set. When it expires, if that VMID belongs to another machine, nothing is stopped or deleted: the expiry is set aside and the audit log says so (vm.ttl.expired, identity_mismatch). Renaming the machine from PxVault updates this link; after a rename done directly in Proxmox, set the expiry again.

Automation scripts (server side)

Not to be confused with recipes: the Automation page runs bash scripts on the PxVault server, not in your machines, when an event occurs (e.g. VM Creation Success, VM Stopped, User Created).

  1. Click Add Script, give a Script Name and choose the Trigger Event.
  2. Write the Script Content (Bash) or start from an example (Load from example...: Discord webhook, Slack notification, SMTP email…).
  3. Use the environment variables listed on screen ($EVENT_NAME, $EVENT_PAYLOAD, $VM_ID, $VM_NAME, $VM_IP, $HYPERVISOR_NAME…).
  4. Leave Enabled checked and click Save Script.