Skip to content

Knowledgebase

Creating and attaching a libvirt storage volume

servers

Create a libvirt volume in a known storage pool and attach it deliberately to one guest. Separate host-side virtual-disk allocation from guest partitioning and formatting. A newly attached disk does not automatically become usable application storage.

Check access and requirements

Confirm the guest identity, pool capacity, disk format and supported bus. Back up guest data and record existing disk attachments. For a VM controlled by SolusVM or Virtualizor, use that manager's storage workflow instead of bypassing its inventory with independent virsh changes.

01 Create and attach a libvirt storage volume

  1. Inspect pools with virsh -c qemu:///system pool-list --all and inspect the intended pool capacity and path.
  2. Create a uniquely named volume with the pool-supported format and explicit capacity. For example, the vol-create-as workflow accepts pool, name, capacity and format; replace every value with the approved storage plan.
  3. Inspect the resulting volume path and metadata before attachment. Apply the supported ownership and security-label model instead of broad permissions.
  4. Attach it to the correct guest using the management interface or reviewed device definition. Choose an unused target device and decide whether the change is persistent, live or both.
  5. Inside the guest, identify the new empty disk using size and stable identifiers. Partition and format only that confirmed new disk, then mount it at the intended location with a persistent, tested filesystem identifier.

Why does the host show a smaller allocated size than the virtual capacity?

A sparse or thin volume can reserve a larger logical capacity than the physical space currently consumed. Monitor real backend usage because later guest writes still require available storage.

Confirm the expected result

Confirm guest reads and writes use the new filesystem and that it remains correctly mounted after restart. Check that existing disks and boot order are unchanged. Ensure backups include the newly added volume rather than only the original root disk.

Resolve setup problems

If the disk is missing, compare live and persistent guest configuration, bus drivers and device permissions. A host path with the expected name is not proof of correct guest attachment. Do not format an unidentified device or remove a volume while the guest or a backup task still uses it.

Was this answer helpful?

Need a little more help?

Our support team can help you find the next step.

Contact support

Powered by WHMCompleteSolution