.. _views:

Views
=====

Views allow you to add an interactive view on a selected set of resources.

Resource Selection
------------------

The resource selection is controlled by an include-exclude filter system.

You define what resources to consider for including which then get passed through an exclude list to
single specific types out again.

This way you can, for example, easily configure to include all virtual machine resources, but then
exclude any such VM that resides on a specific remote.

Filter Types
^^^^^^^^^^^^

 .. todo auto-generate below list

The following lists of filter types are available to be used in include or exclude lists.

- The `resource-type` filter allows you to filter by a specific resource type.
  The following types are available:

  - `datastore`: A Proxmox Backup Server datastore.
  - `lxc`: A LXC container.
  - `network`: A Proxmox VE SDN zone or fabric.
  - `node`: A Proxmox VE or Proxmox Backup Server node.
  - `qemu`: A QEMU virtual machine.
  - `storage`: A Proxmox VE storage

- The `resource-pool` filter allows you to include or exclude only resources that are located in a
  specific resource pool-name.
- The `tag` filter allows you to filter resources that are tagged with a specific tag-name.
- The `remote` filter allows you to filter resources located on a specific remote.
- The `resource-id` filter allows you to filter resources with a specific ID.


Each filter can be prefixed with an optional `<match-behavior>:` prefix. Currently there is only
the `exact` matching behavior available. This behavior is the default if no prefix is provided.


Customizable Dashboard
----------------------

You can create customizable dashboards for a view from a set of pre-defined widgets.
Only resources matching your include minus the ones matching your exclude filters will be displayed
in these widgets.


Widgets
^^^^^^^

The following widgets are available:

- The `nodes` widget shows a status overview of the Proxmox VE and Proxmox
  Backup Server nodes, and can be limited to a single remote type.
- The `guests` widget shows a status overview of the virtual guests, and can be
  limited to QEMU virtual machines or LXC containers.
- The `pbs-datastores` widget shows the usage and status of Proxmox Backup
  Server datastores.
- The `remotes` widget lists the configured remotes and their status. It can
  also show a wizard for adding a new remote.
- The `subscription` widget shows the subscription status of the remotes.
- The `sdn` widget shows the status of the Software-Defined Networking (SDN)
  zones.
- The `leaderboard` widget ranks resources by a metric, such as guest or node
  CPU or node memory usage, and lists the top consumers.
- The `task-summary` widget summarizes recent tasks, grouped by a chosen
  criterion.
- The `resource-tree` widget shows the selected resources in a hierarchical
  tree.
- The `node-resource-gauge` widget displays a single node resource, such as
  CPU, memory, or storage, as a gauge chart, and can be limited to a single
  remote type.
- The `map` widget plots the remotes on an interactive world map at their
  configured geographic location. Markers are colored by the remote's status,
  and markers that are close together are clustered as you zoom out.

Map Widget
^^^^^^^^^^

The locations shown by the `map` widget come from the remotes and cannot be
edited in Proxmox Datacenter Manager. Configure them on the remote side:

- On Proxmox VE, set a cluster-wide default in the datacenter options, and
  optionally override it per node in the node options.
- On Proxmox Backup Server, set the location under the "Configuration" menu, in
  the "Other" tab's "Location" section.

Each location of a remote is a point on the map. Points that are too close to
tell apart at the current zoom level are combined into one, which shows how
many points it combines. A point has the color of the worst status of its
remotes. If the remotes of a combined point have different statuses, a ring
around it shows the share of remotes in each status. Points with a warning or
an error pulse slowly. If there is room, the name of the location, or of the
remote if the location has none, is shown next to a point, provided all the
points it combines have the same name.

Running migrations of guests between remotes are shown as animated arrows from
the source to the target location. Hovering an arrow shows the guest and its
route.

- The target remote is found by the address of the target endpoint in the task
  log, which has to match a node address configured for another Proxmox VE
  remote. The log has no port, so remotes that only differ in the port cannot
  be told apart. Migrations within a cluster, and migrations whose address
  matches no remote or more than one, are not shown.
- Both remotes need a location on the map. If the source or target node has no
  location, another location of its remote is used.
- There is no arrow while the source and the target are in the same combined
  point or too close to each other.
- A migration is only shown to users with the `Resource.Audit` privilege on
  both the source and the target remote, as reading the task log and matching
  the address need it. Users who only have privileges on a view get no arrows.
- Migrations started directly on a remote only show up once Proxmox Datacenter
  Manager fetches the task list of that remote, which can take up to ten
  minutes. Short migrations may not show up at all.

The lower left corner of the map summarizes the remotes on the map, those with
an error or a warning, and the migrations shown on it. Each entry opens a list,
in which selecting a remote opens it and selecting a migration opens its task.

The part of the world where it is currently night is shaded. The moon button,
"Show where it is night", turns that off and on, and the browser remembers the
choice for maps opened later.

The map background is drawn from public-domain vector data by `Natural Earth
<https://www.naturalearthdata.com/>`_, shipped in the `proxmox-geojson-data`
package.


Access Control
--------------

You can grant permissions on specific views. With such a permission the user can operate on the
view and all its selected resources.
