5.4. Virtual Disks


5.4.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 or a Cinder (OpenStack Volume) disk. Image disk creation is managed entirely by the Manager. Direct LUN disks require externally prepared targets that already exist. Cinder disks require access to an instance of OpenStack Volume that has been added to the Red Hat Virtualization environment using the External Providers window; see Adding an OpenStack Volume (Cinder) Instance for Storage Management for more information. Existing disks are either floating disks or shareable disks attached to virtual machines.

Procedure 5.8. Adding Disks to Virtual Machines

  1. Click the Virtual Machines tab and select a virtual machine.
  2. Click the Disks tab in the details pane.
  3. Click New.
    The New Virtual Disk Window

    Figure 5.2. The New Virtual Disk Window

  4. Use the appropriate radio buttons to switch between Image, Direct LUN, or Cinder. Virtual disks added in the User Portal can only be Image disks. Direct LUN and Cinder disks can be added in the Administration Portal.
  5. Enter a Size(GB), Alias, and Description for the new disk.
  6. Use the drop-down lists and check boxes to configure the disk. See Section A.3, “Explanation of Settings in the New Virtual Disk and Edit Virtual Disk Windows” for more details on the fields for all disk types.
  7. Click OK.
The new disk appears in the details pane after a short time.

5.4.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 5.9. Attaching Virtual Disks to Virtual Machines

  1. Click the Virtual Machines tab and select a virtual machine.
  2. Click the Disks tab in the details pane.
  3. Click Attach.
    The Attach Virtual Disks Window

    Figure 5.3. The Attach Virtual Disks Window

  4. Select one or more virtual disks from the list of available disks and select the required interface from the Interface drop-down.
  5. Click OK.

Note

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

5.4.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.

Procedure 5.10. Extending the Available Size of Virtual Disks

  1. Click the Virtual Machines tab and select a virtual machine.
  2. Click the Disks tab in the details pane and select the disk to edit.
  3. Click Edit.
  4. Enter a value in the Extend size by(GB) field.
  5. 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.4.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.

Procedure 5.11. Hot Plugging Virtual Disks

  1. Click the Virtual Machines tab and select a virtual machine.
  2. Click the Disks tab in the details pane and select the virtual disk to hot plug.
  3. Click Activate to enable the disk, or click Deactivate to disable the disk.
  4. Click OK.

5.4.5. Removing a Virtual Disk from a Virtual Machine

Procedure 5.12. Removing Virtual Disks From Virtual Machines

  1. Click the Virtual Machines tab and select a virtual machine.
  2. Click the Disks tab in the details pane and select the virtual disk to remove.
  3. Click Deactivate.
  4. Click OK.
  5. Click Remove.
  6. 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 the Disks resource tab.
  7. 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.4.6. Importing a Disk Image from an Imported Storage Domain

Import floating virtual disks from an imported storage domain using the Disk Import tab of the details pane.
This procedure requires access to the Administration Portal

Note

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

Procedure 5.13. Importing a Disk Image

  1. Select a storage domain that has been imported into the data center.
  2. In the details pane, click Disk Import.
  3. Select one or more disk images and click Import to open the Import Disk(s) window.
  4. Select the appropriate Disk Profile for each disk.
  5. Click OK to import the selected disks.

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

Import floating virtual disks from a storage domain using the Disk Import tab of the details pane. 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.

Procedure 5.14. Importing a Disk Image

  1. Select a storage domain that has been imported into the data center.
  2. Right-click the storage domain and select Scan Disks so that the Manager can identify unregistered disks.
  3. In the details pane, click Disk Import.
  4. Select one or more disk images and click Import to open 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.