.. _guests:

Guests
======

The "Guests" entry in the sidebar provides a single, cross-remote view of every
QEMU virtual machine and LXC container that Proxmox Datacenter Manager knows
about. It collects the guests of all configured Proxmox VE remotes into one
list, so the whole fleet can be searched, sorted, and acted on without first
navigating to the owning remote.

It covers the most common day-to-day tasks, including the power actions for
single guests and for many guests at once, and snapshot management.

.. image:: images/screenshots/guests-list.png
  :target: _images/guests-list.png
  :align: center
  :width: 800px
  :alt: The cross-remote guest list in flat (list) view

List and Tree View
------------------

A toggle in the toolbar switches between two presentations of the same data:

* **List**: a flat, sortable table of all guests. This is the default. It shows
  the guest name, ID, status, a column of per-guest actions, remote, node, tags,
  CPU usage, memory usage, and uptime. Click a column header to sort by it,
  including by CPU or memory usage.
* **Tree**: the guests grouped by remote, each remote a collapsible parent with
  its guest count. A filter hides the remotes without matching guests, and the
  counts then cover only the matching guests. The columns are the same except
  that the remote is implied by the group, so it is not repeated per row;
  sorting is available on the usage columns ("CPU Usage", "Memory Usage", and
  "Disk Usage").

Further columns for the HA state, the pool, and the disk usage can be shown
through the "Columns" entry in the menu of any column header. The CPU and memory
usage columns are empty for guests without uptime, such as stopped guests and
templates, and Proxmox VE reports the disk usage only for running containers.

Filtering
---------

The "Filter" box narrows the list as you type. A bare word matches as a
substring of the name, ID, status, type, node, remote, or tags of a guest.

A term of the form ``category:value`` matches a single property instead, with
the categories of the :ref:`search in the header <resource_search>`. The most
useful ones for guests are:

* ``tag:`` -- a guest tag
* ``remote:`` -- the remote name
* ``node:`` -- the node name
* ``pool:`` -- the pool of the guest
* ``status:`` -- the run status, such as ``running`` or ``stopped``
* ``type:`` -- the guest type, ``qemu`` or ``lxc``
* ``lock:`` -- the config lock, such as ``backup`` or ``migrate``
* ``ha:`` -- the HA state, such as ``started`` or ``error``

Multiple terms are separated by spaces and must all match, so
``tag:prod status:running`` matches only running guests that carry the ``prod``
tag. Unlike in the search in the header, the terms need no ``+`` prefix for
this. Matching is case-insensitive.

Bulk Actions
------------

You can start, shut down, hibernate, or migrate many guests at once across a
Proxmox VE remote using Proxmox VE's cluster-wide bulk actions (requires
``pve-manager 9.0.13`` or newer on the remote; ``Parallel Jobs`` requires
``9.1.2`` or newer). Each remote handles its selected guests in a single
task, so startup order and shutdown delays apply across all nodes of the
remote.

Open the "Bulk Actions" menu from any of four places and choose **Bulk
Start**, **Bulk Shutdown**, **Bulk Hibernate**, or **Bulk Migrate** (an action
is disabled if you do not hold the required privilege on any eligible guest in
scope):

* In the **Guests** page toolbar (both List and Tree view): acts on the fleet
  across all Proxmox VE remotes. **Bulk Migrate** requires selecting a remote
  first when multiple remotes exist.
* On the **Datacenter** root row in a remote's resource tree: acts across all
  nodes of that remote. **Bulk Migrate** is disabled when the remote has fewer
  than two nodes.
* On a **node** row in a remote's resource tree: acts on the guests of that
  node and excludes the node itself from **Target Node** for migration. The
  menu is disabled when the remote reports the node offline.
* In the toolbar at the top of a **view**: acts on the Proxmox VE guests shown
  by that view, limited to guests for which you hold the required privilege
  (``Resource.Manage``, or ``Resource.Migrate`` for migration). The menu is
  disabled when the view has no guests you may act on.

The dialog opens with no guests selected so you can narrow and check the
intended targets inside it:

#. Set the options for the action:

   * **All actions**: **Parallel Jobs** (``1`` to ``64``).
   * **Bulk Shutdown**: **Force Stop** (checked by default) and **Timeout (s)**.
   * **Bulk Migrate**: **Remote** (when multiple remotes exist), **Target Node**
     (showing node CPU and memory usage), and **Allow local disk migration**
     (checked by default).

