6.10. Host Devices
6.10.1. Adding a Host Device to a Virtual Machine
To improve performance, you can attach a host device to a virtual machine.
Host devices are physical devices connected to a particular host machine, such as:
- SCSI tape drives, disks, and changers
- PCI NICs, GPUs, and HBAs
- USB mice, cameras, and disks
To add a host device to a virtual machine, you use the virtual machine’s Host Devices properties. First, you select one of the cluster hosts and a device type. Then, you choose and attach one or more of the host devices on that host.
When you change the Pinned Host setting, it removes the current host devices. When you save these changes, in the virtual machine’s Host settings, it sets Start Running On to Specific Host(s) and specifies the host you selected earlier using the Pinned Host setting.
When you finish attaching one or more host devices, you run the virtual machine to apply the changes. The virtual machine starts on the host that has the attached host devices.
If the virtual machine cannot start on the specified host or access the host device, it cancels the start operation and produces an error message with information about the cause.
The state of the host is
- The host is configured for direct device assignment.
- In the Administration Portal, click Compute → Virtual Machines.
- Shut down the virtual machine.
- Click the name of the virtual machine to go to the details view.
- Click the Host Devices tab.
- Click Add device. This opens the Add Host Devices pane.
- Use Pinned Host to select the host where the virtual machine runs.
Use Capability to list
nvdimmoption is a technical preview feature. For more information, see
- Use Available Host Devices to select devices.
- Click the down arrow to move devices to Host Devices to be attached.
- Click OK to attach these devices to the virtual machine and close the window.
Optional: If you attach a SCSI host device, configure the optimal driver.
- Click the Edit button. This opens the Edit Virtual Machine pane.
- Click the Custom Properties tab.
- Click the Please select a key and select scsi_hostdev from the bottom of the drop-down list.
- In most cases, select scsi-hd. Otherwise, for tape or CD changer devices, select the scsi_generic option. For more details, see Virtual Machine Custom Properties Settings Explained.
- Click the OK button.
- Run the virtual machine.
- While the virtual machine starts running, watch for Operation Canceled error messages.
If you cannot add a host device to a virtual machine, or a virtual machine cannot start running with the attached host devices, it generates Operation Canceled error messages. For example:
Operation Canceled Error while executing action: <vm name>: * Cannot run VM. There is no host that satisfies current scheduling constraints. See below for details: * The host <first_hostname> did not satisfy internal filter HostDevice because it does not support host device passthrough. * The host <second_hostname> did not satisfy internal filter HostDevice because the host does not provide requested host devices.
You can fix the error by removing the host device from the virtual machine or correcting the issues the error message describes. For example:
Respond to a
The host <hostname> did not satisfy internal filter HostDevice because it does not support host device passthroughmessage by configuring the host for device passthrough and restarting the virtual machine.
Respond to the
The host <hostname> did not satisfy internal filter HostDevice because the host does not provide requested host devicesmessage by adding the host device to the host.
Respond to a
Cannot add Host devices because the VM is in Up statusmessage by shutting down the virtual machine before adding a host device.
Verify that the state of the host is
- Host Devices in the Virtual Machine Management Guide.
- Pinning a Virtual Machine to Multiple Hosts
- Configuring a Host for PCI Passthrough
- Additional Hardware Considerations for Using Device Assignment in Hardware Considerations for Implementing SR-IOV.
6.10.2. Removing Host Devices from a Virtual Machine
If you are removing all host devices directly attached to the virtual machine in order to add devices from a different host, you can instead add the devices from the desired host, which will automatically remove all of the devices already attached to the virtual machine.
- Click Compute → Virtual Machines.
- Select a virtual machine to go to the details view.
- Click the Host Devices tab to list the host devices attached to the virtual machine.
Select the host device to detach from the virtual machine, or hold
Ctrlto select multiple devices, and click Remove device. This opens the Remove Host Device(s) window.
- Click OK to confirm and detach these devices from the virtual machine.
6.10.3. Pinning a Virtual Machine to Another Host
You can use the Host Devices tab in the details view of a virtual machine to pin it to a specific host.
If the virtual machine has any host devices attached to it, pinning it to another host automatically removes the host devices from the virtual machine.
Pinning a Virtual Machine to a Host
- Click a virtual machine name and click the Host Devices tab.
- Click Pin to another host. This opens the Pin VM to Host window.
- Use the Host drop-down menu to select a host.
- Click OK to pin the virtual machine to the selected host.
6.10.4. NVDIMM host devices
NVDIMM devices are Technology Preview features only. Technology Preview features are not supported with Red Hat production service-level agreements (SLAs) and might not be functionally complete, and Red Hat does not recommend using them for production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process. For more information, see Red Hat Technology Preview Features Support Scope.
You can add emulated NVDIMM devices to virtual machines. Elsewhere, this type of memory is also known as virtual NVDIMM or vNVDIMM.
The emulated NVDIMM you can attach to a virtual machine is backed by real NVDIMM on the host machine where the virtual machine runs. Therefore, when you attach NVDIMM to a virtual machine, you also pin the virtual machine to a specific host.
You can reconfigure the mode, partitioning, and other properties of the emulated NVDIMM device in the virtual machine without affecting the settings of the physical NVDIMM on the host device.
To add emulated NVDIMM to a virtual machine, see Adding Host Devices to a Virtual Machine
- Memory snapshots are disabled when an NVDIMM device is present in a virtual machine. There is no way to make a snapshot of NVDIMM content, and a memory snapshot cannot work correctly without having the corresponding NVDIMM data.
- In RHV, each NVDIMM device passed to a virtual machine has an automatically-assigned label area with a fixed size of 128 KB. IBM POWER hardware, and 128 KB is the minimum label size allowed by QEMU.
- By default, the virtual machine uses the whole NVDIMM device. You cannot configure the size of the NVDIMM from the virtual machine. To configure its size, partition the NVDIMM device on the host and add the partition to the virtual machine.
- The size of the NVDIMM device on the virtual machine may be slightly lower than on the host to comply with libvirt and QEMU alignment and size adjustments. Precise sizing is also needed to make memory hotplug work.
- libvirt and QEMU adjust their size and label placement. If those internal arrangements change, it can cause data loss.
- NVDIMM hotplug is not supported by the platform.
- Virtual machines with NVDIMM devices cannot migrate because they are pinned to a host.
SELinux currently prevents access to NVDIMM devices in
devdaxmode. As a result, data persistence cannot be guaranteed if the host fails. See BZ1855336.
Avoid using NVDIMM on IBM POWER hardware. This combination is currently not expected to be stable until further work is completed.