5.3. Virtual Disks


5.3.1. Adding a New Virtual Disk

You can add multiple virtual disks to a virtual machine.

Image is the default type of disk. You can also add a Direct LUN disk. Image disk creation is managed entirely by the Manager. Direct LUN disks require externally prepared targets that already exist. Existing disks are either floating disks or shareable disks attached to virtual machines.

Adding Disks to Virtual Machines

  1. Click Compute Virtual Machines.
  2. Click a virtual machine name to go to the details view.
  3. Click the Disks tab.
  4. Click New.
  5. Use the appropriate radio buttons to switch between Image and Direct LUN.
  6. Enter a Size(GB), Alias, and Description for the new disk.
  7. Use the drop-down lists and check boxes to configure the disk. See Add Virtual Disk dialogue entries for more details on the fields for all disk types.
  8. Click OK.

The new disk appears in the details view after a short time.

5.3.2. Attaching an Existing Disk to a Virtual Machine

Floating disks are disks that are not associated with any virtual machine.

Floating disks can minimize the amount of time required to set up virtual machines. Designating a floating disk as storage for a virtual machine makes it unnecessary to wait for disk preallocation at the time of a virtual machine’s creation.

Floating disks can be attached to a single virtual machine, or to multiple virtual machines if the disk is shareable. Each virtual machine that uses the shared disk can use a different disk interface type.

Once a floating disk is attached to a virtual machine, the virtual machine can access it.

Procedure

  1. Click Compute Virtual Machines.
  2. Click a virtual machine name to go to the details view.
  3. Click the Disks tab.
  4. Click Attach.
  5. Select one or more virtual disks from the list of available disks and select the required interface from the Interface drop-down.
  6. Click OK.
Note

No Quota resources are consumed by attaching virtual disks to, or detaching virtual disks from, virtual machines.

5.3.3. Extending the Available Size of a Virtual Disk

You can extend the available size of a virtual disk while the virtual disk is attached to a virtual machine. Resizing a virtual disk does not resize the underlying partitions or file systems on that virtual disk. Use the fdisk utility to resize the partitions and file systems as required. See How to Resize a Partition using fdisk for more information.

Extending the Available Size of Virtual Disks

  1. Click Compute Virtual Machines.
  2. Click a virtual machine name to go to the details view.
  3. Click the Disks tab and select the disk to edit.
  4. Click Edit.
  5. Enter a value in the Extend size by(GB) field.
  6. Click OK.

The target disk’s status becomes locked for a short time, during which the drive is resized. When the resizing of the drive is complete, the status of the drive becomes OK.

5.3.4. Hot Plugging a Virtual Disk

You can hot plug virtual disks. Hot plugging means enabling or disabling devices while a virtual machine is running.

Note

The guest operating system must support hot plugging virtual disks.

Hot Plugging Virtual Disks

  1. Click Compute Virtual Machines.
  2. Click a virtual machine name to go to the details view.
  3. Click the Disks tab and select the virtual disk to hot plug.
  4. Click More Actions ( moreactions ), then click Activate to enable the disk, or Deactivate to disable the disk.
  5. Click OK.

5.3.5. Removing a Virtual Disk from a Virtual Machine

Removing Virtual Disks From Virtual Machines

  1. Click Compute Virtual Machines.
  2. Click a virtual machine name to go to the details view.
  3. Click the Disks tab and select the virtual disk to remove.
  4. Click More Actions ( moreactions ), then click Deactivate.
  5. Click OK.
  6. Click Remove.
  7. Optionally, select the Remove Permanently check box to completely remove the virtual disk from the environment. If you do not select this option - for example, because the disk is a shared disk - the virtual disk will remain in Storage Disks.
  8. Click OK.

If the disk was created as block storage, for example iSCSI, and the Wipe After Delete check box was selected when creating the disk, you can view the log file on the host to confirm that the data has been wiped after permanently removing the disk. See Settings to Wipe Virtual Disks After Deletion in the Administration Guide.

If the disk was created as block storage, for example iSCSI, and the Discard After Delete check box was selected on the storage domain before the disk was removed, a blkdiscard command is called on the logical volume when it is removed and the underlying storage is notified that the blocks are free. See Setting Discard After Delete for a Storage Domain in the Administration Guide. A blkdiscard is also called on the logical volume when a virtual disk is removed if the virtual disk is attached to at least one virtual machine with the Enable Discard check box selected.

5.3.6. Importing a Disk Image from an Imported Storage Domain

You can import floating virtual disks from an imported storage domain.

This procedure requires access to the Administration Portal.

Note

Only QEMU-compatible disks can be imported into the Manager.

Importing a Disk Image

  1. Click Storage Domains.
  2. Click an imported storage domain to go to the details view.
  3. Click Disk Import.
  4. Select one or more disk images and click Import. This opens the Import Disk(s) window.
  5. Select the appropriate Disk Profile for each disk.
  6. Click OK to import the selected disks.

5.3.7. Importing an Unregistered Disk Image from an Imported Storage Domain

You can import floating virtual disks from a storage domain. Floating disks created outside of a Red Hat Virtualization environment are not registered with the Manager. Scan the storage domain to identify unregistered floating disks to be imported.

This procedure requires access to the Administration Portal.

Note

Only QEMU-compatible disks can be imported into the Manager.

Importing a Disk Image

  1. Click Storage Domains.
  2. Click More Actions ( moreactions ), then click Scan Disks so that the Manager can identify unregistered disks.
  3. Select an unregistered disk name and click Disk Import.
  4. Select one or more disk images and click Import. This opens the Import Disk(s) window.
  5. Select the appropriate Disk Profile for each disk.
  6. Click OK to import the selected disks.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.