@Byte0 When xe
utility is running on a XenServer/XCP-ng host itself, without any additional connection related command line parameters, it defaults to using XenAPI Unix socket:
# ls -la /var/xapi/xapi
srwxr-xr-x 1 root root 0 feb 18 11:07 /var/xapi/xapi
Since this socket is owned by root
user and writable only by root
user and only accessible from inside the dom0 system, then it is assumed to be safe and xe
does not require any kind of authentication. xe
can freely send API requests trough the socket.
So can PowerShell module do the same? Possibly, but PowerShell is way less documented than, let's say, Python modules, so I can't tell without looking at the code.
To check it yourself, you will first have to install PowerShell modules on XenServer/XCP-ng itself and make it work in standard way (Connect-XenServer
). Then take a look at PowerShell modules source code to see if there is any trace of support for XenAPI Unix socket. If there is none and you are good with PowerShell, maybe you can add support for Unix socket.
For XenAPI Python modules you can use either http/httpd or unix socket connection.
Update:
A few Googles later. It seems that PowerShell does not have support for Unix sockets at all. It requires some kind of TCP to Unix socket proxy like socat
. So making XenAPI PowerShell modules work over Unix socket could be non trivial undertaking and some considerable hacking would be required.