[Users] ovirt VM custom properties

This is a multi-part message in MIME format. ------_=_NextPart_001_01CCE126.C779DB35 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable In an effort to work around the mouse issues with spice consoles and certain guests I had an idea for the time being. My thought process is to leverage custom properties to enable usb-tablet support on said guests. --> (http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Virtualization/3.0 /html/Administration_Guide/VDSM_Hooks.html) =20 I perused the available documentation and it appears that these custom properties are ultimately fed into the generated libvirt domain xml. Thus sifting through --> http://libvirt.org/formatdomain.html#elementsInput we can pass in: <devices> <input type=3D'tablet' bus=3D'usb'/ id=3D'input0'> </devices> =20 The issue I am hung up on is that since this contains multi-level elements can this even be specified as a custom property? If so can one of the ovirt developers provide an example on how to go about it? =20 - Chris ------_=_NextPart_001_01CCE126.C779DB35 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html xmlns:v=3D"urn:schemas-microsoft-com:vml" = xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" = xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta = http-equiv=3DContent-Type content=3D"text/html; = charset=3Dus-ascii"><meta name=3DGenerator content=3D"Microsoft Word 12 = (filtered medium)"><style><!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:11.0pt; font-family:"Calibri","sans-serif";} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {mso-style-priority:99; color:purple; text-decoration:underline;} span.EmailStyle17 {mso-style-type:personal-compose; font-family:"Calibri","sans-serif"; color:windowtext;} .MsoChpDefault {mso-style-type:export-only;} @page WordSection1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in;} div.WordSection1 {page:WordSection1;} --></style><!--[if gte mso 9]><xml> <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext=3D"edit"> <o:idmap v:ext=3D"edit" data=3D"1" /> </o:shapelayout></xml><![endif]--></head><body lang=3DEN-US link=3Dblue = vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>In an = effort to work around the mouse issues with spice consoles and certain = guests I had an idea for the time being.<o:p></o:p></p><p = class=3DMsoNormal>My thought process is to leverage custom properties to = enable usb-tablet support on said guests.<o:p></o:p></p><p = class=3DMsoNormal>--> (<a = href=3D"http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Virtualizati= on/3.0/html/Administration_Guide/VDSM_Hooks.html">http://docs.redhat.com/= docs/en-US/Red_Hat_Enterprise_Virtualization/3.0/html/Administration_Guid= e/VDSM_Hooks.html</a>)<o:p></o:p></p><p = class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>I perused = the available documentation and it appears that these custom properties = are ultimately fed into the generated libvirt domain = xml.<o:p></o:p></p><p class=3DMsoNormal>Thus sifting through --> <a = href=3D"http://libvirt.org/formatdomain.html#elementsInput">http://libvir= t.org/formatdomain.html#elementsInput</a> we can pass = in:<o:p></o:p></p><p class=3DMsoNormal><devices><o:p></o:p></p><p = class=3DMsoNormal> <input type=3D'tablet' = bus=3D'usb'/ id=3D'input0'><o:p></o:p></p><p = class=3DMsoNormal></devices><o:p></o:p></p><p = class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>The issue I = am hung up on is that since this contains multi-level elements can this = even be specified as a custom property?<o:p></o:p></p><p = class=3DMsoNormal>If so can one of the ovirt developers provide an = example on how to go about it?<o:p></o:p></p><p = class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>- = Chris<o:p></o:p></p></div></body></html> ------_=_NextPart_001_01CCE126.C779DB35--

----- Original Message -----
From: "Chris Brown (GE Healthcare)" <Christopher.Brown@med.ge.com> To: users@ovirt.org Sent: Wednesday, February 1, 2012 4:16:35 PM Subject: [Users] ovirt VM custom properties
In an effort to work around the mouse issues with spice consoles and certain guests I had an idea for the time being.
My thought process is to leverage custom properties to enable usb-tablet support on said guests.
--> ( http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Virtualization/3.0/html... )
I perused the available documentation and it appears that these custom properties are ultimately fed into the generated libvirt domain xml.
Thus sifting through --> http://libvirt.org/formatdomain.html#elementsInput we can pass in:
<devices>
<input type='tablet' bus='usb'/ id='input0'>
</devices>
The issue I am hung up on is that since this contains multi-level elements can this even be specified as a custom property?
The custom property wouldn't contain the XML it would contain data you want to pass to a hook script eg. addTablet=true, then it's down to your hook script to add the appropriate element to the device node in the libvirt xml. There's a number of good examples in the vdsm git repo.
If so can one of the ovirt developers provide an example on how to go about it?
- Chris _______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

Thanks Andy, I was afraid that might be case ;) I'll check out the examples and see what I can come up with. - Chris -----Original Message----- From: Andrew Cathrow [mailto:acathrow@redhat.com] Sent: Wednesday, February 01, 2012 3:29 PM To: Brown, Chris (GE Healthcare) Cc: users@ovirt.org Subject: Re: [Users] ovirt VM custom properties ----- Original Message -----
From: "Chris Brown (GE Healthcare)" <Christopher.Brown@med.ge.com> To: users@ovirt.org Sent: Wednesday, February 1, 2012 4:16:35 PM Subject: [Users] ovirt VM custom properties
In an effort to work around the mouse issues with spice consoles and certain guests I had an idea for the time being.
My thought process is to leverage custom properties to enable usb-tablet support on said guests.
--> ( http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Virtualization/3. 0/html/Administration_Guide/VDSM_Hooks.html )
I perused the available documentation and it appears that these custom properties are ultimately fed into the generated libvirt domain xml.
Thus sifting through --> http://libvirt.org/formatdomain.html#elementsInput we can pass in:
<devices>
<input type='tablet' bus='usb'/ id='input0'>
</devices>
The issue I am hung up on is that since this contains multi-level elements can this even be specified as a custom property?
The custom property wouldn't contain the XML it would contain data you want to pass to a hook script eg. addTablet=true, then it's down to your hook script to add the appropriate element to the device node in the libvirt xml. There's a number of good examples in the vdsm git repo.
If so can one of the ovirt developers provide an example on how to go about it?
- Chris _______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