#. Use the collapsible **Filters** panel to narrow the list by guest name,
   status, type, remote, node, pool, HA status, **Include Tags** (match any
   listed tag), or **Exclude Tags** (match none of them); separate tags with
   semicolons, commas, or spaces.

   * Start defaults to ``Stopped``, Shutdown to ``Running``, and Hibernate to
     ``Running`` virtual machines.
   * Migrate starts without a target node and leaves all statuses and types
     unfiltered; guests already on the chosen target node are hidden with a
     notice above the list.
   * **Clear Filters** resets the filter fields without clearing the chosen
     target remote or node.

#. Check the guests to act on. The header checkbox selects all currently visible
   rows, and changing filters removes newly hidden guests from the selection.
#. Click **Start**, **Shutdown**, **Hibernate**, or **Migrate**. Shutdown,
   Hibernate, and Migrate ask for confirmation before submitting: Shutdown notes
   whether guests still running after the timeout are stopped or stay running,
   and Migrate notes when running containers are selected.

After submitting a single-remote action, the dialog closes and opens the task
progress viewer directly when you hold ``Resource.Audit`` on the remote;
otherwise, and when submitting for multiple remotes, it lists the task started
on each remote (with a "Show Log" button) or any error if a request failed (for
example on a remote with ``pve-manager`` older than ``9.0.13``). The lists
follow state changes after up to about half a minute, as Proxmox VE reports
guest states every ten seconds and Proxmox Datacenter Manager caches them for
thirty.

On the remote, the cluster-wide bulk actions do the following:

* **Bulk Start**: start the guests, also those not set to start at boot, in the
  order and with the delays of their startup settings. Paused virtual machines
  are resumed, while virtual machines running in any other state are skipped;
  for an already running container the task reports an error while still
  handling the remaining guests.
* **Bulk Shutdown**: shut down the guests in the reverse order of their startup
  settings. **Force Stop** is checked by default, matching Proxmox VE. When
  enabled, guests that do not shut down within the timeout are stopped forcibly,
  and paused virtual machines are stopped immediately. When disabled, timed-out
  guests stay running and paused virtual machines are skipped. The timeout
  applies to guests without a shutdown timeout in their startup settings and
  defaults to 180 seconds. Guests managed by HA are shut down through HA, which
  ignores **Force Stop**: it stops virtual machines that do not shut down in
  time, but not containers.
* **Bulk Hibernate**: save the memory of running virtual machines to disk and
  stop them, like Hibernate does for a single guest. Containers, templates, and
  non-running guests are excluded, and Proxmox VE refuses to hibernate virtual
  machines managed by HA.
* **Bulk Migrate**: live-migrate running virtual machines (or restart-migrate
  running containers) and move stopped guests and templates to the chosen
  target node, respecting **Allow local disk migration** for local storage.

"Parallel Jobs" sets how many guests the remote handles at the same time; if
empty, the remote uses its own default.

On the command line, use ``proxmox-datacenter-manager-client pve bulk`` with
``start``, ``shutdown``, ``hibernate``, or ``migrate``:

* **Selecting guests**: Pass guest IDs directly (for example
  ``pve bulk shutdown <remote> 100 101``), or pass ``--tag <tag>`` for an exact,
  case-insensitive tag match. Explicit IDs go straight to the remote API without
  requiring ``Resource.Audit`` on the remote, leaving template and state
  filtering to Proxmox VE. With ``--tag``, templates are omitted for start,
  shutdown, and hibernation, containers are omitted for hibernation, matching
  guests are printed, and confirmation is requested on a terminal.
* **Defaults**: ``shutdown`` defaults ``--force-stop`` to ``true`` (pass
  ``--force-stop false`` to leave timed-out guests running). ``migrate --target
  <node>`` defaults ``--online`` to ``true``, matching the web interface, while
  ``--with-local-disks`` follows Proxmox VE's default.
* **Output**: Each command starts the cluster-wide remote task and waits for it
  to finish, or prints the task UPID and exits if you lack ``Resource.Audit`` on
  the remote.

The bulk action API passes the guests to the remote as the caller chooses them,
without skipping any. A caller of the API must therefore omit guests it does not
want acted on, such as running containers or paused virtual machines.

Guest Actions
-------------

Each row offers the common life-cycle operations for its guest. The first icon
is the power action that fits the status of the guest:

* **Start**: power on a stopped guest.
* **Resume**: continue a QEMU virtual machine in a paused, suspended, or
  prelaunch state.
* **Shutdown**: gracefully shut down a running guest.
* **Stop**: stop a guest in any other state immediately, for example a failed
  one, see below.

Templates have no power actions. The other icons are:

* **Migrate**: migrate the guest to another node, within the same remote
  (cluster) or across remotes.
