libvirt: custom video RAM setting in MB but libvirt xml is in blocks of 1024 bytes

Bug #1373239 reported by Jonas Hagberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Vladik Romanovsky

Bug Description

When using this feature
https://review.openstack.org/#/c/63472/
libvirt: Enable custom video RAM setting

I am setting image meta of image

metadata hw_video_model vga
metadata hw_video_ram 64

As stated "hw_video_ram can be provided via the image properties in Glance.
The value should be provided in MB."
Value should be in MB

also setting flavor-key to
extra_specs | {"hw_video:ram_max_mb": "65"}
Also in MB

Booting an instance the xml of the instance ends up like:

 <video>
      <model type='vga' vram='64' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>

But From
http://libvirt.org/formatdomain.html#elementsVideo
"You can also provide the amount of video memory in kibibytes (blocks of 1024 bytes) using vram and the number of screen with heads."

So this will not give med video ram of 64MB byt 64 bytes.

So if hw_video_ram should be in MB conversion to blocks of 1024 bytes should be done somewhere before output the xml.

Either in
https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py
Or in
https://github.com/openstack/nova/blob/master/nova/virt/libvirt/config.py

Revision history for this message
Sean Dague (sdague) wrote :

Where is the documentation provided? It feels like we should just update the documentation to work in K instead of M instead of changing the code in this case.

Changed in nova:
status: New → Incomplete
Revision history for this message
Jonas Hagberg (jonas-hagberg-k) wrote :
Joe Gordon (jogo)
Changed in nova:
status: Incomplete → Confirmed
Changed in nova:
assignee: nobody → Vladik Romanovsky (vladik-romanovsky)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/131869

Changed in nova:
status: Confirmed → In Progress
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/131869
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=f84fe4b067b12ff0b56cc788057f1726df0feace
Submitter: Jenkins
Branch: master

commit f84fe4b067b12ff0b56cc788057f1726df0feace
Author: Vladik Romanovsky <email address hidden>
Date: Wed Oct 29 16:06:26 2014 -0400

    libvirt: video RAM setting should be passed in kb to libvirt

    Currently, video RAM setting is being set in MB in both
    flavor extra_spec and the image property, however, it is not
    being translated to KB, in the instance XML config.

    Change-Id: Ie1091c08a011d650a7bb0ff0337337ceae7b111b
    Closes-Bug: #1373239

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-1 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.