Not tested, no error handling (eg. does the element exist already) but ... #!/usr/bin/python import os import sys import hooking import traceback if os.environ.has_key('usbtablet'): try: sys.stderr.write('tablet: adding usbtablet support\n') domxml = hooking.read_domxml() devices = domxml.getElementsByTagName('devices')[0] tablet = domxml.createElement('input') tablet.setAttribute('bus', 'usb') devices.appendChild(tablet) hooking.write_domxml(domxml) except: sys.stderr.write('tablet: [unexpected error]: %s\n' % traceback.format_exc()) sys.exit(2) ----- Original Message -----
From: "Chris Brown (GE Healthcare)" <Christopher.Brown@med.ge.com> To: "Andrew Cathrow" <acathrow@redhat.com> Cc: users@ovirt.org Sent: Wednesday, February 1, 2012 5:20:09 PM Subject: RE: [Users] ovirt VM custom properties
Thanks Andy, I was afraid that might be case ;) I'll check out the examples and see what I can come up with. - Chris
-----Original Message----- From: Andrew Cathrow [mailto:acathrow@redhat.com] Sent: Wednesday, February 01, 2012 3:29 PM To: Brown, Chris (GE Healthcare) Cc: users@ovirt.org Subject: Re: [Users] ovirt VM custom properties
----- Original Message -----
From: "Chris Brown (GE Healthcare)" <Christopher.Brown@med.ge.com> To: users@ovirt.org Sent: Wednesday, February 1, 2012 4:16:35 PM Subject: [Users] ovirt VM custom properties
In an effort to work around the mouse issues with spice consoles and certain guests I had an idea for the time being.
My thought process is to leverage custom properties to enable usb-tablet support on said guests.
--> ( http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Virtualization/3. 0/html/Administration_Guide/VDSM_Hooks.html )
I perused the available documentation and it appears that these custom properties are ultimately fed into the generated libvirt domain xml.
Thus sifting through --> http://libvirt.org/formatdomain.html#elementsInput we can pass in:
<devices>
<input type='tablet' bus='usb'/ id='input0'>
</devices>
The issue I am hung up on is that since this contains multi-level elements can this even be specified as a custom property?
The custom property wouldn't contain the XML it would contain data you want to pass to a hook script eg. addTablet=true, then it's down to your hook script to add the appropriate element to the device node in the libvirt xml. There's a number of good examples in the vdsm git repo.
If so can one of the ovirt developers provide an example on how to go about it?
- Chris _______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

Andy, Many thanks! That got me going the right direction. I did some extensive testing of with this. Here are the changes I made but basically what I do is: - If the user specifies a custom property of usbtablet, just rewrite the input tag with: <input type='tablet' bus='usb'/ id='input0'> This will of course rewrite the existing <input type='mouse' bus='ps2'/> But in this case we know we desire usbtablet so just re-write with what we want. For non problematic guests or guests to which the agent can be installed we simply remove the custom property after the agent is added. For legacy guests all the way back to redhat 7.3 and win98/win2k etc we can simply use usbtablet for now. Once the issues with the mouse input issues with the aforementioned guest types are resolved we again won't need this (hopefully). - Chris #!/usr/bin/python # VDSM Hook Script for RHEV/oVirt # Enables USB tablet support for a guest # use rhevm-config for RHEV or engine-config for oVirt to add UserDefinedVMProperties # EX: rhevm-config -s UserDefinedVMProperties='usbtablet=^(true|false)$' --cver=3.0 # Remember to restart jboss # Use VM custom property usbtablet=true in vm configuration (Custom Properties) import os import sys import hooking import traceback if os.environ.has_key('usbtablet'): try: sys.stderr.write('usbtablet requested\n') domxml = hooking.read_domxml() devices = domxml.getElementsByTagName('devices')[0] inputdev = domxml.getElementsByTagName('input')[0] inputdev.setAttribute('bus', 'usb') inputdev.setAttribute('type', 'tablet') inputdev.setAttribute('id', 'input0') hooking.write_domxml(domxml) sys.stderr.write('usbtablet support enabled\n') except: sys.stderr.write('usbtablet: [unexpected error]: %s\n' % traceback.format_exc()) sys.exit(2) -----Original Message----- From: Andrew Cathrow [mailto:acathrow@redhat.com] Sent: Wednesday, February 01, 2012 5:01 PM To: Brown, Chris (GE Healthcare) Cc: users@ovirt.org Subject: Re: [Users] ovirt VM custom properties Not tested, no error handling (eg. does the element exist already) but ... #!/usr/bin/python import os import sys import hooking import traceback if os.environ.has_key('usbtablet'): try: sys.stderr.write('tablet: adding usbtablet support\n') domxml = hooking.read_domxml() devices = domxml.getElementsByTagName('devices')[0] tablet = domxml.createElement('input') tablet.setAttribute('bus', 'usb') devices.appendChild(tablet) hooking.write_domxml(domxml) except: sys.stderr.write('tablet: [unexpected error]: %s\n' % traceback.format_exc()) sys.exit(2) ----- Original Message -----
From: "Chris Brown (GE Healthcare)" <Christopher.Brown@med.ge.com> To: "Andrew Cathrow" <acathrow@redhat.com> Cc: users@ovirt.org Sent: Wednesday, February 1, 2012 5:20:09 PM Subject: RE: [Users] ovirt VM custom properties
Thanks Andy, I was afraid that might be case ;) I'll check out the examples and see what I can come up with. - Chris
-----Original Message----- From: Andrew Cathrow [mailto:acathrow@redhat.com] Sent: Wednesday, February 01, 2012 3:29 PM To: Brown, Chris (GE Healthcare) Cc: users@ovirt.org Subject: Re: [Users] ovirt VM custom properties
----- Original Message -----
From: "Chris Brown (GE Healthcare)" <Christopher.Brown@med.ge.com> To: users@ovirt.org Sent: Wednesday, February 1, 2012 4:16:35 PM Subject: [Users] ovirt VM custom properties
In an effort to work around the mouse issues with spice consoles and certain guests I had an idea for the time being.
My thought process is to leverage custom properties to enable usb-tablet support on said guests.
--> ( http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Virtualization/3. 0/html/Administration_Guide/VDSM_Hooks.html )
I perused the available documentation and it appears that these custom properties are ultimately fed into the generated libvirt domain xml.
Thus sifting through --> http://libvirt.org/formatdomain.html#elementsInput we can pass in:
<devices>
<input type='tablet' bus='usb'/ id='input0'>
</devices>
The issue I am hung up on is that since this contains multi-level elements can this even be specified as a custom property?
The custom property wouldn't contain the XML it would contain data you want to pass to a hook script eg. addTablet=true, then it's down to your hook script to add the appropriate element to the device node in the libvirt xml. There's a number of good examples in the vdsm git repo.
If so can one of the ovirt developers provide an example on how to go about it?
- Chris _______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

