[libvirt-users] ceph rbd pool and libvirt manageability (virt-install)
by Jelle de Jong
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello everybody,
I created a rbd pool and activated it, but I can't seem to create
volumes in it with virsh or virt-install?
# virsh pool-dumpxml myrbdpool
<pool type='rbd'>
<name>myrbdpool</name>
<uuid>2d786f7a-2df3-4d79-ae60-1535bcf1c6b5</uuid>
<capacity unit='bytes'>6997998301184</capacity>
<allocation unit='bytes'>10309227031</allocation>
<available unit='bytes'>6977204658176</available>
<source>
<host name='ceph01.powercraft.nl' port='6789'/>
<host name='ceph02.powercraft.nl' port='6789'/>
<host name='ceph03.powercraft.nl' port='6789'/>
<name>libvirt-pool</name>
<auth type='ceph' username='libvirt'>
<secret uuid='029a334e-ed57-4293-bb99-ffafa8867122'/>
</auth>
</source>
</pool>
# virt-install --version
1.0.1
# virsh --version
1.2.9
I ended using virsh edit ceph-test.powercraft.nl and making creating
the disk manually.
<disk type='network' device='disk'>
<auth username='libvirt'>
<secret type='ceph' uuid='029a334e-ed57-4293-bb99-ffafa8867122'/>
</auth>
<source protocol='rbd' name='libvirt-pool/kvm01-storage'>
<host name='ceph01.powercraft.nl' port='6789'/>
<host name='ceph02.powercraft.nl' port='6789'/>
<host name='ceph03.powercraft.nl' port='6789'/>
</source>
<target dev='vdc' bus='virtio'/>
</disk>
I use virt-install a lot to define, import and undefine domains, how
can I use virt-install to manage my rdb disks?
Kind regards,
Jelle de Jong
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iJwEAQECAAYFAlV1xlQACgkQ1WclBW9j5HkbPQP+PjNrzvlqysslOp2Yk7wH4Mxy
2sh2dn96G0KOAHEeEn3BN6IWlnD1TADZbHdpTtMwkdv48Xwn0sP1s+3QDM4pb3gP
n+z+dVxS8FouDIy/eiso3IBCj3g4TWbEX8ZHqs3jKqe0lZgAXBzB9xYSUowcEBrZ
ddkPbr8p8ozWyOG+9V8=
=lkK7
-----END PGP SIGNATURE-----
6 years, 3 months
[libvirt-users] virRandomBits - not very random
by Brian Rak
I just ran into an issue where I had about 30 guests get duplicate mac
addresses assigned. These were scattered across 30 different machines.
Some debugging revealed that:
1) All the host machines were restarted within a couple seconds of each
other
2) All the host machines had fairly similar libvirtd pids (within ~100
PIDs of each other)
3) Libvirt seeds the RNG using 'time(NULL) ^ getpid()'
This perfectly explains why I saw so many duplicate mac addresses.
Why is the RNG seed such a predictable value? Surely there has to be a
better source of a random seed then the timestamp and the pid?
The PID seems to me to be a very bad source of any randomness. I just
ran a test across 60 of our hosts. 43 of them shared their PID with at
least one other machine.
6 years, 6 months
[libvirt-users] stream finish throws exception via python API
by Shahar Havivi
Hi,
The following snippet works fine e.g. receiving the data but when calling
stream.finish() we get the following error:
stream = con.newStream()
vol.download(stream, 0, 0, 0)
buf = stream.recv(1024)
stream.finish()
libvirt: I/O Stream Utils error : internal error: I/O helper exited abnormally
Traceback (most recent call last):
File "./helpers/kvm2ovirt", line 149, in <module>
download_volume(vol, item[1], diskno, disksitems, pksize)
File "./helpers/kvm2ovirt", line 102, in download_volume
stream.finish()
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 5501, in finish
if ret == -1: raise libvirtError ('virStreamFinish() failed')
libvirt.libvirtError: internal error: I/O helper exited abnormally
Am I doing something wrong?
Thank you,
Shahar.
8 years
[libvirt-users] Windows guest and virtio serial port
by Tadas
I'm not sure, if it's correct mailing list to post this problem to.
I'm having problems with Windows guest and virtio serial port.
According to this manual:
http://www.spice-space.org/page/Whiteboard/AgentProtocol
I should get a named pipe on my guest VM after I create VirtIO sedial
device and spicevmc channel.
This works without any problems on Linux guest:
ls /dev/virtio-ports/
com.redhat.spice.0
But on Windows guest I can see no such pipe:
PipeList v1.01
by Mark Russinovich
http://www.sysinternals.com
Pipe Name Instances Max
Instances
--------- --------- --------
-----
InitShutdown 3 -1
lsass 4 -1
ntsvcs 3 -1
scerpc 3 -1
Winsock2\CatalogChangeListener-2b8-0 1 1
epmapper 3 -1
Winsock2\CatalogChangeListener-1ac-0 1 1
LSM_API_service 3 -1
TermSrv_API_service 3 -1
Ctx_WinStation_API_service 3 -1
eventlog 3 -1
Winsock2\CatalogChangeListener-174-0 1 1
atsvc 3 -1
wkssvc 6 -1
Winsock2\CatalogChangeListener-16c-0 1 1
SessEnvPublicRpc 3 -1
spoolss 3 -1
Winsock2\CatalogChangeListener-550-0 1 1
trkwks 3 -1
NlaSvcTask 1 -1
srvsvc 5 -1
browser 3 -1
Winsock2\CatalogChangeListener-710-0 1 1
Winsock2\CatalogChangeListener-228-0 1 1
Winsock2\CatalogChangeListener-230-0 1 1
HPUPDMon 1 1
MsFteWds 2 -1
PIPE_EVENTROOT\CIMV2SCM EVENT PROVIDER 1 -1
TDLN-3772-41 1 2
TDLN-3216-41 1 2
virtio serial drivers are installed on Windows guest VM.
What I am missing here?
Thank you.
8 years, 5 months
[libvirt-users] pci slot increases after several times interface attach and detach
by Huanle Han
hi,
I have a question about interface hotplug.
I attach and detach interface from vm for several times. I find the
pci slot of interface increases in live xml while keep unchanged in
config xml. Here is my test script and result:
Test Script:
#!/bin/bash
VM=ub1504b
print_xml() {
echo "$* : ========inactive==========="
virsh dumpxml --inactive $VM |grep -A 20 "<interface" |grep "mac\|slot"
echo "$* : ======== active==========="
virsh dumpxml $VM |grep -A 20 "<interface" |grep "mac\|slot"
}
print_xml begin_
virsh attach-device --config --live $VM if1.xml
print_xml attach
virsh detach-device --config --live $VM if1.xml
print_xml detach
Result:
begin_ : ========inactive===========
<mac address='0c:da:41:1e:02:9c'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
begin_ : ======== active===========
<mac address='0c:da:41:1e:02:9c'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
Device attached successfully
attach : ========inactive===========
<mac address='0c:da:41:1e:02:9c'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
<mac address='0c:da:11:11:11:11'/>
<address type='pci' domain='0x0000' bus='0x00' slot='*0x0c*'
function='0x0'/>
attach : ======== active===========
<mac address='0c:da:41:1e:02:9c'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
<mac address='0c:da:11:11:11:11'/>
<address type='pci' domain='0x0000' bus='0x00' slot='*0x0d*'
function='0x0'/>
Device detached successfully
detach : ========inactive===========
<mac address='0c:da:41:1e:02:9c'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
detach : ======== active===========
<mac address='0c:da:41:1e:02:9c'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
When execute the script for more than 1 times, You can see the pci
slot of attached interface in live xml differs from the one in config
xml.
Is this intentional or a bug ? If not a bug, why?
8 years, 5 months
[libvirt-users] Creating external snapshots with logical volumes.
by Dominique Ramaekers
Hi,
Quick question regarding external snapshots.
Currently, for making backups of my guests, I use external snapshots like this:
virsh snapshot-create-as --domain PCVIRTdra --disk-only --atomic --quiesce --no-metadata --diskspec vda,file=/srv/poolVMS/PCVIRTdra-ONDERHOUD
If I wanted to use a logical volume as destination behind the '--diskspec' option, can I do this like this?
virsh snapshot-create-as --domain PCVIRTdra --disk-only --atomic --quiesce --no-metadata --diskspec vda,file=/dev/CmsrvVH3-vg/PCVIRTdra-ONDERHOUD
It seems to work, but if this is never intended to be used like this, I would rather not...
I ask this question because it seems libvirt is actually recognizing the logical volume as a file:
root@CmsrvVH3:~# virsh domblklist PCVIRTdra --details
Type Device Target Source
------------------------------------------------
file disk vda /dev/CmsrvVH3-vg/PCVIRTdra-ONDERHOUD
file cdrom hdb /srv/poolVMS/Windows10_x64.iso
file cdrom hdc /srv/poolVMS/virtiodrivers.iso
Is there a better way of doing this?
Thanks in advance,
Dominique.
8 years, 6 months
[libvirt-users] block commit failed at 100%
by Ishmael Tsoaela
Hi All,
I am new to libvirt and would appreciated some assistance with libvirt
backups.
I am backing up some VM and coming accross and issue where "Block commit"
does not completely finish, causing libvirt to write to snapshot:
root@xxx:~# virsh blockjob vm
/mnt/diskimage-backups/vm.snap-201606210230.qcow2 --info
Active Block Commit: [100 %]
The state does not change, is the anyway around this ?
libvirtd (libvirt) 1.3.4
QEMU emulator version 2.3.0
8 years, 6 months
[libvirt-users] Problem executing VM backups
by Markus Ellinger
Hi everyone,
we are suddenly having a problem with executing our backup jobs. For a
long time, we have used a shell script which contains the following code
to backup all our virtual machines:
for domain in Testserver Faktura Fileserver Gitolite Jenkins
Nexus SimpleHelp VpnGateway Wiki; do
echo -n "$(date +"%Y-%m-%d %H:%M:%S") starting backup
for vm ${domain} ... " >> ${vmlog}
virsh dumpxml --security-info ${domain} >
${vmdir}/${domain}.xml
virsh undefine ${domain} >> ${vmlog}
virsh blockcopy ${domain}
/var/lib/libvirt/images/${domain}.img ${vmdir}/${domain}.img --wait
--finish >> ${vmlog}
virsh define ${vmdir}/${domain}.xml >> ${vmlog}
done
This has worked great for us, but all of the sudden (eventually
triggered by an update, since of course we do regular security/package
updates on this machine) we are having problems. For some virtual
machines, it still works perfectly, but for others, virsh tells us that
a blockjob is still active and therefore the backup fails. This seems to
happen to machines at random. However, when we then try to query the
active blockjob, virsh tells us that no blockjob is active. Consider the
following log from the shell:
root@gfii-host:~# virsh undefine Gitolite
error: Failed to undefine domain Gitolite
error: Requested operation is not valid: cannot
undefine transient domain
root@gfii-host:~# virsh blockcopy Gitolite
/var/lib/libvirt/images/Gitolite.img /tmp/test-blockcopy-gitolite.img
--wait --finish
error: block copy still active: disk 'vda' already in
active block job
root@gfii-host:~# virsh blockjob Gitolite
/var/lib/libvirt/images/Gitolite.img
No current block job for
/var/lib/libvirt/images/Gitolite.img
root@gfii-host:~# virsh define
/var/local/backup/vms/2016-06-22T013001/Gitolite.xml
error: Failed to define domain from
/var/local/backup/vms/2016-06-22T013001/Gitolite.xml
error: block copy still active: domain has active
block job
Of course we tried to start/stop the virtual machines, rebooted the
whole host multiple times etc., but the problem comes back every night.
The machine is a Debian Wheezy machine with current updates. We are
using the qemu-kvm package from wheezy-backports to enable blockcopy
support.
Best regards
Markus
8 years, 6 months
[libvirt-users] virt-sparsify changing the apparent-size of files
by libvirt_users@skagitattic.com
Hello,
I am curious why when using virt-sparsify the apparent-size of the file
gets reduced to the actual file size? Is there a way to get the
apparent-size left as the full size?
In the man page for virt-sparsify it has a section on
"IMPORTANT NOTE ABOUT SPARSE OUTPUT IMAGES" and its output seems to
indicate what I would expect where "ls -lh" shows the full apparent size
and "du -sh" shows the actual size. But my actual results from testing
are different.
In the following example input.qcow2 is before sparsify and output.qcow2
is after.
Doing ls reports full size for input but a small size for
the output:
root@testingbox:/tmp/test # ls -lh
total 3.1G
-rw-r--r-- 1 root root 512M Jun 14 22:30 file.img
-rw-r--r-- 1 root root 51G Jun 14 22:30 input.qcow2
-rw-r--r-- 1 root root 790M Jun 14 22:36 output.qcow2
Same when asking du for apparent-size:
root@testingbox:/tmp/test # du -h --apparent-size *
512M file.img
51G input.qcow2
790M output.qcow2
A normal du will show the actual size of the files:
root@testingbox:/tmp/test # du -h *
0 file.img
2.4G input.qcow2
790M output.qcow2
The only way I have found to check the full virtual size of the file
after virt-sparsify is with qemu-img:
root@testingbox:/tmp/test # qemu-img info input.qcow2
image: input.qcow2
file format: qcow2
virtual size: 50G (53687091200 bytes)
disk size: 2.3G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: true
root@testingbox:/tmp/test # qemu-img info output.qcow2
image: output.qcow2
file format: qcow2
virtual size: 50G (53687091200 bytes)
disk size: 789M
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
Thanks!
8 years, 6 months
[libvirt-users] Problem with guest cpu feature
by Laurent Pouilloux
Hello libvirt-users,
I have an issue with libvirt on Centos 7.2 regarding CPU features seen
by the Guest OS.
The physical Host is Dell PowerEdge R730 with Haswell CPU, with the
following features
$ grep "model name" /proc/cpuinfo | tail -1
model name : Intel(R) Xeon(R) CPU E5-2640 v3 @ 2.60GHz
$ grep flags /proc/cpuinfo | tail -1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall
nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl
xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor
ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2
x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm
abm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid
fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt
cqm_llc cqm_occup_llc
Regarding libvirt configuration, we have the following features detected :
$ virsh capabilities | grep feature
<feature name='invtsc'/>
<feature name='abm'/>
<feature name='pdpe1gb'/>
<feature name='rdrand'/>
<feature name='f16c'/>
<feature name='osxsave'/>
<feature name='dca'/>
<feature name='pdcm'/>
<feature name='xtpr'/>
<feature name='tm2'/>
<feature name='est'/>
<feature name='smx'/>
<feature name='vmx'/>
<feature name='ds_cpl'/>
<feature name='monitor'/>
<feature name='dtes64'/>
<feature name='pbe'/>
<feature name='tm'/>
<feature name='ht'/>
<feature name='ss'/>
<feature name='acpi'/>
<feature name='ds'/>
<feature name='vme'/>
We have created a VM named that is configured with match="exact"
$ virsh dumpxml compil | grep -A2 match
<cpu mode='custom' match='exact'>
<model fallback='allow'>Haswell-noTSX</model>
</cpu>
However, on the guest side, there no feature such as f16c is detected
$ grep flag /proc/cpuinfo | tail -1
flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc
rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2
x2apic movbe popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm
fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt
Is this normal ?
Should we use match="strict" to have the f16c feature seen by the guest
OS ?
The xml file describing both the host and the guest are in attachment.
$ yum info libvirt
Modules complémentaires chargés : fastestmirror
Loading mirror speeds from cached hostfile
Paquets installés
Nom : libvirt
Architecture : x86_64
Version : 1.2.17
Révision : 13.el7_2.4
Taille : 0.0
Dépôt : installed
Depuis le dépôt : updates
Résumé : Library providing a simple virtualization API
URL : http://libvirt.org/
Licence : LGPLv2+
Description : Libvirt is a C toolkit to interact with the
virtualization capabilities
: of recent versions of Linux (and other OSes). The
main package includes
: the libvirtd server exporting the virtualization
support.
Thanks in advance for any advices we can receive.
Best regards,
Laurent Pouilloux
--
Ingénieur en Calcul Scientifique
Laboratoire de Mécanique des Fluides et d'Acoustique
École Centrale de Lyon
36 Avenue Guy de Collongue, 69130 Écully
Batiment I11 - Bureau 11097W
Tél : 04.72.18.61.57
8 years, 6 months