Discussion:
[libvirt-users] How to change the default connection of 'virsh' tool from 'qemu' to 'xen' ?
Minjun Hong
2018-10-31 01:56:56 UTC
Permalink
Hi.

Thanks to help of this mailing list (especially Jim Fehlig), I have
finished setup of libvirt.
However, there is something weird. It is that I installed libvirt on 5
servers but
the default connection of one of them is 'qemu:///' even if those of the
others are all 'xen:///'.

I searched how to change it but, I only found a bypass adding "
LIBVIRT_DEFAULT_URI='xen:///' " in my .bashrc file.
Currently, value of the variable (LIBVIRT_DEFAULT_URI) is set to 'qemu:///'.
Since the bypass makes the virtualization type of the server visible 'qemu'
to the open stack, I have to change libvirt configuration.

I also checked some configure files under '/etc/libvirt', such
as libvirt.conf, libvirtd.conf and libxl.conf.
But I have no idea, how and what to change.
Please give me some advise. It will be a big help for me.

Thanks.
Andrea Bolognani
2018-10-31 08:32:30 UTC
Permalink
Hi.
Thanks to help of this mailing list (especially Jim Fehlig), I have finished setup of libvirt.
However, there is something weird. It is that I installed libvirt on 5 servers but
the default connection of one of them is 'qemu:///' even if those of the others are all 'xen:///'.
You probably installed the QEMU driver on that one server only: if
that's indeed the case, the easiest way to fix the inconsistency
would be to uninstall it.

If that fails...
I searched how to change it but, I only found a bypass adding " LIBVIRT_DEFAULT_URI='xen:///' " in my .bashrc file.
Currently, value of the variable (LIBVIRT_DEFAULT_URI) is set to 'qemu:///'.
Since the bypass makes the virtualization type of the server visible 'qemu' to the open stack, I have to change libvirt configuration.
I also checked some configure files under '/etc/libvirt', such as libvirt.conf, libvirtd.conf and libxl.conf.
But I have no idea, how and what to change.
Please give me some advise. It will be a big help for me.
... you can simply set

uri_default = "xen:///"

in /etc/libvirt/libvirt.conf to change the system-wide default URI
without having to mess with environment variables.
--
Andrea Bolognani / Red Hat / Virtualization
Martin Kletzander
2018-10-31 16:33:09 UTC
Permalink
Post by Andrea Bolognani
Hi.
Thanks to help of this mailing list (especially Jim Fehlig), I have finished setup of libvirt.
However, there is something weird. It is that I installed libvirt on 5 servers but
the default connection of one of them is 'qemu:///' even if those of the others are all 'xen:///'.
You probably installed the QEMU driver on that one server only: if
that's indeed the case, the easiest way to fix the inconsistency
would be to uninstall it.
If that fails...
I searched how to change it but, I only found a bypass adding " LIBVIRT_DEFAULT_URI='xen:///' " in my .bashrc file.
Currently, value of the variable (LIBVIRT_DEFAULT_URI) is set to 'qemu:///'.
Since the bypass makes the virtualization type of the server visible 'qemu' to the open stack, I have to change libvirt configuration.
I also checked some configure files under '/etc/libvirt', such as libvirt.conf, libvirtd.conf and libxl.conf.
But I have no idea, how and what to change.
Please give me some advise. It will be a big help for me.
... you can simply set
uri_default = "xen:///"
in /etc/libvirt/libvirt.conf to change the system-wide default URI
without having to mess with environment variables.
Or in .config/libvirt/libvirt.conf for a non-root user.
Post by Andrea Bolognani
--
Andrea Bolognani / Red Hat / Virtualization
_______________________________________________
libvirt-users mailing list
https://www.redhat.com/mailman/listinfo/libvirt-users
Erik Skultety
2018-11-01 15:40:10 UTC
Permalink
Post by Martin Kletzander
Post by Andrea Bolognani
Hi.
Thanks to help of this mailing list (especially Jim Fehlig), I have finished setup of libvirt.
However, there is something weird. It is that I installed libvirt on 5 servers but
the default connection of one of them is 'qemu:///' even if those of the others are all 'xen:///'.
You probably installed the QEMU driver on that one server only: if
that's indeed the case, the easiest way to fix the inconsistency
would be to uninstall it.
If that fails...
I searched how to change it but, I only found a bypass adding " LIBVIRT_DEFAULT_URI='xen:///' " in my .bashrc file.
Currently, value of the variable (LIBVIRT_DEFAULT_URI) is set to 'qemu:///'.
Since the bypass makes the virtualization type of the server visible 'qemu' to the open stack, I have to change libvirt configuration.
I also checked some configure files under '/etc/libvirt', such as libvirt.conf, libvirtd.conf and libxl.conf.
But I have no idea, how and what to change.
Please give me some advise. It will be a big help for me.
... you can simply set
uri_default = "xen:///"
in /etc/libvirt/libvirt.conf to change the system-wide default URI
without having to mess with environment variables.
Or in .config/libvirt/libvirt.conf for a non-root user.
Alternatively, you can set the following env variable in your .bashrc to the
desired URI:

