[libvirt-users] Failure when attaching a device
by Jean-Pierre Ribeauville
Hi,
I'm facing following issue ( or misunderstanding from my side)
I try to attach a device to a running guest ; I want to do it persistently and without having to restart the GUEST .
By using options "-live - persistent" , I got following error :
[root@ldc01omv01 data]# virsh attach-device VM_RHEL7-1 "../data/channel_omnivision_to_be_used.xml" --live --persistent
Please enter your authentication name: root@ldc01omv01
Please enter your password:
error: Failed to attach device from ../data/channel_omnivision_to_be_used.xml
error: Requested operation is not valid: cannot modify device on transient domain
[root@ldc01omv01 data]# virsh -r list --all
Id Name State
----------------------------------------------------
8 VM_RHEL7-2 running
11 W2008R2-2 running
12 VM_RHEL7-1 running
By using options "-live " , I got following error :
[root@ldc01omv01 data]# virsh attach-device VM_RHEL7-1 "../data/channel_omnivision_to_be_used.xml" --live
Please enter your authentication name: root@ldc01omv01
Please enter your password:
error: Failed to attach device from ../data/channel_omnivision_to_be_used.xml
error: Unable to read from monitor: Connection reset by peer
[root@ldc01omv01 data]# virsh -r list --all
Id Name State
----------------------------------------------------
8 VM_RHEL7-2 running
11 W2008R2-2 running
[root@ldc01omv01 data]#
And then the Guest is powered off !!
If I try to attach device when the Guest is off , then :
[root@ldc01omv01 data]# virsh attach-device VM_RHEL7-1 "../data/channel_omnivision_to_be_used_1.xml" --config --persistent
Please enter your authentication name: root@ldc01omv01
Please enter your password:
error: failed to get domain 'VM_RHEL7-1'
error: Domain not found: no domain with matching name 'VM_RHEL7-1'
FYI , xml file contents is :
<channel type='unix'>
<source mode='bind' path='//var/lib/libvirt/qemu/VM_RHEL7-1_omnivision_1.agent'/>
<target type='virtio' name='omnivision_1.agent'/>
</channel>
I'm using libvirt-1.2.17-13.el7.x86_64
Any help is welcome.
Thanks.
Regards,
J.P. Ribeauville
P: +33.(0).1.47.17.20.49
.
Puteaux 3 Etage 5 Bureau 4
jpribeauville(a)axway.com<mailto:jpribeauville@axway.com>
http://www.axway.com<http://www.axway.com/>
P Pensez à l'environnement avant d'imprimer.
8 years, 8 months
Re: [libvirt-users] operation forbidden Read Only Access
by Jean-Pierre Ribeauville
Hi,
I found an answer :
Use virConnectOpenAuth() instead of virConnectOpenReadOnly().
As my piece of code is running silently (without user connected) , by using virConnectOpenAuth() ,
is it possible to avoid to prompt user to get user /password ?
Thx.
J.P.
-----Message d'origine-----
De : libvirt-users-bounces(a)redhat.com [mailto:libvirt-users-bounces@redhat.com] De la part de libvirt-users-request(a)redhat.com
Envoyé : vendredi 8 janvier 2016 12:51
À : libvirt-users(a)redhat.com
Objet : libvirt-users Digest, Vol 73, Issue 6
Send libvirt-users mailing list submissions to
libvirt-users(a)redhat.com
To subscribe or unsubscribe via the World Wide Web, visit
https://www.redhat.com/mailman/listinfo/libvirt-users
or, via email, send a message with subject or body 'help' to
libvirt-users-request(a)redhat.com
You can reach the person managing the list at
libvirt-users-owner(a)redhat.com
When replying, please edit your Subject line so it is more specific than "Re: Contents of libvirt-users digest..."
Today's Topics:
1. Unable to retrieve Guest IP Addresses via libvirt API
(Jean-Pierre Ribeauville)
2. Re: Unable to retrieve Guest IP Addresses via libvirt API
(Martin Kletzander)
3. Re: Unable to retrieve Guest IP Addresses via libvirt API
(Jean-Pierre Ribeauville)
4. Re: libvirtd and polkit: internal error: No Unix Process ID
(Daniel P. Berrange)
5. operation forbidden Read Only Access (Jean-Pierre Ribeauville)
----------------------------------------------------------------------
Message: 1
Date: Thu, 7 Jan 2016 19:31:57 +0000
From: Jean-Pierre Ribeauville <jpribeauville(a)axway.com>
To: "libvirt-users(a)redhat.com" <libvirt-users(a)redhat.com>
Subject: [libvirt-users] Unable to retrieve Guest IP Addresses via
libvirt API
Message-ID:
<1051EFB4D3A1704680C38CCAAC5836D292F01EF8(a)WPTXMAIL2.ptx.axway.int>
Content-Type: text/plain; charset="iso-8859-1"
Hi ,
Despite the fact that my Guest has an IP address , by running this piece of code on a KVM host :
ifaces_count = F_virDomainInterfaceAddresses(domain, &ifaces,VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE, NULL);
ifaces_count = F_virDomainInterfaceAddresses(domain, &ifaces,VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT, NULL);
I'm not able to get a ifaces_count different from -1
Additionnaly :
- IP Addresses are not present within the xmldesc of this Guest.(not sure that they should appear there)
I'm running libvirt-1.2.17-13.el7.x86_64
Did I misunderstood something ?
As ovirt manager shows the address correctly , it should be possible to get it via libvirt ...
Thanks for help.
J.P. Ribeauville
P: +33.(0).1.47.17.20.49
.
Puteaux 3 Etage 5 Bureau 4
jpribeauville(a)axway.com<mailto:jpribeauville@axway.com>
http://www.axway.com<http://www.axway.com/>
P Pensez ? l'environnement avant d'imprimer.
8 years, 8 months
[libvirt-users] centos6.5 libvirt 1.2.14 virsh hang
by 王李明
hi all:
my environment is centos6.5
libvirt version is 1.2.14-1
qemu version is 1.7.0-1
I use openstack create a windows guest
about two days later I run virsh list but the the process is hang
virsh list can not return any thing
it hang
look like this:
then I run /etc/init.d/libvirtd restart
it show libivrtd stop faild and start failed
i will use the gdb and find the gdb can not print any process stack look
like this:
I run /etc/init.d/libvirtd status it show libvired dead but subsys locked
who can help me ?
thans
8 years, 8 months
[libvirt-users] operation forbidden Read Only Access
by Jean-Pierre Ribeauville
Hi,
When issuing virDomainInterfaceAddresses() libvirt C language API, I got following error:
libvirt: Domain Config error : operation forbidden: read only access prevents virDomainInterfaceAddresses
How may I ask for a non-readonly connexion ? ( looks like to be RO by default)
Thx for help.
Regards,
J.P. Ribeauville
P: +33.(0).1.47.17.20.49
.
Puteaux 3 Etage 5 Bureau 4
jpribeauville(a)axway.com<mailto:jpribeauville@axway.com>
http://www.axway.com<http://www.axway.com/>
P Pensez à l'environnement avant d'imprimer.
8 years, 8 months
[libvirt-users] Unable to retrieve Guest IP Addresses via libvirt API
by Jean-Pierre Ribeauville
Hi ,
Despite the fact that my Guest has an IP address , by running this piece of code on a KVM host :
ifaces_count = F_virDomainInterfaceAddresses(domain, &ifaces,VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE, NULL);
ifaces_count = F_virDomainInterfaceAddresses(domain, &ifaces,VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT, NULL);
I'm not able to get a ifaces_count different from -1
Additionnaly :
- IP Addresses are not present within the xmldesc of this Guest.(not sure that they should appear there)
I'm running libvirt-1.2.17-13.el7.x86_64
Did I misunderstood something ?
As ovirt manager shows the address correctly , it should be possible to get it via libvirt ...
Thanks for help.
J.P. Ribeauville
P: +33.(0).1.47.17.20.49
.
Puteaux 3 Etage 5 Bureau 4
jpribeauville(a)axway.com<mailto:jpribeauville@axway.com>
http://www.axway.com<http://www.axway.com/>
P Pensez à l'environnement avant d'imprimer.
8 years, 8 months
[libvirt-users] "INTx fd" busy error on VM startup at boot, subsequent startup okay
by Michael Gratton
Hey all,
I'm getting an error starting a libvirt managed qemu/kvm VM at physical
host boot time, but manually starting it afterwards works fine. This is
on a Ubuntu Wily i7-4790 box running Linux 4.2 and libvirt 1.2.16.
There is a legacy (5V) PCI card being passed through to the VM, the
error seems to relate to that.
The error that always appears at boot in
`/var/log/libvirt/qemu/test-vm.log` is:
> 2016-01-11T05:29:28.487935Z qemu-system-x86_64: -device
> vfio-pci,host=05:00.0,id=hostdev0,bus=pci.0,addr=0x4: vfio: Error:
> Failed to setup INTx fd: Device or resource busy
> 2016-01-11T05:29:28.488148Z qemu-system-x86_64: -device
> vfio-pci,host=05:00.0,id=hostdev0,bus=pci.0,addr=0x4: Device
> initialization failed
> 2016-01-11T05:29:28.488169Z qemu-system-x86_64: -device
> vfio-pci,host=05:00.0,id=hostdev0,bus=pci.0,addr=0x4: Device
> 'vfio-pci' could not be initialized
After the physical machine has completed booting, starting the VM via
virsh or virt-manager works fine.
The card is an old Firewire card. I have blacklisted the firewire
modules on the physical machine so they aren't loaded, but is it
possible that the kernel, udev or some other process still has access
to the device when systemd starts the libvirt-bin service?
Any clues greatly appreciated.
Thanks,
//Mike
--
⊨ Michael Gratton, Percept Wrangler.
⚙ <http://mjog.vee.net/>
8 years, 8 months
[libvirt-users] libvirtd and polkit: internal error: No Unix Process ID
by Benedikt Heine
Hi all,
I want to use libvirtd and polkit to create simple access restricitions for
incoming TLS connections.
libvirtd.conf:
> ...
> auth_tls = "sasl"
> access_drivers = [ "polkit" ]
> ...
>
tls_no_verify_certificate = 1
SASL and TLS in combination is already working without any faults. After
activating access_drivers, the setup breaks, cause the access is denied.
without polkit:
> [root@inexor-test ~]# virsh --connect qemu+tls://vm0.host.b3be.de/system
> Please enter your authentication name: inexor@vm0
> Please enter your password:
> Welcome to virsh, the virtualization interactive terminal.
> ...
with polkit:
> [root@inexor-test ~]# virsh --connect qemu+tls://vm0.host.b3be.de/system
> Please enter your authentication name: inexor@vm0
> Please enter your password:
> error: failed to connect to the hypervisor
> error: access denied
I deactivated any self-written polkit-rules and had been able to track down the
problem to communication with libvirtd and polkit (via pkttyagent).
For every incoming connection, libvirtd logs this:
> Jan 04 15:12:41 vm0 libvirtd[17075]: Unable to verify TLS peer: No certificate
was found.
> Jan 04 15:12:41 vm0 libvirtd[17075]: Certificate check failed Unable to verify
TLS peer: No certificate was found.
> Jan 04 15:12:45 vm0 libvirtd[17075]: internal error: No UNIX process ID
available
> Jan 04 15:12:45 vm0 libvirtd[17075]: access denied
> Jan 04 15:12:45 vm0 libvirtd[17075]: access denied
> Jan 04 15:12:45 vm0 libvirtd[17075]: Cannot recv data: Input/output error
> Jan 04 15:12:47 vm0 libvirtd[17075]: Unable to verify TLS peer: No certificate
was found.
Additionally, what I found: After every libvirtd-restart the unit polkit.service
loggs an Registered and directly after an Unregsitered Auth Agent.
> Jan 04 15:28:29 vm0 polkitd[2670]: Registered Authentication Agent for unix-
process:17225:3691193 (system bus name :1.97 [/usr/bin/pkttyagent --notify-fd 4
--fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale
C)
> Jan 04 15:28:30 vm0 polkitd[2670]: Unregistered Authentication Agent for unix-
process:17225:3691193 (system bus name :1.97, object path
/org/freedesktop/PolicyKit1/AuthenticationAgent, locale C) (disconnected from
bus)
(Correct! In the first second it registers and shortly it unregisteres again)
Could someone please provide me a hint how to make libvirtd and polkit talk to
each other?
Sincerely,
Bene
polkit-version: 0.113
libvirt-version: 1.3.0
Running on Archlinux (init: systemd)
8 years, 8 months
[libvirt-users] remove cdrom after installing os on a guest
by Andrei Perietanu
Hi all,
I have the following issue, and I hope someone know a way to handle it.
I need to grammatically need to create/install a guest OS using the
libvirt API.
Currently what I do:
1. create a xml with the vm configuration (this will include a path to the
iso image)
2. connection.defineXML(<my_config>)
3. vm = connection.lookupByName(<domain_name>)
4. vm.create()
This will create a new guest and boot the iso to install the OS. But after
installation, when I restart, It again boots from the cdrom. So obviously I
need remove the cdrom somehow.
I could edit the xml and manually remove the cdrom, but the problem here is
how do I know when to do that - i.e. how do I know if the OS has been
installed or not?
If I use virsh-install to create a guest with the same configuration, after
the OS is installed, the cdrom is automatically removed form the guest
configuration.
Any help is greatly appreciated.
Andrei
--
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of or
taking of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. If you receive
this in error please contact the sender and delete the material from any
computer immediately. It is the policy of Klas Limited to disavow the
sending of offensive material and should you consider that the material
contained in the message is offensive you should contact the sender
immediately and also your I.T. Manager.
Klas Telecom Inc., a Virginia Corporation with offices at 1101 30th St. NW,
Washington, DC 20007.
Klas Limited (Company Number 163303) trading as Klas Telecom, an Irish
Limited Liability Company, with its registered office at Fourth Floor, One
Kilmainham Square, Inchicore Road, Kilmainham, Dublin 8, Ireland.
8 years, 8 months
[libvirt-users] API for retrieving resource metrics from VMs?
by BYEONG-GI KIM
Hello. I'm a new getting started to learn the libvirt API.
I've tried to find APIs which retrieve resource metrics such as cpu, disk,
memory, and network I/O usages, but I could find few related thing; I was
intended to use libvirt-Java binding first, it seems I'd be better to use
the others like Python binding or C API though. The Java binding API is
likely to provide very limited API list comparing with the above APIs so
far.
So, I'd like to know which APIs can retrieve that resources from VMs. I
don't care about the language, but I really want to know whether such APIs
even exists or not.
As far as I know, cpu, memory, and network I/O seems being provided, but
I'm not sure disk usage per VMs can be obtained via libvirt API.
Thanks in advance.
Best regards
bgkim
8 years, 8 months
[libvirt-users] Efficient live disk backup with active blockcommit : Failed 'block-commit': Could not reopen file: Permission denied
by Keyur Bhalerao
Hi ,
Working on the simple POC : Advanced snapshot using libvirt and qemu .
Following are the exact steps which are followed .
1. Created as base VM - Ubuntu 15.10 with following libvirt and qemu
versions
Using library: libvirt 1.2.16
Using API: QEMU 1.2.16
Running hypervisor: QEMU 2.3.0
QEMU emulator version 2.3.0 (Debian 1:2.3+dfsg-5ubuntu9.1), Copyright
(c) 2003-2008 Fabrice
Bellard
2.Created nested VM (vm-01) using VirtManager on base VM.
3.Used following commands to take the multiple snapshots -
virsh # list
Id Name State
----------------------------------------------------
7 vm-01 running
virsh # domblklist vm-01
Target Source
------------------------------------------------
vda /home/ubuntu/vm-01.img
hda /dev/sr0
snapshot-create-as --domain vm-01 snap1 --diskspec
vda,file=/var/lib/libvirt/sn1.qcow2 --disk-only --atomic
snapshot-create-as --domain vm-01 snap2 --diskspec
vda,file=/var/lib/libvirt/sn2.qcow2 --disk-only --atomic
virsh #snapshot-list vm-01
------------------------------------------------------------
snap1 2015-12-07 11:51:51 -0800 disk-snapshot
snap2 2015-12-07 11:52:28 -0800 disk-snapshot
virsh # snapshot-list vm-01 --tree
snap1
|
+- snap2
List the current block device in use, again. It can be noticed, the new
overlay 'sn2.qcow2' is the current disk in use:
virsh # domblklist vm-01
Target Source
------------------------------------------------
vda /var/lib/libvirt/sn2.qcow2
hda /dev/sr0
Now that the backup is finished, perform active blockcommit by live
mergning contents of sn2 into base:
ubuntu@keyurubuntu:~$ virsh blockcommit vm-01 vda --active --verbose --pivot
error: internal error: unable to execute QEMU command 'block-commit': Could
not reopen file: Permission denied
I am not sure why this is getting as permission denied. I have tried couple
of times reinstalling and creating new VMs . Every time when i have tried
to block-commit getting landed into same error.
Is there any troubleshooting or solution to this issue. Stuck on this issue
for last 2 days.
Quick help much appreciated.
Thanks,
Keyur Bhalerao
Reference used -
http://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit
-
http://kashyapc.com/2012/09/14/externaland-live-snapshots-with-libvirt/
8 years, 8 months