9.18. VM disks


9.18.1. Hot-plug virtual disks to running VMs

You can hot-plug or hot-unplug virtual disks from running VMs to dynamically adjust storage without downtime.

Only data volumes and persistent volume claims (PVCs) can be hot plugged and hot-unplugged. You cannot hot plug or hot-unplug container disks.

A hot plugged disk remains attached to the VM even after reboot. You must unplug the disk to remove it from the VM.

참고

Each VM has a virtio-scsi controller so that hot plugged disks can use the SCSI bus. The virtio-scsi controller overcomes the limitations of VirtIO while retaining its performance advantages. It is highly scalable and supports hot plugging over 4 million disks.

When you hot plug disks to the VirtIO (virtio-blk) bus, each disk uses a PCI Express (PCIe) slot in the VM. The number of PCIe slots is limited and pre-set automatically at the VM creation as specified in the "Available VirtIO Ports" table. Therefore, you can use virtio-blk for a small number of disks that does not exceed the number of available slots.

9.18.1.1. Hot plugging and hot unplugging a disk by using the web console

You can hot plug a disk by attaching it to a virtual machine (VM) while the VM is running by using the OpenShift Container Platform web console.

The hot plugged disk remains attached to the VM until you unplug it.

Prerequisites

  • You must have a data volume or persistent volume claim (PVC) available for hot plugging.

Procedure

  1. Navigate to Virtualization VirtualMachines in the web console.
  2. Select a running VM to view its details.
  3. On the VirtualMachine details page, click Configuration Storage.
  4. Add a hot plugged disk:

    1. Click Add.
    2. In the Add disk (hot plugged) window, select the disk from the Source list and click Save.
  5. Optional: Select the type of the interface bus. The options are VirtIO and SCSI. The default bus type is VirtIO.
  6. Optional: Change the type of the interface bus of an existing hot plugged disk:

    1. Click the Options menu kebab beside the disk and select the Edit option.
    2. In the Interface field, select the desired option.
  7. Optional: Unplug a hot plugged disk:

    1. Click the Options menu kebab beside the disk and select Detach.
    2. Click Detach.

9.18.1.2. Hot plugging and hot unplugging a disk by using the CLI

You can hot plug and hot unplug a disk while a virtual machine (VM) is running by using the command line.

The hot plugged disk remains attached to the VM until you unplug it.

Prerequisites

  • You must have at least one data volume or persistent volume claim (PVC) available for hot plugging.

Procedure

  • Hot plug a disk by running the following command:

    $ virtctl addvolume <virtual-machine|virtual-machine-instance> \
      --volume-name=<datavolume|PVC> \
      [--bus <bus_type>] [--serial=<label_name>]
    • The optional --bus flag allows you to specify the bus type of the added disk. The options are virtio and scsi. The default bus type is virtio.
    • The optional --serial flag allows you to add an alphanumeric string label of your choice. This helps you to identify the hot plugged disk in a guest virtual machine. If you do not specify this option, the label defaults to the name of the hot plugged data volume or PVC.
  • Hot unplug a disk by running the following command:

    $ virtctl removevolume <virtual-machine|virtual-machine-instance> \
      --volume-name=<datavolume|PVC>
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동