Skip to content

Creating & Managing Datastores

Datastores are created with the Add Datastore wizard. It walks through three steps — Basics, Configuration, and Review — and adapts the fields it asks for to the kind of datastore you are building.

Where you launch the wizard sets the starting context:

  • From a host — the target host is fixed to that host; you can still choose Local or Shared scope.
  • From a cluster or datacenter — the datastore is shared by definition, so the wizard preselects Shared scope and fans the datastore out to every host in the cluster.

TIP

If your license is in restricted mode, creating datastores is disabled and the wizard shows a banner explaining why.


Step 1 — Basics

FieldNotes
Target ClusterWhich cluster the datastore belongs to (or No Cluster for a standalone host). Locked when the wizard is launched from a specific host or cluster.
Target HostThe host the datastore is created from. For shared datastores launched from a cluster this is hidden — the pool lands on every host regardless.
Datastore nameRequired. Used to auto-generate the default mount path.
AutostartStart the datastore automatically when the host boots.
ScopeLocal (this host only) or Shared (every host in the cluster). Shared scope requires a cluster with at least two hosts.
TypeThe available types depend on the scope you picked (see below).

Datastore types

ScopeTypeBacked by
LocalLocal directoryA directory path on the host (libvirt directory pool).
LocalLocal disk deviceA whole, unmounted local disk with no partitions.
SharedShared NFSAn NFS export mounted at the same path on every host.
SharedShared Clustered FS (OCFS2)A shared SAN/multipath LUN formatted with OCFS2 and coordinated by a shared group.

Step 2 — Configuration

The Configuration step changes based on the type chosen in Step 1.

Local directory

Provide an absolute directory path (for example /var/lib/cockpit/images/local-store). The host creates a directory-backed libvirt pool at that path.

Local disk device

Choose a whole local disk and the mount path libvirt should use (defaults to /mnt/<datastore-name>). Only eligible disks are selectable — a disk is rejected when it:

  • already belongs to another storage pool,
  • is removable,
  • contains partitions,
  • is already mounted, or
  • is a network/multipath device (those are reserved for shared OCFS2 pools).

Shared NFS

FieldNotes
NFS sourceThe export in host:/path form, e.g. nfs.example.com:/exports/datastore.
Shared mount pathThe common path used on every host. Defaults to /mnt/<cluster-name>/<datastore-name>. Must be absolute.
Username / PasswordOptional. If you set one, you must set both.

Cockpit creates a matching netfs pool on every host in the cluster.

Shared Clustered FS (OCFS2)

An OCFS2 datastore lets several hosts read and write the same LUN at once. Because that is only safe when the hosts coordinate, this type has extra prerequisites and safeguards.

Prerequisite: a shared group must already exist

The wizard never creates the O2CB cluster for you. Every host in the cluster must already belong to the same O2CB shared group. If they don't, the wizard blocks with "No shared O2CB cluster" — set the group up from the Shared Group tab first, then reopen the wizard.

In the per-host device table you map each host to the shared LUN it sees:

  • Only unmounted network-backed or multipath devices are offered. Local disks are not eligible here.
  • Each host must have its iSCSI software adapter enabled. If it isn't, the row tells you to configure it under that host's Configure → Storage → Adapters page.
  • Every host must point at the same underlying LUN. The device path may differ per host (e.g. /dev/mapper/mpathb vs /dev/sdd), but the wizard verifies they resolve to the same LUN identity (persistent ID / WWID) and rejects a mismatch.

Formatting erases the LUN

If the selected LUN already carries a filesystem, creating the datastore reformats it, erasing all data on it for every host at once. The wizard surfaces the detected filesystem and requires you to tick "Yes, erase this device" before it will continue. One host (the alphabetically-first "entry-point" host) runs mkfs against the LUN; the others simply mount it.


Step 3 — Review & Create

The Review step summarizes the final configuration — scope, type, hosts, mount path, and, for OCFS2, the O2CB cluster name and each host's device assignment.

Selecting Create Datastore submits the request. A shared datastore is created in the background across all hosts, so the wizard closes and the Tasks panel opens automatically so you can watch the work progress.


Managing an existing datastore

From the datastore view you can:

  • Monitor capacity — total, used, and available space.
  • Refresh — rescan the datastore so Cockpit's view matches the files actually on disk.
  • Start / Stop — bring a datastore online or offline. Stopping it makes its disks unavailable to VMs.
  • Delete — remove a datastore. You can optionally erase the disk files it contains; without that option only the registration is removed and the files are left in place.