On 02/02/2012 10:51 PM, Brown, Chris (GE Healthcare) wrote:
Andy, Many thanks! That got me going the right direction. I did some extensive testing of with this. Here are the changes I made but basically what I do is: - If the user specifies a custom property of usbtablet, just rewrite the input tag with: <input type='tablet' bus='usb'/ id='input0'> This will of course rewrite the existing<input type='mouse' bus='ps2'/> But in this case we know we desire usbtablet so just re-write with what we want. For non problematic guests or guests to which the agent can be installed we simply remove the custom property after the agent is added. For legacy guests all the way back to redhat 7.3 and win98/win2k etc we can simply use usbtablet for now. Once the issues with the mouse input issues with the aforementioned guest types are resolved we again won't need this (hopefully).
how about formalizing this into a patch for the vdsm custom hooks library?
- Chris
#!/usr/bin/python # VDSM Hook Script for RHEV/oVirt # Enables USB tablet support for a guest # use rhevm-config for RHEV or engine-config for oVirt to add UserDefinedVMProperties # EX: rhevm-config -s UserDefinedVMProperties='usbtablet=^(true|false)$' --cver=3.0 # Remember to restart jboss # Use VM custom property usbtablet=true in vm configuration (Custom Properties)
import os import sys import hooking import traceback
if os.environ.has_key('usbtablet'): try: sys.stderr.write('usbtablet requested\n') domxml = hooking.read_domxml()
devices = domxml.getElementsByTagName('devices')[0] inputdev = domxml.getElementsByTagName('input')[0]
inputdev.setAttribute('bus', 'usb') inputdev.setAttribute('type', 'tablet') inputdev.setAttribute('id', 'input0') hooking.write_domxml(domxml) sys.stderr.write('usbtablet support enabled\n')
except: sys.stderr.write('usbtablet: [unexpected error]: %s\n' % traceback.format_exc()) sys.exit(2)
-----Original Message----- From: Andrew Cathrow [mailto:acathrow@redhat.com] Sent: Wednesday, February 01, 2012 5:01 PM To: Brown, Chris (GE Healthcare) Cc: users@ovirt.org Subject: Re: [Users] ovirt VM custom properties
Not tested, no error handling (eg. does the element exist already) but ...
#!/usr/bin/python
import os import sys import hooking import traceback
if os.environ.has_key('usbtablet'): try: sys.stderr.write('tablet: adding usbtablet support\n') domxml = hooking.read_domxml()
devices = domxml.getElementsByTagName('devices')[0] tablet = domxml.createElement('input') tablet.setAttribute('bus', 'usb')
devices.appendChild(tablet)
hooking.write_domxml(domxml) except: sys.stderr.write('tablet: [unexpected error]: %s\n' % traceback.format_exc()) sys.exit(2)
----- Original Message -----
From: "Chris Brown (GE Healthcare)"<Christopher.Brown@med.ge.com> To: "Andrew Cathrow"<acathrow@redhat.com> Cc: users@ovirt.org Sent: Wednesday, February 1, 2012 5:20:09 PM Subject: RE: [Users] ovirt VM custom properties
Thanks Andy, I was afraid that might be case ;) I'll check out the examples and see what I can come up with. - Chris
-----Original Message----- From: Andrew Cathrow [mailto:acathrow@redhat.com] Sent: Wednesday, February 01, 2012 3:29 PM To: Brown, Chris (GE Healthcare) Cc: users@ovirt.org Subject: Re: [Users] ovirt VM custom properties
----- Original Message -----
From: "Chris Brown (GE Healthcare)"<Christopher.Brown@med.ge.com> To: users@ovirt.org Sent: Wednesday, February 1, 2012 4:16:35 PM Subject: [Users] ovirt VM custom properties
In an effort to work around the mouse issues with spice consoles and certain guests I had an idea for the time being.
My thought process is to leverage custom properties to enable usb-tablet support on said guests.
--> ( http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Virtualization/3. 0/html/Administration_Guide/VDSM_Hooks.html )
I perused the available documentation and it appears that these custom properties are ultimately fed into the generated libvirt domain xml.
Thus sifting through --> http://libvirt.org/formatdomain.html#elementsInput we can pass in:
<devices>
<input type='tablet' bus='usb'/ id='input0'>
</devices>
The issue I am hung up on is that since this contains multi-level elements can this even be specified as a custom property?
The custom property wouldn't contain the XML it would contain data you want to pass to a hook script eg. addTablet=true, then it's down to your hook script to add the appropriate element to the device node in the libvirt xml. There's a number of good examples in the vdsm git repo.
If so can one of the ovirt developers provide an example on how to go about it?
- Chris _______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

