[libvirt] libvirt proxy

Hello. I need libvirt proxy, but not simple proxy connection, but something like dedicated libvirt server, that can modify requests or doing something based on incoming request. I'm use go for this, i'm already parse xdr data, but i'm stuck at payload. Where i can find payloads examples or how can i determine needed payload for specific procedure ? (now i'm use wireshark with libvirt dissector). I don't need to provide all libvirt functions, now i need very basic sets like open/close, list, create , destroy domains.. -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru

On Thu, Jun 18, 2015 at 01:55:47AM +0300, Vasiliy Tolstov wrote:
Hello. I need libvirt proxy, but not simple proxy connection, but something like dedicated libvirt server, that can modify requests or doing something based on incoming request. I'm use go for this, i'm already parse xdr data, but i'm stuck at payload. Where i can find payloads examples or how can i determine needed payload for specific procedure ? (now i'm use wireshark with libvirt dissector). I don't need to provide all libvirt functions, now i need very basic sets like open/close, list, create , destroy domains..
FWIW, we really consider the RPC protocol to be a private impl detail and strongly discourage people from trying to re-implement it themselves. Can you explain a bit more about what you're trying to achieve by creating an RPC proxy Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

2015-06-18 12:01 GMT+03:00 Daniel P. Berrange <berrange@redhat.com>:
FWIW, we really consider the RPC protocol to be a private impl detail and strongly discourage people from trying to re-implement it themselves.
Can you explain a bit more about what you're trying to achieve by creating an RPC proxy
I have DO like cloud hosting and want to provide libvirt compat endpoint to create/start/stop servers. -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru

On Thu, Jun 18, 2015 at 11:20 AM, Vasiliy Tolstov <v.tolstov@selfip.ru> wrote:
2015-06-18 12:01 GMT+03:00 Daniel P. Berrange <berrange@redhat.com>:
FWIW, we really consider the RPC protocol to be a private impl detail and strongly discourage people from trying to re-implement it themselves.
Can you explain a bit more about what you're trying to achieve by creating an RPC proxy
I have DO like cloud hosting and want to provide libvirt compat endpoint to create/start/stop servers.
Would a hypervisor driver like the QEMU or Xen drivers in libvirt.git work for you? Instead of writing a libvirt proxy, add a driver for your cloud to libvirt.

On Thu, Jun 18, 2015 at 01:20:59PM +0300, Vasiliy Tolstov wrote:
2015-06-18 12:01 GMT+03:00 Daniel P. Berrange <berrange@redhat.com>:
FWIW, we really consider the RPC protocol to be a private impl detail and strongly discourage people from trying to re-implement it themselves.
Can you explain a bit more about what you're trying to achieve by creating an RPC proxy
I have DO like cloud hosting and want to provide libvirt compat endpoint to create/start/stop servers.
I really discourage anyone from trying to fit the libvirt API over a cloud system. In general the libvirt API is designed to be fairly host-centric. We did once have a libvirt driver that targetted a cloud system, but we deleted it because the libvirt API was a bad fit for case where the concept of individual hosts is hidden from the user. I'd really recommend that any cloud hosting exposes one or more of the common cloud APIs, in particular EC2 compatible API, and possibly an OpenStack compatible API. There are also some projects that attempt to provide a cloud API abstraction layer, in the same way that libvirt provides a host API abstraction layer. eg libcloud, or the (now defunct IIRC) deltacloud. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

2015-06-18 14:13 GMT+03:00 Daniel P. Berrange <berrange@redhat.com>:
I really discourage anyone from trying to fit the libvirt API over a cloud system.
In general the libvirt API is designed to be fairly host-centric. We did once have a libvirt driver that targetted a cloud system, but we deleted it because the libvirt API was a bad fit for case where the concept of individual hosts is hidden from the user.
I'd really recommend that any cloud hosting exposes one or more of the common cloud APIs, in particular EC2 compatible API, and possibly an OpenStack compatible API.
There are also some projects that attempt to provide a cloud API abstraction layer, in the same way that libvirt provides a host API abstraction layer. eg libcloud, or the (now defunct IIRC) deltacloud.
I create after some time ec2 and openstack compat api, but libvirt already have many guis and simple to use via virsh. Also if the proxy code autogenerated from libvirt internals i don't this that this can bring problems. For example Procedures i'm already get from protocol-remote.x, but in case of payloads as i see i need to dig into functions =( -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru

On 18.06.2015 00:55, Vasiliy Tolstov wrote:
Hello. I need libvirt proxy, but not simple proxy connection, but something like dedicated libvirt server, that can modify requests or doing something based on incoming request. I'm use go for this, i'm already parse xdr data, but i'm stuck at payload. Where i can find payloads examples or how can i determine needed payload for specific procedure ? (now i'm use wireshark with libvirt dissector). I don't need to provide all libvirt functions, now i need very basic sets like open/close, list, create , destroy domains..
As Dan says, I too discourage you from doing this. But if you really need to dig into RPC, then: 1) payload is just function arguments serialized. In general, two functions have different set of arguments, and therefore different payloads. 2) The (de-)serializers are generated from .x files, e.g. src/remote/remote_protocol.x 3) There's a wireshark plugin under tools/wireshark/, you may want to check it out. But it's mainly for developers - to see the data passed through RPC tube. Michal

2015-06-19 14:55 GMT+03:00 Michal Privoznik <mprivozn@redhat.com>:
As Dan says, I too discourage you from doing this. But if you really need to dig into RPC, then:
1) payload is just function arguments serialized. In general, two functions have different set of arguments, and therefore different payloads.
2) The (de-)serializers are generated from .x files, e.g. src/remote/remote_protocol.x
3) There's a wireshark plugin under tools/wireshark/, you may want to check it out. But it's mainly for developers - to see the data passed through RPC tube.
Thanks, i'm try to create parser for src/remote/remote_protocol.x to generate payloads struct. -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru
participants (4)
-
Daniel P. Berrange
-
Michal Privoznik
-
Stefan Hajnoczi
-
Vasiliy Tolstov