spice options hook

Hi, We're using oVirt 4.3 and want to use spice streaming to better user experience, for example youtube etc. I've tried to use before_vm_start script, but lots of problems came out. 1 - on default environmet, hook script returns of no such file or directory, because python3 does not exist on the system if i install python3, vdsm stops working if change interpreter in the script, vdms retuns rc=0 error code hook=114 and it does not appear on the vm custom properties So, could you help me to run this hook properly we've tested https://github.com/oVirt/vdsm/tree/master/vdsm_hooks/spiceoptions Master and 4.3 branch returns same error code and nothing appeared on the "custom properties" is there anyone who is use it successfully 2 - for this experince is GPU neccessery (not vGPU) , our server has standard 8mb onboard gpu thanks

Hi, On Mon, Apr 20, 2020 at 12:14:28PM -0000, ozmen62@hotmail.com wrote:
Hi, We're using oVirt 4.3 and want to use spice streaming to better user experience, for example youtube etc. I've tried to use before_vm_start script, but lots of problems came out. 1 - on default environmet, hook script returns of no such file or directory, because python3 does not exist on the system if i install python3, vdsm stops working if change interpreter in the script, vdms retuns rc=0 error code hook=114 and it does not appear on the vm custom properties So, could you help me to run this hook properly we've tested https://github.com/oVirt/vdsm/tree/master/vdsm_hooks/spiceoptions Master and 4.3 branch returns same error code and nothing appeared on the "custom properties"
is there anyone who is use it successfully
Sorry, I can't help much on the oVirt hook/setup ...
2 - for this experince is GPU neccessery (not vGPU) , our server has standard 8mb onboard gpu
... but no, you don't need GPU in the host for this feature. Spice streaming in the host supports two encoders: a mjepg implementation in spice and a gstreamer one with support to mjpeg, h264 and vp8. The encoding parameters are hardcoded but I've tested them all in the past and worked well for youtube-like scenarios... but feel free to open bugs upstream if not [0] [0] https://gitlab.freedesktop.org/spice/spice Good luck with the hook. Cheers, Victor

So, can you discribe how can i use streaming method on Ovirt 4.3? do i need to change something on host or engine I need to solve youtube or other video problems Additionally, steraming needs to hardware accelerator, all streaming apps or offers hardware acceletor for best performace thanks

Hi, On Tue, Apr 21, 2020 at 07:42:20AM -0000, ozmen62@hotmail.com wrote:
So, can you discribe how can i use streaming method on Ovirt 4.3?
Looking at the hook you posted earlier: https://github.com/oVirt/vdsm/blob/master/vdsm_hooks/spiceoptions/before_vm_... It needs user to provide the options and for this feature to work streaming=filter or streaming=all must be giving to spice server to enable streaming.
do i need to change something on host or engine I need to solve youtube or other video problems
For mjpeg encoding, you don't need to change anything. For x264/vp8 with GStreamer, spice must be built with GStreamer option enabled. You can check if that's the case for your spice server library by running ldd in the .so file, e.g: spice (master 717ed19a) $ ldd ~/dev/lib64/libspice-server.so | grep -i gst libgstreamer-1.0.so.0 => /lib64/libgstreamer-1.0.so.0 (0x00007f393b57d000) libgstapp-1.0.so.0 => /lib64/libgstapp-1.0.so.0 (0x00007f393b568000) libgstbase-1.0.so.0 => /lib64/libgstbase-1.0.so.0 (0x00007f393b0df000) Plus, you need the plugins for encoding in your host.
Additionally, steraming needs to hardware accelerator, all streaming apps or offers hardware acceletor for best performace
As mentioned earlier, the encoding parameters are hardcoded [0] so, even if you argue that gpu is preferred, that's not currently supported but patches are welcome! [0] https://gitlab.freedesktop.org/spice/spice/-/blob/master/server/gstreamer-en... Video streaming like Youtube, you should get audio sync, lower bandwidth, etc. Cheers, Victor

On Tue, Apr 21, 2020 at 11:10 AM Victor Toso <victortoso@redhat.com> wrote: [snip]
For mjpeg encoding, you don't need to change anything. For x264/vp8 with GStreamer, spice must be built with GStreamer option enabled. You can check if that's the case for your spice server library by running ldd in the .so file, e.g:
spice (master 717ed19a) $ ldd ~/dev/lib64/libspice-server.so | grep -i gst libgstreamer-1.0.so.0 => /lib64/libgstreamer-1.0.so.0 (0x00007f393b57d000) libgstapp-1.0.so.0 => /lib64/libgstapp-1.0.so.0 (0x00007f393b568000) libgstbase-1.0.so.0 => /lib64/libgstbase-1.0.so.0 (0x00007f393b0df000)
Just for reference, - on latest 4.3.9 ovirt node ng [root@ovirt ~]# ldd /usr/lib64/libspice-server.so.1.12.4 | grep -i gst [root@ovirt ~]# - on latest 4.4 beta4 ovirt node ng [root@novirt2 ~]# ldd /usr/lib64/libspice-server.so.1.13.0 | grep -i gst libgstapp-1.0.so.0 => /lib64/libgstapp-1.0.so.0 (0x00007f8b7845f000) libgstvideo-1.0.so.0 => /lib64/libgstvideo-1.0.so.0 (0x00007f8b781c3000) libgstbase-1.0.so.0 => /lib64/libgstbase-1.0.so.0 (0x00007f8b77f4c000) libgstreamer-1.0.so.0 => /lib64/libgstreamer-1.0.so.0 (0x00007f8b77c0c000) [root@novirt2 ~]# Plus, you need the plugins for encoding in your host.
In term of? Packages? How to check? Gianluca