Andy, Many thanks! That got me going the right direction. I did some extensive testing of with this. Here are the changes I made but basically what I do is: - If the user specifies a custom property of usbtablet, just rewrite
Itamar, I will take a look through the wiki on code submission (I know I saw a write up on it in there), and figure out how to get this submitted. - Chris -----Original Message----- From: Itamar Heim [mailto:iheim@redhat.com] Sent: Friday, February 03, 2012 4:45 AM To: Brown, Chris (GE Healthcare) Cc: Andrew Cathrow; users@ovirt.org Subject: Re: [Users] ovirt VM custom properties On 02/02/2012 10:51 PM, Brown, Chris (GE Healthcare) wrote: the input tag with:
<input type='tablet' bus='usb'/ id='input0'> This will of course rewrite the existing<input type='mouse' bus='ps2'/> But in this case we know we desire usbtablet so just re-write with what we want. For non problematic guests or guests to which the agent can be installed we simply remove the custom property after the agent is added. For legacy guests all the way back to redhat 7.3 and win98/win2k etc we can simply use usbtablet for now. Once the issues with the mouse input issues with the aforementioned guest types are resolved we again won't need this (hopefully).
how about formalizing this into a patch for the vdsm custom hooks library?
- Chris
#!/usr/bin/python # VDSM Hook Script for RHEV/oVirt # Enables USB tablet support for a guest # use rhevm-config for RHEV or engine-config for oVirt to add UserDefinedVMProperties # EX: rhevm-config -s UserDefinedVMProperties='usbtablet=^(true|false)$' --cver=3.0 # Remember to restart jboss # Use VM custom property usbtablet=true in vm configuration (Custom Properties)
import os import sys import hooking import traceback
if os.environ.has_key('usbtablet'): try: sys.stderr.write('usbtablet requested\n') domxml = hooking.read_domxml()
devices = domxml.getElementsByTagName('devices')[0] inputdev = domxml.getElementsByTagName('input')[0]
inputdev.setAttribute('bus', 'usb') inputdev.setAttribute('type', 'tablet') inputdev.setAttribute('id', 'input0') hooking.write_domxml(domxml) sys.stderr.write('usbtablet support enabled\n')
except: sys.stderr.write('usbtablet: [unexpected error]: %s\n' %
traceback.format_exc())
sys.exit(2)
-----Original Message----- From: Andrew Cathrow [mailto:acathrow@redhat.com] Sent: Wednesday, February 01, 2012 5:01 PM To: Brown, Chris (GE Healthcare) Cc: users@ovirt.org Subject: Re: [Users] ovirt VM custom properties
Not tested, no error handling (eg. does the element exist already) but
...
#!/usr/bin/python
import os import sys import hooking import traceback
if os.environ.has_key('usbtablet'): try: sys.stderr.write('tablet: adding usbtablet support\n') domxml = hooking.read_domxml()
devices = domxml.getElementsByTagName('devices')[0] tablet = domxml.createElement('input') tablet.setAttribute('bus', 'usb')
devices.appendChild(tablet)
hooking.write_domxml(domxml) except: sys.stderr.write('tablet: [unexpected error]: %s\n' %
traceback.format_exc())
sys.exit(2)
----- Original Message -----
From: "Chris Brown (GE Healthcare)"<Christopher.Brown@med.ge.com> To: "Andrew Cathrow"<acathrow@redhat.com> Cc: users@ovirt.org Sent: Wednesday, February 1, 2012 5:20:09 PM Subject: RE: [Users] ovirt VM custom properties
Thanks Andy, I was afraid that might be case ;) I'll check out the examples and see what I can come up with. - Chris
-----Original Message----- From: Andrew Cathrow [mailto:acathrow@redhat.com] Sent: Wednesday, February 01, 2012 3:29 PM To: Brown, Chris (GE Healthcare) Cc: users@ovirt.org Subject: Re: [Users] ovirt VM custom properties
----- Original Message -----
From: "Chris Brown (GE Healthcare)"<Christopher.Brown@med.ge.com> To: users@ovirt.org Sent: Wednesday, February 1, 2012 4:16:35 PM Subject: [Users] ovirt VM custom properties
In an effort to work around the mouse issues with spice consoles and
certain guests I had an idea for the time being.
My thought process is to leverage custom properties to enable usb-tablet support on said guests.
--> (
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Virtualization/3.
0/html/Administration_Guide/VDSM_Hooks.html )
I perused the available documentation and it appears that these custom properties are ultimately fed into the generated libvirt domain xml.
Thus sifting through --> http://libvirt.org/formatdomain.html#elementsInput we can pass in:
<devices>
<input type='tablet' bus='usb'/ id='input0'>
</devices>
The issue I am hung up on is that since this contains multi-level elements can this even be specified as a custom property?
The custom property wouldn't contain the XML it would contain data you want to pass to a hook script eg. addTablet=true, then it's down to your hook script to add the appropriate element to the device node
in the libvirt xml. There's a number of good examples in the vdsm git repo.
If so can one of the ovirt developers provide an example on how to go about it?
- Chris _______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