* **Open Guest**: open the panel of the guest on the page of its remote, with
  its status, notes, configuration, and tasks.
* **More Actions**: a menu with the other power actions that the status of the
  guest allows, in the order of the "Shutdown" menu of a guest in Proxmox VE,
  followed by Console, Snapshots, and Open in PVE UI. For containers, the power
  actions are limited to Reboot and Stop, and Console offers only xterm.js.

  * **Reboot**: shut down a running guest and start it again, which applies
    pending configuration changes.
  * **Pause**: pause a running QEMU virtual machine, which keeps it in memory.
    Resume continues it.
  * **Hibernate**: save the memory of a running QEMU virtual machine to disk and
    stop it. Start resumes it where it was stopped. Not offered for guests
    managed by HA, and Proxmox VE refuses it for virtual machines with PCI
    passthrough.
  * **Stop**: stop a guest immediately, also one in a paused or failed state.
    This is like pulling the power plug and may cause data loss, so use it only
    if the guest does not react to a shutdown. With "Overrule active shutdown
    tasks" selected in the confirmation (unchecked by default), the remote first
    aborts the shutdown tasks of the guest, as far as its API token may stop
    them. Otherwise, while a shutdown task for the guest is still running, the
    stop fails after waiting a few seconds for it. That option is not offered
    for guests managed by HA.
  * **Reset**: reset a QEMU virtual machine immediately, also one in a paused
    or failed state. This is like pressing the reset button of a computer and
    may cause data loss.
  * **Console (noVNC)** / **Console (xterm.js)**: open the console of the
    guest in a new browser window (virtual machines offer both noVNC and
    xterm.js; containers offer only xterm.js). Disabled for templates, without
    ``Sys.Console`` on the guest, and in the resource tree of a remote when the
    guest's node runs a ``pve-manager`` version older than ``9.1``.
  * **Snapshots**: open the snapshot management dialog for the guest (see
    below).
  * **Open in PVE UI**: open the guest in the backing Proxmox VE web interface
    in a new tab.

Right-clicking a guest row, or pressing the Menu key on it, opens a menu with
all row actions followed by the entries of its "More Actions" menu.

While a task such as a backup, migration, or snapshot holds the configuration
lock of a guest, a lock badge appears next to its name. The tooltip of a disabled
action explains why it is unavailable, such as HA management or a missing
privilege. Power actions disallowed by the guest's current status are omitted
from the menu, while actions blocked for other reasons are shown disabled.

In a Proxmox VE remote's resource tree, each guest row has the same power
action, Migrate, and a "More Actions" menu containing the other power actions,
Console, and Open in PVE UI (a right click opens all of them in one menu).
A selected guest's panel header offers Start or Resume, Shutdown with a menu of
the other power actions, and Migrate (templates show only Migrate). If the
guest's status does not allow a shutdown, such as a paused virtual machine, the
Shutdown button offers the first available action from its menu instead, such as
Stop.

Tags, Notes, and Settings
-------------------------

The detail panel of a guest, which opens when you select the guest in the tree
of its remote, shows up to five tags of the guest on a line below its name,
followed by the number of the other tags. The tooltip lists all tags. Click the
pencil icon to edit them in a dialog as a semicolon-, comma-, or space-separated
list, with a read-only chip preview of the valid tags above the field; click
"Update" to save or "Reset" to undo changes. A tag starts with a letter, a
digit, or ``_``, followed by letters, digits, and the characters ``_``, ``-``,
``+``, and ``.``. Tags also select guests for views, so changing them can
change which views show a guest.

Changing tags needs the ``Resource.Modify`` privilege on the guest and on the
remote itself, that is on ``/resource/{remote}``, while notes and most settings
only need it on the guest. Proxmox VE has its own rules for which tags a user may
set, such as registered tags, but checks them against the API token of the
remote, which usually may set any tag. So Proxmox Datacenter Manager leaves tag
changes to users who may change the whole remote. For other users, the tags are
shown read-only, and the tooltip of the pencil icon tells why.

The "Notes" tab shows the notes of the guest, rendered as Markdown. Click
"Edit" to change them.

In the "Config" tab, allowed rows can be edited and pending changes reverted
directly in place:

* For virtual machines, CPU (sockets, cores, CPU type and flags, vCPUs, CPU
  limit and units, NUMA), memory (memory, ballooning, shares), name, start at
  boot, the start and shutdown order with the startup delay and shutdown
  timeout, OS type, local time for RTC, RTC start date, QEMU guest agent, and
  protection. Changing the start and shutdown order of a virtual machine
  additionally needs ``System.Modify`` on the remote (``/resource/{remote}``),
  as Proxmox VE requires ``Sys.Modify`` on ``/`` for it.