my first problem is hook file. When i add file before_vm_start directory and restart engine, it shows under host hooks file on the web page. But options cannot be displayed under vm custom properties section if i set spiceoptions ; engine-config -s UserDefinedVMProperties=spiceoptions=^.*$ --cver=4.3 engine-config -g UserDefinedVMProperties UserDefinedVMProperties: version: 4.1 UserDefinedVMProperties: version: 4.2 UserDefinedVMProperties: spiceoptions=^.*$ version: 4.3 systemctl restart ovirt-engine after that under vm custom options shows spiceoptions section. But nothing works. according to hook file README, needs to be appear options and youtube became more fluent

Hi, On Tue, Apr 21, 2020 at 11:43:48AM -0000, ozmen62@hotmail.com wrote:
my first problem is hook file. When i add file before_vm_start directory and restart engine, it shows under host hooks file on the web page. But options cannot be displayed under vm custom properties section
if i set spiceoptions ; engine-config -s UserDefinedVMProperties=spiceoptions=^.*$ --cver=4.3
Hm, could you try instead: spiceoptions={'streaming':{'mode':'all'}}
engine-config -g UserDefinedVMProperties UserDefinedVMProperties: version: 4.1 UserDefinedVMProperties: version: 4.2 UserDefinedVMProperties: spiceoptions=^.*$ version: 4.3
I can tell if streaming is enable if you provide qemu cmd line for what is running (e.g: ps aux | grep -i qemu ...)
systemctl restart ovirt-engine
after that under vm custom options shows spiceoptions section. But nothing works. according to hook file README, needs to be appear options and youtube became more fluent
What do you mean with nothing works exactly?

Hi, On Tue, Apr 21, 2020 at 11:45:34AM +0200, Gianluca Cecchi wrote:
On Tue, Apr 21, 2020 at 11:10 AM Victor Toso <victortoso@redhat.com> wrote:
[snip]
For mjpeg encoding, you don't need to change anything. For x264/vp8 with GStreamer, spice must be built with GStreamer option enabled. You can check if that's the case for your spice server library by running ldd in the .so file, e.g:
spice (master 717ed19a) $ ldd ~/dev/lib64/libspice-server.so | grep -i gst libgstreamer-1.0.so.0 => /lib64/libgstreamer-1.0.so.0 (0x00007f393b57d000) libgstapp-1.0.so.0 => /lib64/libgstapp-1.0.so.0 (0x00007f393b568000) libgstbase-1.0.so.0 => /lib64/libgstbase-1.0.so.0 (0x00007f393b0df000)
Just for reference, - on latest 4.3.9 ovirt node ng [root@ovirt ~]# ldd /usr/lib64/libspice-server.so.1.12.4 | grep -i gst [root@ovirt ~]#
- on latest 4.4 beta4 ovirt node ng [root@novirt2 ~]# ldd /usr/lib64/libspice-server.so.1.13.0 | grep -i gst libgstapp-1.0.so.0 => /lib64/libgstapp-1.0.so.0 (0x00007f8b7845f000) libgstvideo-1.0.so.0 => /lib64/libgstvideo-1.0.so.0 (0x00007f8b781c3000) libgstbase-1.0.so.0 => /lib64/libgstbase-1.0.so.0 (0x00007f8b77f4c000) libgstreamer-1.0.so.0 => /lib64/libgstreamer-1.0.so.0 (0x00007f8b77c0c000) [root@novirt2 ~]#
Cool,
Plus, you need the plugins for encoding in your host.
In term of? Packages? How to check?
Gianluca
In terms of packages, that can vary a bit due license/patent code but as quick check, spice's autotools does checks the following: https://gitlab.freedesktop.org/spice/spice/-/blob/master/configure.ac#L93 x264enc element is in gst-plugins-ugly while vp8enc and vp9enc in gst-plugins-good. You can check if you have each of those in the path by running gst-inspect-1.0, eg: $ gst-inspect-1.0 vp8enc | head Factory Details: Rank primary (256) Long-name On2 VP8 Encoder Klass Codec/Encoder/Video Description Encode VP8 video streams Author David Schleef <ds@entropywave.com>, Sebastian Dröge <sebastian.droege@collabora.co.uk> Plugin Details: Name vpx Description VP8 plugin Cheers, Victor
participants (3)
-
Gianluca Cecchi
-
ozmen62@hotmail.com
-
Victor Toso