Discussion:
[libvirt-users] Xen via libvirt
Minjun Hong
2018-10-29 18:26:36 UTC
Permalink
Hello.
I want to use libvirt for toolstack of Xen (not XenServer) to set up
Openstack system but,
I'm new to libvirt so, I had some troubles on installing libvirt.

I downloaded the source code, build and installed it, following here (
https://libvirt.org/compiling.html).
However, when I type a command (# virsh 'xen:///system' list) to check if
libvirt has been installed successfully,
I can see an error message:

error: failed to connect to the hypervisor
error: internal error: libxenlight state driver is not active
Name ID Mem VCPUs State
Time(s)
Domain-0 0 95656 32 r-----
5888.0
And I'm wondering why 'Using API' below is QEMU. How can I change that to
Xen ?
Compiled against library: libvirt 4.9.0
Using library: libvirt 4.9.0
Using API: QEMU 4.9.0
Running hypervisor: QEMU 2.11.1
I'm using libvirt 4.9, Xen 4.12 (the current latest) and Linux
kernel 4.16.1.
I want to know how to make the 'libxenlight state driver' active.
Please let me know where I should check first to fix this wrong state, or
any tip is also okay.

Thanks.
Jim Fehlig
2018-10-29 19:57:28 UTC
Permalink
Post by Minjun Hong
Hello.
I want to use libvirt for toolstack of Xen (not XenServer) to set up Openstack
system but,
I'm new to libvirt so, I had some troubles on installing libvirt.
I downloaded the source code, build and installed it, following here
(https://libvirt.org/compiling.html).
However, when I type a command (# virsh 'xen:///system' list) to check if
libvirt has been installed successfully,
error: failed to connect to the hypervisor
error: internal error: libxenlight state driver is not active
It sounds like the libvirt libxl driver failed to load. Are there any related
messages from libvirtd in your syslog or hints in
/var/log/libvirt/libxl/libxl-driver.log?

Regards,
Jim
Minjun Hong
2018-10-30 05:58:36 UTC
Permalink
Post by Minjun Hong
Post by Minjun Hong
Hello.
I want to use libvirt for toolstack of Xen (not XenServer) to set up
Openstack
Post by Minjun Hong
system but,
I'm new to libvirt so, I had some troubles on installing libvirt.
I downloaded the source code, build and installed it, following here
(https://libvirt.org/compiling.html).
However, when I type a command (# virsh 'xen:///system' list) to check
if
Post by Minjun Hong
libvirt has been installed successfully,
error: failed to connect to the hypervisor
error: internal error: libxenlight state driver is not active
It sounds like the libvirt libxl driver failed to load. Are there any related
messages from libvirtd in your syslog or hints in
/var/log/libvirt/libxl/libxl-driver.log?
Regards,
Jim
Thanks for your answer, Jim.

I check the log file you mentioned, but it was empty.
So, I lost my way how to, where to access this problem.
And, by chance, I checked the status of 'libvirtd':

● libvirtd.service - Virtualization daemon
Post by Minjun Hong
Loaded: loaded (/usr/local/lib/systemd/system/libvirtd.service; enabled;
vendor preset: enabled)
Active: active (running) since 2018-10-30 14:47:58 KST; 9s ago
Docs: man:libvirtd(8)
https://libvirt.org
Process: 6029 ExecReload=/bin/kill -HUP $MAINPID (code=exited,
status=0/SUCCESS)
Main PID: 8940 (libvirtd)
Tasks: 20 (limit: 32768)
CGroup: /system.slice/libvirtd.service
├─2217 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf
--leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
├─2221 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf
--leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
└─8940 /usr/local/sbin/libvirtd
node1 systemd[1]: Starting Virtualization daemon...
node1 systemd[1]: Started Virtualization daemon.
node1 libvirtd[8940]: 2018-10-30 05:47:59.010+0000: 8956: info : libvirt
version: 4.9.0
node1
virGetUserID:1041 : invalid argument: Failed to parse user 'tss'
virGetGroupID:1124 : invalid argument: Failed to parse group 'tss'
networkCheckRouteCollision:122 : internal error: Network is already in use
by interface virbr0
I found out a hint.
Actually, I have already done googling regarding this problem so much, but
I do not know what problem is about user 'tss'.
Jim Fehlig
2018-10-30 17:58:52 UTC
Permalink
Post by Minjun Hong
Post by Minjun Hong
Hello.
I want to use libvirt for toolstack of Xen (not XenServer) to set up
Openstack
Post by Minjun Hong
system but,
I'm new to libvirt so, I had some troubles on installing libvirt.
I downloaded the source code, build and installed it, following here
(https://libvirt.org/compiling.html).
However, when I type a command (# virsh 'xen:///system' list) to check if
libvirt has been installed successfully,
     error: failed to connect to the hypervisor
     error: internal error: libxenlight state driver is not active
It sounds like the libvirt libxl driver failed to load. Are there any related
messages from libvirtd in your syslog or hints in
/var/log/libvirt/libxl/libxl-driver.log?
Regards,
Jim
Thanks for your answer, Jim.
I check the log file you mentioned, but it was empty.
Hmm, are you sure you built the libxl driver when configuring/building libvirt?
Did you explicitly specify it when invoking './configure'? E.g. './configure
--with-libxl ...'?

If not explicitly specified the default is to check for xen build requirements.
Do you have the xen development package (e.g. xen-devel) installed? You can
check the summary of the configure output (should also be in your config.log) to
see if building the libxl driver is enabled. You should see 'libxl: yes' under
the Drivers section of the configuration summary.
Post by Minjun Hong
So, I lost my way how to, where to access this problem.
● libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/local/lib/systemd/system/libvirtd.service; enabled;
vendor preset: enabled)
Active: active (running) since 2018-10-30 14:47:58 KST; 9s ago
Docs: man:libvirtd(8)
https://libvirt.org
Process: 6029 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
Main PID: 8940 (libvirtd)
Tasks: 20 (limit: 32768)
CGroup: /system.slice/libvirtd.service
├─2217 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf
--leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
├─2221 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf
--leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
└─8940 /usr/local/sbin/libvirtd
node1 systemd[1]: Starting Virtualization daemon...
node1 systemd[1]: Started Virtualization daemon.
node1 libvirtd[8940]: 2018-10-30 05:47:59.010+0000: 8956: info : libvirt
version: 4.9.0
node1 libvirtd[8940]: 2018-10-30 05:47:59.010+0000: 8956: info : hostname: node1
virGetUserID:1041 : invalid argument: Failed to parse user 'tss'
virGetGroupID:1124 : invalid argument: Failed to parse group 'tss'
networkCheckRouteCollision:122 : internal error: Network is already in use
by interface virbr0
I found out a hint.
Actually, I have already done googling regarding this problem so much, but I do
not know what problem is about user 'tss'.
The missing 'tss' user and group is actually not a problem. In fact, Martin
committed a patch to squelch those errors

https://libvirt.org/git/?p=libvirt.git;a=commit;h=b907fd75fa826a8285dc33fcf6117c7833e2853b

Does the libvirt you're building include that patch?

Regards,
Jim
Minjun Hong
2018-10-31 01:35:26 UTC
Permalink
Post by Minjun Hong
Post by Minjun Hong
Post by Minjun Hong
Hello.
I want to use libvirt for toolstack of Xen (not XenServer) to set
up
Post by Minjun Hong
Openstack
Post by Minjun Hong
system but,
I'm new to libvirt so, I had some troubles on installing libvirt.
I downloaded the source code, build and installed it, following
here
Post by Minjun Hong
Post by Minjun Hong
(https://libvirt.org/compiling.html).
However, when I type a command (# virsh 'xen:///system' list) to
check if
Post by Minjun Hong
Post by Minjun Hong
libvirt has been installed successfully,
error: failed to connect to the hypervisor
error: internal error: libxenlight state driver is not active
It sounds like the libvirt libxl driver failed to load. Are there
any related
Post by Minjun Hong
messages from libvirtd in your syslog or hints in
/var/log/libvirt/libxl/libxl-driver.log?
Regards,
Jim
Thanks for your answer, Jim.
I check the log file you mentioned, but it was empty.
Hmm, are you sure you built the libxl driver when configuring/building libvirt?
Did you explicitly specify it when invoking './configure'? E.g. './configure
--with-libxl ...'?
If not explicitly specified the default is to check for xen build requirements.
Do you have the xen development package (e.g. xen-devel) installed? You can
check the summary of the configure output (should also be in your config.log) to
see if building the libxl driver is enabled. You should see 'libxl: yes' under
the Drivers section of the configuration summary.
Post by Minjun Hong
So, I lost my way how to, where to access this problem.
● libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/local/lib/systemd/system/libvirtd.service;
enabled;
Post by Minjun Hong
vendor preset: enabled)
Active: active (running) since 2018-10-30 14:47:58 KST; 9s ago
Docs: man:libvirtd(8)
https://libvirt.org
Process: 6029 ExecReload=/bin/kill -HUP $MAINPID (code=exited,
status=0/SUCCESS)
Post by Minjun Hong
Main PID: 8940 (libvirtd)
Tasks: 20 (limit: 32768)
CGroup: /system.slice/libvirtd.service
├─2217 /usr/sbin/dnsmasq
--conf-file=/var/lib/libvirt/dnsmasq/default.conf
Post by Minjun Hong
--leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
├─2221 /usr/sbin/dnsmasq
--conf-file=/var/lib/libvirt/dnsmasq/default.conf
Post by Minjun Hong
--leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
└─8940 /usr/local/sbin/libvirtd
node1 systemd[1]: Starting Virtualization daemon...
node1 systemd[1]: Started Virtualization daemon.
libvirt
Post by Minjun Hong
version: 4.9.0
hostname: node1
Post by Minjun Hong
virGetUserID:1041 : invalid argument: Failed to parse user 'tss'
virGetGroupID:1124 : invalid argument: Failed to parse group 'tss'
networkCheckRouteCollision:122 : internal error: Network is already
in use
Post by Minjun Hong
by interface virbr0
I found out a hint.
Actually, I have already done googling regarding this problem so much,
but I do
Post by Minjun Hong
not know what problem is about user 'tss'.
The missing 'tss' user and group is actually not a problem. In fact, Martin
committed a patch to squelch those errors
https://libvirt.org/git/?p=libvirt.git;a=commit;h=b907fd75fa826a8285dc33fcf6117c7833e2853b
Does the libvirt you're building include that patch?
Regards,
Jim
Thanks for your advise.
I found the solution. Cause of the problem was additional install of
libvirt-bin by apt.
I'm not sure what was wrong. But when I set up libvirt on an other server,
there was no problem.
So I guess the additional install might be main reason.
I removed the package and built libvirt source code again. And finally, I
could see it was working well.

And as you mentioned, the other bug about user 'tss' was not critical
problem. That's why I'm just using the libvirt which does not include the
patch.

Thank you so much, Jim

Loading...