Something else I thought of on this. While the admin portal allows for custom properties and this works there for the user portal it does not. Thus a power user in the PUP cannot specify this as a custom property. This again would inhibit their ability to interact with and install certain guests. Is there a way we can allow a power user to specify a custom property on a VM w/o admin interaction? - Chris -----Original Message----- From: Brown, Chris (GE Healthcare) Sent: Thursday, February 02, 2012 2:52 PM To: 'Andrew Cathrow' Cc: users@ovirt.org Subject: RE: [Users] ovirt VM custom properties Andy, Many thanks! That got me going the right direction. I did some extensive testing of with this. Here are the changes I made but basically what I do is: - If the user specifies a custom property of usbtablet, just rewrite the input tag with: <input type='tablet' bus='usb'/ id='input0'> This will of course rewrite the existing <input type='mouse' bus='ps2'/> But in this case we know we desire usbtablet so just re-write with what we want. For non problematic guests or guests to which the agent can be installed we simply remove the custom property after the agent is added. For legacy guests all the way back to redhat 7.3 and win98/win2k etc we can simply use usbtablet for now. Once the issues with the mouse input issues with the aforementioned guest types are resolved we again won't need this (hopefully). - Chris #!/usr/bin/python # VDSM Hook Script for RHEV/oVirt # Enables USB tablet support for a guest # use rhevm-config for RHEV or engine-config for oVirt to add UserDefinedVMProperties # EX: rhevm-config -s UserDefinedVMProperties='usbtablet=^(true|false)$' --cver=3.0 # Remember to restart jboss # Use VM custom property usbtablet=true in vm configuration (Custom Properties) import os import sys import hooking import traceback if os.environ.has_key('usbtablet'): try: sys.stderr.write('usbtablet requested\n') domxml = hooking.read_domxml() devices = domxml.getElementsByTagName('devices')[0] inputdev = domxml.getElementsByTagName('input')[0] inputdev.setAttribute('bus', 'usb') inputdev.setAttribute('type', 'tablet') inputdev.setAttribute('id', 'input0') hooking.write_domxml(domxml) sys.stderr.write('usbtablet support enabled\n') except: sys.stderr.write('usbtablet: [unexpected error]: %s\n' % traceback.format_exc()) sys.exit(2) -----Original Message----- From: Andrew Cathrow [mailto:acathrow@redhat.com] Sent: Wednesday, February 01, 2012 5:01 PM To: Brown, Chris (GE Healthcare) Cc: users@ovirt.org Subject: Re: [Users] ovirt VM custom properties Not tested, no error handling (eg. does the element exist already) but ... #!/usr/bin/python import os import sys import hooking import traceback if os.environ.has_key('usbtablet'): try: sys.stderr.write('tablet: adding usbtablet support\n') domxml = hooking.read_domxml() devices = domxml.getElementsByTagName('devices')[0] tablet = domxml.createElement('input') tablet.setAttribute('bus', 'usb') devices.appendChild(tablet) hooking.write_domxml(domxml) except: sys.stderr.write('tablet: [unexpected error]: %s\n' % traceback.format_exc()) sys.exit(2) ----- Original Message -----
From: "Chris Brown (GE Healthcare)" <Christopher.Brown@med.ge.com> To: "Andrew Cathrow" <acathrow@redhat.com> Cc: users@ovirt.org Sent: Wednesday, February 1, 2012 5:20:09 PM Subject: RE: [Users] ovirt VM custom properties
Thanks Andy, I was afraid that might be case ;) I'll check out the examples and see what I can come up with. - Chris
-----Original Message----- From: Andrew Cathrow [mailto:acathrow@redhat.com] Sent: Wednesday, February 01, 2012 3:29 PM To: Brown, Chris (GE Healthcare) Cc: users@ovirt.org Subject: Re: [Users] ovirt VM custom properties
----- Original Message -----
From: "Chris Brown (GE Healthcare)" <Christopher.Brown@med.ge.com> To: users@ovirt.org Sent: Wednesday, February 1, 2012 4:16:35 PM Subject: [Users] ovirt VM custom properties
In an effort to work around the mouse issues with spice consoles and certain guests I had an idea for the time being.
My thought process is to leverage custom properties to enable usb-tablet support on said guests.
--> ( http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Virtualization/3. 0/html/Administration_Guide/VDSM_Hooks.html )
I perused the available documentation and it appears that these custom properties are ultimately fed into the generated libvirt domain xml.
Thus sifting through --> http://libvirt.org/formatdomain.html#elementsInput we can pass in:
<devices>
<input type='tablet' bus='usb'/ id='input0'>
</devices>
The issue I am hung up on is that since this contains multi-level elements can this even be specified as a custom property?
The custom property wouldn't contain the XML it would contain data you want to pass to a hook script eg. addTablet=true, then it's down to your hook script to add the appropriate element to the device node in the libvirt xml. There's a number of good examples in the vdsm git repo.
If so can one of the ovirt developers provide an example on how to go about it?
- Chris _______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

