[ovirt-users] Reply: Some question about vdsm rpc
lifuqiong
lifuqiong at cncloudsec.com
Wed Jul 27 07:56:14 UTC 2016
Thank you very much for your helpful reply . The error of my question 4 is solved after I stopping debug vdsm code, just using print log info instead.
On Tue, Jul 26, 2016 at 12:46 PM, lifuqiong <lifuqiong at cncloudsec.com> wrote:
> 1. We know that xmlrpc and jsonrpc are enabled default in vdsm, vdsm
> supply these two service in one port or two? What’s the port number
> and how we can change it?
>
We use single port for both protocols. There is a code which peeks the data stream and decides which part of the code should handle the connection.
In config.py you can find 'management_port' option which defines which port will be used.
>
>
> 2. How can we know a vdsm host can supply an xmlrpc service or a
> jsonrpc service?
>
In config.py we have 'xmlrpc_enable' and 'jsonrpc_enable' which determine protocols available during runtime. With the latest vdsm both are enabled but keep in mind that xmlrpc is deprecated and will be removed soon.
>
>
> 3. I found that while ovirt engine installing a vdsm host, engine will
> check whether we are connecting to vdsm which supports xmlrpc only,
> engine send a ‘Host.ping’ jsonrpc request, why the code will enter
> into bindingxmlrpc.py?
>
> Did both jsonrpc and xmlrpc will call bindingxmlrpc.py?
>
During host installation we attempt to connect to a host using jsonrpc first and if it fails we we attempt to use xmlrpc. Older vdsms provide only xmlrpc so this behavior is for backward compatibility.
There are two binding modules bindingjsonrpc.py and bindingxmlrpc.py.
Common module for both bindings is API.py
>
>
> 4. Then, I just get an json return with code = 0 or code = 99. What
> does these error code mean ? I can’t find detail in rpcjson
> Specification(http://www.jsonrpc.org/specification)
>
There is a time when vdsm is not able to handle requests due to recovery logic which may take several seconds during this time we return code 99. Once the recovery is done vdsm returns correct codes like 0.
Recovery occurs only during start of vdsm.
>
>
> 5. When installing vdsm, I got an “Host server117 installation failed.
> Host is not reachable” error. Debugging code as follows:
>
> Bindingxmlrpc.py
>
> line637 def ping(self):
>
> line638 # print 'os.getuid()',os.getuid() = 0
>
> line639 # print 'os.getegit()',os.getegid() =0
>
> line640 api = API.Global()
>
> line641 return api.ping()
>
Can you share the logs with above failure?
>
>
> the api.ping() just open an file and update the file updating time,
> why these will throw an error code 0 or 99? And I see the ping()
> function created file /var/run/vdsm/client.log already exists in os,
>
ping verb was reused to detect whether vdsm is able to use jsonrpc.
This verb originally is used to make sure that any network reconfiguration did not break connection to the engine. During the process of reconfiguration engine call ping and vdsm based on file update time can restore old network configuration in case of failure.
> the only difference is the file is owned by root:root , not the vdsm:kvm?
> Why?
>
There are 2 vdsm processes running with different user permissions.
>
>
> Thank you.
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>
More information about the Users
mailing list