* For containers, CPU cores (and CPU limit and units; leave cores empty to let
  the container use all cores of its node), memory and swap, host name, start at
  boot, the start and shutdown order with the startup delay and shutdown
  timeout, ``/dev/console``, TTY count, console mode, and protection.

A running guest applies some changes, like a new name, right away. Changes that
a guest cannot apply right away, like more memory without memory hotplug, show
as pending in the "Config" tab and can be reverted or take effect on the next
cold start. To change other options or the hardware of a guest, open it in the
web interface of its remote with the external link icon in the header of its
panel.

Tags, notes, and settings are only saved if the configuration of the guest did
not change since it was loaded for editing; otherwise, open the editor again.
While a task holds the configuration lock of the guest, Proxmox VE refuses
changes to its tags, notes, and settings.

Snapshots
---------

Snapshot management is available for both QEMU and LXC guests, either from the
"Snapshots" action in the guest list or from the "Snapshots" tab in a guest's
detail panel.

.. image:: images/screenshots/guest-snapshots.png
  :target: _images/guest-snapshots.png
  :align: right
  :alt: The snapshot tree of a guest with its actions

The dialog lists a guest's snapshots as a parent/child tree that reflects how
each snapshot was taken from the one before it. The current running state is
shown as a ``NOW`` entry at the appropriate place in the tree. For each snapshot
the dialog shows the name, the time it was taken, whether it includes the guest
RAM (for QEMU guests), and its description.

The following operations are available:

* **Take Snapshot**: create a new snapshot of the current state. For QEMU guests
  the memory can optionally be included.
* **Edit Description**: change the description of an existing snapshot.
* **Rollback**: revert the guest to the selected snapshot.
* **Delete**: remove the selected snapshot.

.. _guest_tasks:

Tasks
-----

The "Tasks" tab in a guest's detail panel lists that guest's tasks from the
remote's task history across all nodes, including tasks from before a
migration. As in Proxmox VE, only tasks associated with that single guest ID
appear here; multi-guest backup tasks are excluded. To view a task's log, click
the arrow at the end of its row or double-click the row.

Permissions
-----------

The guest list shows the resources the user may audit, and every action is
carried out against the backing remote, where the remote's own privileges
apply. An operator therefore needs the appropriate permission on the target
guest's remote for an action to succeed.

Actions on a guest require the following privileges on ``/resource/{remote}/guest/{vmid}``
unless noted otherwise:

* **Notes and settings**: ``Resource.Modify`` on the guest. Changing tags also
  requires ``Resource.Modify`` on the remote (``/resource/{remote}``), and
  changing the start and shutdown order of a virtual machine additionally
  requires ``System.Modify`` on the remote (see above). Because a remote's API
  token usually has broad permissions, Proxmox Datacenter Manager exposes only
  settings that affect the guest itself.
* **Power actions**: ``Resource.Manage`` on the guest.
* **Migration**: ``Resource.Migrate`` on the guest (and on the target remote for
  cross-remote migrations).
* **Console**: ``Sys.Console`` on the guest.

The guest list and resource tree disable actions for which you lack the required
privilege on the guest.

A bulk start, shutdown, or hibernation requires ``Resource.Manage`` on every
selected guest, and a bulk migration requires ``Resource.Migrate``. If the
privilege is missing on any guest in the request, the whole request is refused,
so the bulk action dialog lists only eligible guests you have permission for
(omitting templates except for migration). Showing a remote task's log in the
dialog requires ``Resource.Audit`` on the remote, as the task covers all guests
of the remote.

On the remote, the API token of Proxmox Datacenter Manager needs
``VM.PowerMgmt`` on the guests of a bulk power action, ``VM.Migrate`` on the
guests of a bulk migration, and ``VM.Audit`` so the remote lists them. A
hibernation also needs ``VM.Config.Disk`` on the virtual machines and
``Datastore.AllocateSpace`` on the storage for their memory state.

The "Tasks" tab of a guest needs the ``Resource.Audit`` privilege on its
remote, that is on ``/resource/{remote}``, like the task list of the remote.
Without a privilege on the remote, the web interface does not list the remote,
so the panel of the guest cannot be opened. With ``Resource.Audit`` only on the
guest, the task list of the API and of the command line client, for example
``proxmox-datacenter-manager-client task list --remote <remote> --vmid <vmid>``,
still includes the power, migration, configuration, and snapshot tasks of the
guest, and following their progress and log needs only this privilege as well.
Stopping a task needs ``Resource.Manage`` on the remote.