On 02/14/2012 11:29 PM, Brown, Chris (GE Healthcare) wrote:
Something else I thought of on this. While the admin portal allows for custom properties and this works there for the user portal it does not. Thus a power user in the PUP cannot specify this as a custom property. This again would inhibit their ability to interact with and install certain guests. Is there a way we can allow a power user to specify a custom property on a VM w/o admin interaction?
I expect only when we'll develop permissions for them.
- Chris
-----Original Message----- From: Brown, Chris (GE Healthcare) Sent: Thursday, February 02, 2012 2:52 PM To: 'Andrew Cathrow' Cc: users@ovirt.org Subject: RE: [Users] ovirt VM custom properties
Andy, Many thanks! That got me going the right direction. I did some extensive testing of with this. Here are the changes I made but basically what I do is: - If the user specifies a custom property of usbtablet, just rewrite the input tag with: <input type='tablet' bus='usb'/ id='input0'> This will of course rewrite the existing<input type='mouse' bus='ps2'/> But in this case we know we desire usbtablet so just re-write with what we want. For non problematic guests or guests to which the agent can be installed we simply remove the custom property after the agent is added. For legacy guests all the way back to redhat 7.3 and win98/win2k etc we can simply use usbtablet for now. Once the issues with the mouse input issues with the aforementioned guest types are resolved we again won't need this (hopefully).
- Chris
#!/usr/bin/python # VDSM Hook Script for RHEV/oVirt # Enables USB tablet support for a guest # use rhevm-config for RHEV or engine-config for oVirt to add UserDefinedVMProperties # EX: rhevm-config -s UserDefinedVMProperties='usbtablet=^(true|false)$' --cver=3.0 # Remember to restart jboss # Use VM custom property usbtablet=true in vm configuration (Custom Properties)
import os import sys import hooking import traceback
if os.environ.has_key('usbtablet'): try: sys.stderr.write('usbtablet requested\n') domxml = hooking.read_domxml()
devices = domxml.getElementsByTagName('devices')[0] inputdev = domxml.getElementsByTagName('input')[0]
inputdev.setAttribute('bus', 'usb') inputdev.setAttribute('type', 'tablet') inputdev.setAttribute('id', 'input0') hooking.write_domxml(domxml) sys.stderr.write('usbtablet support enabled\n')
except: sys.stderr.write('usbtablet: [unexpected error]: %s\n' % traceback.format_exc()) sys.exit(2)
-----Original Message----- From: Andrew Cathrow [mailto:acathrow@redhat.com] Sent: Wednesday, February 01, 2012 5:01 PM To: Brown, Chris (GE Healthcare) Cc: users@ovirt.org Subject: Re: [Users] ovirt VM custom properties
Not tested, no error handling (eg. does the element exist already) but ...
#!/usr/bin/python
import os import sys import hooking import traceback
if os.environ.has_key('usbtablet'): try: sys.stderr.write('tablet: adding usbtablet support\n') domxml = hooking.read_domxml()
devices = domxml.getElementsByTagName('devices')[0] tablet = domxml.createElement('input') tablet.setAttribute('bus', 'usb')
devices.appendChild(tablet)
hooking.write_domxml(domxml) except: sys.stderr.write('tablet: [unexpected error]: %s\n' % traceback.format_exc()) sys.exit(2)
----- Original Message -----
From: "Chris Brown (GE Healthcare)"<Christopher.Brown@med.ge.com> To: "Andrew Cathrow"<acathrow@redhat.com> Cc: users@ovirt.org Sent: Wednesday, February 1, 2012 5:20:09 PM Subject: RE: [Users] ovirt VM custom properties
Thanks Andy, I was afraid that might be case ;) I'll check out the examples and see what I can come up with. - Chris
-----Original Message----- From: Andrew Cathrow [mailto:acathrow@redhat.com] Sent: Wednesday, February 01, 2012 3:29 PM To: Brown, Chris (GE Healthcare) Cc: users@ovirt.org Subject: Re: [Users] ovirt VM custom properties
----- Original Message -----
From: "Chris Brown (GE Healthcare)"<Christopher.Brown@med.ge.com> To: users@ovirt.org Sent: Wednesday, February 1, 2012 4:16:35 PM Subject: [Users] ovirt VM custom properties
In an effort to work around the mouse issues with spice consoles and certain guests I had an idea for the time being.
My thought process is to leverage custom properties to enable usb-tablet support on said guests.
--> ( http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Virtualization/3. 0/html/Administration_Guide/VDSM_Hooks.html )
I perused the available documentation and it appears that these custom properties are ultimately fed into the generated libvirt domain xml.
Thus sifting through --> http://libvirt.org/formatdomain.html#elementsInput we can pass in:
<devices>
<input type='tablet' bus='usb'/ id='input0'>
</devices>
The issue I am hung up on is that since this contains multi-level elements can this even be specified as a custom property?
The custom property wouldn't contain the XML it would contain data you want to pass to a hook script eg. addTablet=true, then it's down to your hook script to add the appropriate element to the device node in the libvirt xml. There's a number of good examples in the vdsm git repo.
If so can one of the ovirt developers provide an example on how to go about it?
- Chris _______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

I assume the code for the Admin portal and PUP are shared (w/o looking) in regards to editing VM settings. Thus if I understand what you are saying, is that given proper permissions a power user would be able to view/edit the "custom properties". Any thoughts on a way now short of code changes to work around this (this is really a killer for our use cases)? An initial thought I had was to develop something perhaps a custom page (for now) leveraging the API to allow such changes. Ultimately I see three core solutions to this issue: - The spice input/mouse interaction issues are resolved for all guests (old and new) - The UI allows for changes to the type of input device - Power users also have access to custom properties and can just use the vdsm hook instead. Let me know your thoughts. -Chris -----Original Message----- From: Itamar Heim [mailto:iheim@redhat.com] Sent: Wednesday, February 15, 2012 12:58 AM To: Brown, Chris (GE Healthcare) Cc: Andrew Cathrow; users; lpeer >> Livnat Peer Subject: Re: [Users] ovirt VM custom properties On 02/14/2012 11:29 PM, Brown, Chris (GE Healthcare) wrote:
Something else I thought of on this. While the admin portal allows for custom properties and this works there for the user portal it does not. Thus a power user in the PUP cannot specify this as a custom property. This again would inhibit their ability to interact with and install certain guests. Is there a way we can allow a power user to specify a custom property on a VM w/o admin interaction?
- Chris
-----Original Message----- From: Brown, Chris (GE Healthcare) Sent: Thursday, February 02, 2012 2:52 PM To: 'Andrew Cathrow' Cc: users@ovirt.org Subject: RE: [Users] ovirt VM custom properties
Andy, Many thanks! That got me going the right direction. I did some extensive testing of with this. Here are the changes I made but basically what I do is: - If the user specifies a custom property of usbtablet, just rewrite
<input type='tablet' bus='usb'/ id='input0'> This will of course rewrite the existing<input type='mouse' bus='ps2'/> But in this case we know we desire usbtablet so just re-write with what we want. For non problematic guests or guests to which the agent can be installed we simply remove the custom property after the agent is added. For legacy guests all the way back to redhat 7.3 and win98/win2k etc we can simply use usbtablet for now. Once the issues with the mouse input issues with the aforementioned guest types are resolved we again won't need this (hopefully).
- Chris
#!/usr/bin/python # VDSM Hook Script for RHEV/oVirt # Enables USB tablet support for a guest # use rhevm-config for RHEV or engine-config for oVirt to add UserDefinedVMProperties # EX: rhevm-config -s UserDefinedVMProperties='usbtablet=^(true|false)$' --cver=3.0 # Remember to restart jboss # Use VM custom property usbtablet=true in vm configuration (Custom Properties)
import os import sys import hooking import traceback
if os.environ.has_key('usbtablet'): try: sys.stderr.write('usbtablet requested\n') domxml = hooking.read_domxml()
devices = domxml.getElementsByTagName('devices')[0] inputdev = domxml.getElementsByTagName('input')[0]
inputdev.setAttribute('bus', 'usb') inputdev.setAttribute('type', 'tablet') inputdev.setAttribute('id', 'input0') hooking.write_domxml(domxml) sys.stderr.write('usbtablet support enabled\n')
except: sys.stderr.write('usbtablet: [unexpected error]: %s\n' %
I expect only when we'll develop permissions for them. the input tag with: traceback.format_exc())
sys.exit(2)
-----Original Message----- From: Andrew Cathrow [mailto:acathrow@redhat.com] Sent: Wednesday, February 01, 2012 5:01 PM To: Brown, Chris (GE Healthcare) Cc: users@ovirt.org Subject: Re: [Users] ovirt VM custom properties
Not tested, no error handling (eg. does the element exist already) but
...
#!/usr/bin/python
import os import sys import hooking import traceback
if os.environ.has_key('usbtablet'): try: sys.stderr.write('tablet: adding usbtablet support\n') domxml = hooking.read_domxml()
devices = domxml.getElementsByTagName('devices')[0] tablet = domxml.createElement('input') tablet.setAttribute('bus', 'usb')
devices.appendChild(tablet)
hooking.write_domxml(domxml) except: sys.stderr.write('tablet: [unexpected error]: %s\n' %
traceback.format_exc())
sys.exit(2)
----- Original Message -----
From: "Chris Brown (GE Healthcare)"<Christopher.Brown@med.ge.com> To: "Andrew Cathrow"<acathrow@redhat.com> Cc: users@ovirt.org Sent: Wednesday, February 1, 2012 5:20:09 PM Subject: RE: [Users] ovirt VM custom properties
Thanks Andy, I was afraid that might be case ;) I'll check out the examples and see what I can come up with. - Chris
-----Original Message----- From: Andrew Cathrow [mailto:acathrow@redhat.com] Sent: Wednesday, February 01, 2012 3:29 PM To: Brown, Chris (GE Healthcare) Cc: users@ovirt.org Subject: Re: [Users] ovirt VM custom properties
----- Original Message -----
From: "Chris Brown (GE Healthcare)"<Christopher.Brown@med.ge.com> To: users@ovirt.org Sent: Wednesday, February 1, 2012 4:16:35 PM Subject: [Users] ovirt VM custom properties
In an effort to work around the mouse issues with spice consoles and certain guests I had an idea for the time being.
My thought process is to leverage custom properties to enable usb-tablet support on said guests.
--> (
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Virtualization/3.
0/html/Administration_Guide/VDSM_Hooks.html )
I perused the available documentation and it appears that these custom properties are ultimately fed into the generated libvirt domain xml.
Thus sifting through --> http://libvirt.org/formatdomain.html#elementsInput we can pass in:
<devices>
<input type='tablet' bus='usb'/ id='input0'>
</devices>
The issue I am hung up on is that since this contains multi-level elements can this even be specified as a custom property?
The custom property wouldn't contain the XML it would contain data you want to pass to a hook script eg. addTablet=true, then it's down to your hook script to add the appropriate element to the device node in the libvirt xml. There's a number of good examples in the vdsm git repo.
If so can one of the ovirt developers provide an example on how to go about it?
- Chris _______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

On 02/15/2012 05:34 PM, Brown, Chris (GE Healthcare) wrote:
I assume the code for the Admin portal and PUP are shared (w/o looking) in regards to editing VM settings. Thus if I understand what you are saying, is that given proper permissions a power user would be able to view/edit the "custom properties". Any thoughts on a way now short of code changes to work around this (this is really a killer for our use cases)? An initial thought I had was to develop something perhaps a custom page (for now) leveraging the API to allow such changes.
you may have noticed the API allows this, but is limited to admins... you could create a role of admin with limited permissions just like a power user role, and give it to these users. only different from power user portal would be look and feel and the fact they could see VMs of others (and the rest of the entities in the system). my view is the solution to this is to add a feature of permissions to custom properties, which requires making them entities, rather than a string, etc.
Ultimately I see three core solutions to this issue: - The spice input/mouse interaction issues are resolved for all guests (old and new) - The UI allows for changes to the type of input device - Power users also have access to custom properties and can just use the vdsm hook instead.
as a temporary solution, would it hurt your new guests if you make the hook always enable the device? any other field in the vm you could base the decision on by the hook as an interim solution (it can go as hacky as vmname has X in it - hooks don't have to be based on custom properties).
Let me know your thoughts.

I was thinking about the vdsm hook scenario myself but I was stuck in the thinking that hooks could only be invoked via custom properties or before/after vdsm invocation. Thank you for the heads up on that as that could definitely work. That gives me an option down that route for now as well. The other thought I had was to modify the existing GWT code for the user portal. I would just want to recompile/build an rpm for just the user portal which seems to come from ovirt-engine-userportal-<version>.fc16.x86_64 I think I found where the code would need to be altered. *Note in advance Hardware/OS guy attempting to code* Please excuse poor form ;) --> ovirt-engine/frontend/webadmin/modules/userportal/src/main/java/org/ovir t/engine/ui/userportal/client/modalpanels --> file: NewVmModalPanel.java --> lines 76 - 84 --> add: TabButton customPropertiesTabButton; --> lines 100 - 108 --> add: customPropertiesTabButton = new TabButton("Custom Properties", new CustomPropertiesTabPane()); --> lines 622 - 632 --> GWT code to constuct CustomPropertiesTabPane is already there. This should be it unless there is something else I missed.
From there I think I would just need to rebuild the ovirt-engine-userportal RPM with just those changes.
I have a FC16 build env set up per: http://www.ovirt.org/wiki/Building_Ovirt_Engine Any helpful hints to just rebuild only the userportal with just those changes? Build output should ultimately be: ovirt-engine-userportal-<version>.fc16.x86_64.rpm In that manner I can rpm -U ovirt-engine-userportal on the target system. - Chris -----Original Message----- From: Itamar Heim [mailto:iheim@redhat.com] Sent: Wednesday, February 15, 2012 1:46 PM To: Brown, Chris (GE Healthcare) Cc: Andrew Cathrow; users; lpeer >> Livnat Peer Subject: Re: [Users] ovirt VM custom properties On 02/15/2012 05:34 PM, Brown, Chris (GE Healthcare) wrote:
I assume the code for the Admin portal and PUP are shared (w/o looking) in regards to editing VM settings. Thus if I understand what you are saying, is that given proper permissions a power user would be able to view/edit the "custom properties". Any thoughts on a way now short of code changes to work around this (this is really a killer for our use cases)? An initial thought I had was to develop something perhaps a custom page (for now) leveraging the API to allow such changes.
you may have noticed the API allows this, but is limited to admins... you could create a role of admin with limited permissions just like a power user role, and give it to these users. only different from power user portal would be look and feel and the fact they could see VMs of others (and the rest of the entities in the system). my view is the solution to this is to add a feature of permissions to custom properties, which requires making them entities, rather than a string, etc.
Ultimately I see three core solutions to this issue: - The spice input/mouse interaction issues are resolved for all guests
(old and new) - The UI allows for changes to the type of input device - Power users also have access to custom properties and can just use the vdsm hook instead.
as a temporary solution, would it hurt your new guests if you make the hook always enable the device? any other field in the vm you could base the decision on by the hook as an interim solution (it can go as hacky as vmname has X in it - hooks don't have to be based on custom properties).
Let me know your thoughts.
participants (3)
-
Andrew Cathrow
-
Brown, Chris (GE Healthcare)
-
Itamar Heim