Skip to content

Expose libvirt disk rotation_rate as an OpenNebula disk attribute #7760

Description

@OpenNebulaSupport

Description

A customer asked whether OpenNebula can expose KVM/libvirt disks to the guest OS as SSD/non-rotational devices.

Libvirt supports the rotation_rate attribute on the disk target. For example:

<disk type='block' device='disk'>
  <driver name='qemu' type='raw' cache='none' io='native' discard='unmap'/>
  <source dev='/dev/vg1/osx'/>
  <target dev='sda' bus='sata' rotation_rate='1'/>
</disk>

With rotation_rate='1', Windows guests can detect the virtual disk as SSD/non-rotational. This can also be useful for Linux guests, since the guest OS can use this information to make better decisions for disk handling and optimization.

At the moment, OpenNebula does not expose this as a supported per-disk template attribute.

Current limitations

The RAW template section is not suitable for this use case. It can append additional XML to the libvirt domain definition, but it does not patch or merge attributes into a specific <disk> element generated by OpenNebula.

Similarly, onevm --raw only appends raw text to the OpenNebula VM template and is not related to patching the generated libvirt XML.

Therefore, there is currently no clean supported way to make OpenNebula generate a disk target such as:

<target dev='sda' bus='scsi' rotation_rate='1'/>

or:

<target dev='sda' bus='sata' rotation_rate='1'/>

Requested feature

Add a supported per-disk attribute, for example:

DISK = [
  IMAGE_ID = "0",
  DEV_PREFIX = "sd",
  ROTATION_RATE = "1"
]

and have the KVM/libvirt deployment generator render it into the corresponding disk target XML:

<target dev='sda' bus='scsi' rotation_rate='1'/>

The exact attribute name can be adjusted, but it should be available per disk rather than globally for the whole VM.

Benefit

This allows guest operating systems to correctly detect virtual disks as SSD/non-rotational where appropriate.

The immediate customer use case is Windows SSD detection, but Linux guests may also benefit from the non-rotational disk information.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions