Documentation Managing VM Disks

CHAPTER 09

Managing VM Disks

5 sections · 8 min read · SimpleVM 10.1

This chapter explains how to manage the virtual disks attached to a virtual machine, and how to think about host device assignment. A virtual disk is the storage a VM presents to its guest operating system; on a SimpleVM host it is normally a disk-image file stored in a storage pool. Disk operations are performed from the VM detail page — the same page used for the VM console and settings — so you can review, add, and remove storage in the context of the VM that uses it. The single most important idea in this chapter is one distinction: detaching a disk from a VM is not the same as deleting the file or volume that holds its data. Keeping that distinction clear is what makes disk changes safe and reversible.

Cross-reference: For signing in to the management interface, see Section 6.5, Sign In with Administrative Access. For creating the VM whose disks you are managing, see Chapter 8, Creating and Managing Virtual Machines. For the storage pools that back VM disks, see Chapter 12, Managing Storage Pools. For network interfaces and snapshots on the same VM detail page, see Chapter 10, Managing VM Network Interfaces, and Chapter 11, VM Snapshots.

This chapter at a glance. The sections below follow the storage of a single virtual machine:

  • Review disks — read the Disks section to confirm where a VM's storage lives, how large it is, and whether it is writable (Section 9.1).
  • Add a disk — attach more storage to a VM from the web console, then prepare it inside the guest (Section 9.2).
  • Remove a disk — detach a disk deliberately, deciding separately whether to delete its backing storage (Section 9.3).
  • Assign host devices — understand when to give a VM direct access to host hardware, and the migration and availability trade-offs that follow (Section 9.4).
  • Operate storage well — apply disk layout, capacity, and backup practices across a VM's life (Section 9.5).

9.1 Viewing VM Disks

Overview

The Disks section of the VM detail page lists every storage device attached to the VM — writable virtual disks and read-only devices such as virtual CD/DVD media. Reading it before you make a change tells you where each disk is stored, how much capacity it has, and whether it is writable, so you know exactly what you are about to modify.

Figure 9-1. The Disks section of the VM detail page. The reference build shows a writable disk (sata bus, 32 GiB, backed by /data/images/winsvr22-2.qcow2 in qcow2 format) and a read-only cdrom device with Insert and Edit.
Figure 9-1. The Disks section of the VM detail page. The reference build shows a writable disk (sata bus, 32 GiB, backed by /data/images/winsvr22-2.qcow2 in qcow2 format) and a read-only cdrom device with Insert and Edit.

Before you begin

  • You are signed in to the SimpleVM management interface with administrative access. See Section 6.5, Sign In with Administrative Access.
  • The VM you want to review already exists. See Chapter 8, Creating and Managing Virtual Machines.

Procedure

  1. Open Virtual machines from the left-navigation menu.
  2. Select the VM you want to review to open its detail page.
  3. Scroll to the Disks section.
  4. Review each device's Device, Used, Capacity, Bus, Access, Source, and Additional values.

The disk fields report the following:

FieldMeaning
DeviceThe virtual device type — for example, a disk or a cdrom device.
UsedThe space currently consumed by the disk image, when the interface can report it.
CapacityThe configured size of the virtual disk or media.
BusThe virtual bus presented to the guest — for example, sata, scsi, or virtio. The reference build uses sata.
AccessWhether the device is Writeable or Read-only. Virtual disks are normally writable; virtual CD/DVD media is read-only.
SourceThe backing file or volume — for example, the file /data/images/winsvr22-2.qcow2.
AdditionalExtra detail such as the image format, for example qcow2.

Verification

  • The Disks section lists the VM's storage devices.
  • The primary disk shows the expected capacity and a Source path in the correct storage pool.
  • Attached installation media, when present, appears as a read-only cdrom device with Insert and Edit.

9.2 Adding VM Disks

Overview

Adding a disk attaches more storage to a VM. SimpleVM creates or attaches the disk and presents it to the guest, but the guest operating system still owns the next step: a newly attached disk usually has to be initialized, partitioned, formatted, and mounted inside the guest before applications can use it. Separating the host-side action (attach) from the guest-side action (prepare) is what makes adding disks predictable.

Before you begin

  • The target storage pool has enough free capacity for the new disk. See Chapter 12, Managing Storage Pools.
  • You know the disk's role — operating system, application data, logs, database, or temporary storage — so you can size and place it correctly. See Section 3.4, Storage Planning.
  • If the VM is running, you have confirmed whether the guest operating system detects a newly attached disk without a restart.

Procedure

  1. Open Virtual machines and select the VM.
  2. In the Disks section, select Add disk.
  3. Choose whether to create a new disk or attach an existing one.
  4. Select the storage pool or storage location for the disk.
  5. Enter the disk size, and set any options the dialog offers — such as format, bus type, or access mode.
  6. Select the confirmation button shown by the dialog — for example, Add or Create.

