Add custom graphics tags (KVM)

Hi,

In my environment I have set the GRAPHICS parameter as it is explained in the documentation:

https://docs.opennebula.org/5.2/operation/references/template.html#xml-syntax

TYPE: values: vnc, sdl, spice
LISTEN: IP to listen on.
PORT: port for the VNC server
PASSWD: password for the VNC server
KEYMAP: keyboard configuration locale to use in the VNC display
RANDOM_PASSWD: if “YES”, generate a random password for each VM

In my example:

GRAPHICS = [
KEYMAP = “es”,
LISTEN = “0.0.0.0”,
TYPE = “SPICE” ]

I’d like to customize my graphics tag in Deployment.X (xml) to make it look like:

<graphics type='spice' port='5922' autoport='no' listen='0.0.0.0' keymap='es'>
  <listen type='address' address='0.0.0.0'/>
  <image compression='auto_glz'/>
  <streaming mode='filter'/>
</graphics>

It is, add the following tags.

  <image compression='auto_glz'/>
  <streaming mode='filter'/>

I have tried to add the whole in the available RAW parameter, but system raises an error because it is not possible to have 2 spice video devices.

If I delete the GRAPHICS parameter, I can set my custom tag in the RAW parameter, but by this way I have to set “autoport=yes” or assign the spice port manually.

In this scenario,
Is there any way to add raw data to the GRAPHICS template parameter?
If I set the autoport=yes, is there any way to know which port has been assigned to the guest VM?
Is it always the same port, or everytime I power-on the guest the system will assign a new one?

Thanks a lot.

Hi, reading and reading I have found the following document:

https://docs.opennebula.org/5.2/deployment/references/oned_conf.html#virtualization-drivers

Where it looks I can add custom tags in the following file “/etc/one/vmm_exec/vmm_exec_kvm.conf”. Is it possible to add custom parameters on this file?

Hi,

Anybody has been able to configure spice graphics tag?

Thanks a lot.

The graphics part of the deployment file is generated by the C++ core and it can only be changed if you recompile it:

:frowning:

Ok, I will try to recomplie this class in order to add raw data feature:

Is there any consideration about the other questions?

If I set the autoport=yes, is there any way to know which port has been assigned to the guest VM?
Is it always the same port, or everytime I power-on the guest the system will assign a new one?

Thanks a lot.

I think that autoport is just the instance ID + 4000 or so.

Hmmm… No, i don’t think so. When you enable autoport then kvm assigns a free spice port for your vm.

I’d need to know how Opennebula manages this standard process.

PD: the default port assigned by Opennebula is 5900+ID