LIBVIRT_DEFAULT_URI

Erik
Andrea Bolognani
2018-11-01 16:20:46 UTC
Permalink
Post by Erik Skultety
Post by Martin Kletzander
Post by Andrea Bolognani
I searched how to change it but, I only found a bypass adding " LIBVIRT_DEFAULT_URI='xen:///' " in my .bashrc file.
Currently, value of the variable (LIBVIRT_DEFAULT_URI) is set to 'qemu:///'.
Since the bypass makes the virtualization type of the server visible 'qemu' to the open stack, I have to change libvirt configuration.
I also checked some configure files under '/etc/libvirt', such as libvirt.conf, libvirtd.conf and libxl.conf.
But I have no idea, how and what to change.
Please give me some advise. It will be a big help for me.
... you can simply set
uri_default = "xen:///"
in /etc/libvirt/libvirt.conf to change the system-wide default URI
without having to mess with environment variables.
Or in .config/libvirt/libvirt.conf for a non-root user.
Alternatively, you can set the following env variable in your .bashrc to the
LIBVIRT_DEFAULT_URI
... Which, as you can see above, is exactly what OP is already doing
and what they're looking for an alternative to ;)

Also note that, at least as far as I understand, they want to make
sure the xen:/// default URI is picked up by an high-level management
application (in this case OpenStack), which suggests the new default
should be set globally rather than per-user, which is the reason why
I didn't mention the approach Martin suggested.

I still believe the best solution is to just uninstall the QEMU
driver so that everything will work as expected without having to
mess with configuration files at all.

Let's wait for OP to try either approach out and report back :)
--
Andrea Bolognani / Red Hat / Virtualization
Erik Skultety
2018-11-02 07:22:05 UTC
Permalink
Post by Andrea Bolognani
Post by Erik Skultety
Post by Martin Kletzander
Post by Andrea Bolognani
I searched how to change it but, I only found a bypass adding " LIBVIRT_DEFAULT_URI='xen:///' " in my .bashrc file.
Currently, value of the variable (LIBVIRT_DEFAULT_URI) is set to 'qemu:///'.
Since the bypass makes the virtualization type of the server visible 'qemu' to the open stack, I have to change libvirt configuration.
I also checked some configure files under '/etc/libvirt', such as libvirt.conf, libvirtd.conf and libxl.conf.
But I have no idea, how and what to change.
Please give me some advise. It will be a big help for me.
... you can simply set
uri_default = "xen:///"
in /etc/libvirt/libvirt.conf to change the system-wide default URI
without having to mess with environment variables.
Or in .config/libvirt/libvirt.conf for a non-root user.
Alternatively, you can set the following env variable in your .bashrc to the
LIBVIRT_DEFAULT_URI
... Which, as you can see above, is exactly what OP is already doing
and what they're looking for an alternative to ;)
Aaand I obviously should learn again how to read, sorry...
Post by Andrea Bolognani
Also note that, at least as far as I understand, they want to make
sure the xen:/// default URI is picked up by an high-level management
application (in this case OpenStack), which suggests the new default
should be set globally rather than per-user, which is the reason why
Yeah, agreed.

Erik

Loading...