Verification

  • The new disk appears in the Disks section with the expected capacity and Source.
  • Inside the guest operating system, the new disk is visible. Initialize, partition, format, and mount it as needed before storing data.

Revert this change

If the disk was added by mistake and holds no data, remove it from the VM; see Section 9.3, Removing VM Disks. If the disk already contains data, confirm the data is no longer needed or has been backed up before removing it or deleting its backing storage.

9.3 Removing VM Disks

Overview

Removing a disk changes the VM's configuration and can also affect the file or volume that holds the data. The most important point is that detaching a disk from a VM is not the same as deleting its backing storage. Detaching leaves the disk image in the storage pool; deleting removes the data. The safe path is to back up first, confirm no needed data remains, then remove the disk deliberately.

Before you begin

  • You have backed up any data on the disk that you might need. See Chapter 20, Backup and Recovery.
  • You have confirmed whether the disk must be unmounted inside the guest, or the VM shut down, before removal.

Procedure

  1. Open Virtual machines and select the VM.
  2. In the Disks section, identify the disk to remove.
  3. If the disk is in use, unmount it inside the guest operating system or shut the VM down, as appropriate.
  4. Open the disk's action menu () or select Edit for the disk.
  5. Select the detach or remove option.
  6. If the dialog asks whether to delete the backing storage, choose deliberately: detaching preserves the disk image; deleting removes it.

Verification

  • The removed disk no longer appears in the Disks section.
  • The VM starts normally after the disk is removed.
  • If you preserved the backing storage, the disk image remains in its storage pool.

Revert this change

If the disk was detached but not deleted, attach the existing disk to the VM again; see Section 9.2, Adding VM Disks. If the backing storage was deleted, restore the disk or the VM from backup; see Chapter 20, Backup and Recovery. If no backup exists, the data may not be recoverable.

Troubleshooting

If the VM fails to start after a disk is removed, confirm the boot order does not still reference the removed disk and that no remaining disk entry points to a missing file. For broader storage problems, see Section 25.5, Storage Issues.

9.4 Managing Host Devices

Overview

Host device assignment gives a VM direct access to a device on the SimpleVM host. It is an advanced workflow, used only when a VM genuinely needs a specific piece of host hardware rather than a virtualized equivalent. The trade-off is significant: a VM with an assigned host device is tied to that one physical host, which affects migration, high availability, and supportability. In the reference build the Host devices section is empty and shows the message No host devices assigned to this VM.

Figure 9-2. The Host devices section of the VM detail page, with Add host device and the empty-state message No host devices assigned to this VM.
Figure 9-2. The Host devices section of the VM detail page, with Add host device and the empty-state message No host devices assigned to this VM.

Before you begin

  • You have confirmed the device is supported for assignment to a VM.
  • The device is not required by the SimpleVM host itself.
  • You have confirmed whether the host requires IOMMU or other firmware settings for this device type.
  • You have confirmed that migration, snapshot, and recovery expectations still hold after the device is assigned.

Procedure

  1. Open Virtual machines and select the VM.
  2. Scroll to the Host devices section.
  3. Select Add host device.
  4. Choose the host device to assign.
  5. Review any warnings or requirements the dialog shows.
  6. Confirm the assignment.

Verification

  • The assigned device appears in the Host devices section.
  • The guest operating system detects the device.
  • The SimpleVM host and its other VMs continue to operate normally.

Revert this change

Remove the host device from the VM. Depending on the device type, you may need to shut the VM down first. After removal, confirm the host can use the device again if it had been reserved for the VM.

9.5 VM Disk Best Practices

Overview

Good disk management is mostly about deliberate choices made before a change, not recovery afterward. The practices below keep VM storage predictable and reversible.

  • Separate operating-system storage from application and data storage where practical, so each can be sized, backed up, and recovered independently. See Section 3.4, Storage Planning.
  • Place each disk in the storage pool intended for its workload, and avoid mixing test and production storage unless that is the design.
  • Size disks for expected growth, and monitor pool capacity so adding disks does not exhaust a pool. See Section 12.7, Monitoring Storage Pool Capacity.
  • Treat detach and delete as different actions. Detach to reorganize; delete only after confirming the data is backed up or no longer needed.
  • Back up before removing a disk, reverting a snapshot, or changing storage-sensitive configuration. See Chapter 20, Backup and Recovery.
  • Use host device assignment sparingly, and document any VM that depends on host hardware, because it constrains migration and high availability.
  • For point-in-time protection before a risky change, use a snapshot in addition to — not instead of — a backup. See Chapter 11, VM Snapshots.