[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
[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, 3 months
[libvirt-users] unable to dissect libvirt rpc packets using wireshark plugin
by gowrishankar
Hi,
I am trying libvirt plugin in wireshark to dissect RPC payload in TCP, but
finding dissector code not really working.
My env is Fedora core 21 (x86_64) and installed packages are as follow:
wireshark-1.12.6-1.fc21.x86_64
libvirt-wireshark-1.2.9.3-2.fc21.x86_64
Earlier, just after installation, I noticed libvirt.so available only in
/usr/lib64/wireshark/plugins/1.12.5/ . Wireshark could not load libvirt
plugin.
So, I copied above .so into 1.12.6/ under same plugins folder, following it
wireshark could list libvirt as supported protocol.
tshark -G protocols | grep libvirt
Libvirt libvirt libvirt
However, on checking with some pcaps which has libvirt RPC calls captured on
wire, wireshark does not list libvirt RPC packets, as I search for "libvirt"
protocol in pcap.
Have anyone experienced this before or if you have any pointer that I could
check in my env, that would be very helpful.
--
Regards,
Gowrishankar M
8 years, 7 months
[libvirt-users] Questions about qcow2 file size management
by Jérôme
Hi all.
I have a few questions regarding the qcow2 format.
1/ Allocated size vs. file size
When creating a VM, I indicated a size of 10 G.
$ls -lsh
7,7G -rw------- 1 libvirt-qemu libvirt-qemu 11G oct. 14 10:04
prod.qcow2
The allocated size is lesser than max size. Alright.
I think I more or less grab the difference between allocated size and
file size, but I'm not sure I get the point of the auto-grow feature of
qcow2.
Can someone confirm that if I have, say, a 60Go partition, I can create
more than six 10Go VM, as long as each don't actually use the full 10
Go? Sort of like flying companies selling more tickets than seats in the
plane assuming a few people won't come.
In other words, can I have this on a 60Go drive?
total 53G
7,4G -rw------- 1 root root 11G oct. 8 06:34 prod_151008.qcow2
7,4G -rw------- 1 root root 11G oct. 9 06:37 prod_151009.qcow2
7,5G -rw------- 1 root root 11G oct. 10 06:41 prod_151010.qcow2
7,5G -rw------- 2 root root 11G oct. 11 06:49 prod_151011.qcow2
7,5G -rw------- 1 root root 11G oct. 12 06:44 prod_151012.qcow2
7,5G -rw------- 1 root root 11G oct. 13 06:27 prod_151013.qcow2
7,7G -rw------- 1 root root 11G oct. 14 06:55 prod_151014.qcow2
(Total allocated is 53 < 60 but sum of 11G sizes is 77 G.)
If so, then I guess I get the point.
2/ Backup size
Is there a simple way to do backups that only take the actual allocated
space (7,7 G in my example) instead of the max (10 G)?
I'm using snapshots and blockcommits to backup a VM, thanks to help on
this list. The scripts are on GitHub for anyone interested [1].
Basically, what the script does is snapshot then cp as local backup
file. Then rsync to another backup partition. Both source and
destination partitions are ext4.
Source dir (where I cp the snapshots):
# ls -lsh vmbackup/daily/
total 53G
7,4G -rw------- 1 root root 11G oct. 8 06:34 prod_151008.qcow2
7,4G -rw------- 1 root root 11G oct. 9 06:37 prod_151009.qcow2
7,5G -rw------- 1 root root 11G oct. 10 06:41 prod_151010.qcow2
7,5G -rw------- 2 root root 11G oct. 11 06:49 prod_151011.qcow2
7,5G -rw------- 1 root root 11G oct. 12 06:44 prod_151012.qcow2
7,5G -rw------- 1 root root 11G oct. 13 06:27 prod_151013.qcow2
7,7G -rw------- 1 root root 11G oct. 14 06:55 prod_151014.qcow2
Destination (where rsync copies the files):
# ls -lsh /mnt/usb_hd/vm/vmbackup/daily/
total 71G
11G -rw------- 1 root root 11G oct. 8 06:34 prod_151008.qcow2
11G -rw------- 1 root root 11G oct. 9 06:37 prod_151009.qcow2
11G -rw------- 1 root root 11G oct. 10 06:41 prod_151010.qcow2
11G -rw------- 2 root root 11G oct. 11 06:49 prod_151011.qcow2
11G -rw------- 1 root root 11G oct. 12 06:44 prod_151012.qcow2
11G -rw------- 1 root root 11G oct. 13 06:27 prod_151013.qcow2
11G -rw------- 1 root root 11G oct. 14 06:55 prod_151014.qcow2
Allocated size is as big as file size. This kind of beats the point of
having qcow2 grow as needed.
Ideally, I would like to create VM with a huge max file size, but only
backup the actually used space. How may I achieve this?
I just tested
qemu-img convert -O qcow2 prod_151008.qcow2 prod_151008_resize.qcow2
and I get
7,2G -rw-r--r-- 1 root root 7,2G oct. 14 10:51 prod_151008_resize.qcow2
Seems to work. I could do this before rsyncing.
Is this the recommanded way? Is there a higher level libvirt command to
use instead of qemu-img?
3/ Playing with allocated space
My VM apparently has an allocated size of 7.7 G
7,7G -rw------- 1 libvirt-qemu libvirt-qemu 11G oct. 14 10:04
prod.qcow2
However, loging into it shows much less than 7.7 G is used:
$df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 9.8G 2.0G 7.3G 22% /
udev 10M 0 10M 0% /dev
tmpfs 2.0G 17M 2.0G 1% /run
tmpfs 4.9G 4.0K 4.9G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 4.9G 0 4.9G 0% /sys/fs/cgroup
tmpfs 1003M 0 1003M 0% /run/user/1000
I understand once qcow2 has grown to a given allocated size, it won't
de-allocate space automatically (auto-allocation is one way only).
Perhaps I ended up loading 7Go of files, then those were deleted and now
only 2Go are used but the file still has 7G allocated. Could be, but I
don't see when this might have happened. Could there be another
explanation?
Say I want to minimize allocated space because it is a pity to use 2 Go
and keep 7 Go backups (I know disk space is cheap, this is just an
example), how may I shrink allocated space to currently used space?
I'm not talking about shrinking the file, just minimizing the allocated
size to keep small backups as per former paragraph, still keeping max
file size big to let the VM grow further when needed.
In other words, I'm aiming at
2,7G -rw------- 1 libvirt-qemu libvirt-qemu 11G oct. 14 10:04
prod.qcow2
not at
2,7G -rw------- 1 libvirt-qemu libvirt-qemu 2,7G oct. 14 10:04
prod.qcow2
The guest is a Linux, BTW.
4/ Playing with qcow2 file sizes
Say I've got this file
7,7G -rw------- 1 libvirt-qemu libvirt-qemu 11G oct. 14 10:04
prod.qcow2
I'd like to make it bigger, like
7,7G -rw------- 1 libvirt-qemu libvirt-qemu 100G oct. 14 10:04
prod.qcow2
AFAIU, the steps would be
- power off the VM
- expand the qcow2 file size
- from the host, extend the volume
- power on the VM
- from the guest, extend the filesystem
I've seen various post on the internet but I'm a bit confused and some
posts may be to old to consider new libvirt/qemu possibilities, so I'd
appreciate a safe pointer. (I'm also interested in reducing file size.)
Thanks for any hint.
[1] https://github.com/Jerome-github/vmbackup
--
Jérôme
8 years, 8 months
[libvirt-users] virDomainCoreDumpWithFormat files created as root
by NoxDaFox
Greetings,
I am dumping a guest VM memory for inspection using the command
"virDomainCoreDumpWithFormat" and the created files appear to belong to
root (both user and group).
I have searched around but didn't find any answer. Is there a way to
instruct QEMU to create those files under a different user?
Thank you.
8 years, 9 months
[libvirt-users] changeBegin() on python API
by Ramon Medeiros
Hi,
is changeBegin() working on python? I was trying to use the following
method:
if = conn.interfaceLookupByName("name")
if.undefine()
I saw that changeBegin() does not commit changes, but i can't use it.
--
Ramon Nunes Medeiros
Kimchi Developer
Linux Technology Center Brazil
IBM Systems & Technology Group
Phone : +55 19 2132 7878
ramonn(a)br.ibm.com
8 years, 10 months
[libvirt-users] virDomainMemoryStats missing counters ...
by Jean-Pierre Ribeauville
Hi,
In which libvirt version are these virDomainMemoryStats() counters handled ?
VIR_DOMAIN_MEMORY_STAT_SWAP_OUT
VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT
VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT
VIR_DOMAIN_MEMORY_STAT_UNUSED
VIR_DOMAIN_MEMORY_STAT_AVAILABLE
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, 10 months
[libvirt-users] GUEST Memory statistics secret revealed ...
by Jean-Pierre Ribeauville
Hi,
I'm wondering how to explain following metrics I got from libvirt,
regarding memory stats for the two GUESTS running on my host.
1) virDomainGetXMLDesc() shows these values :
memmax (1024000.000000) memcurrent(1024000.000000)
memmax (2048000.000000) .memcurrent(2048000.000000)
2) As values returned by virDomainMemoryStats(), I got these values :
VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON:
active_balloon (1024000.000000)
active_balloon (2048000.000000)
VIR_DOMAIN_MEMORY_STAT_RSS:
rss(1194195.312500)
rss(2039269.531250
3) By using cgroup counters "memory.usage_in_bytes" for both Guests, I got these values :
memusage (1 207 207 031 250)
memusage (2 834 503 906 250)
How is it possible to have a balloon size equal to memcurrent ?
What "memory.usage_in_bytes" stands for (it's the maximum value of the three metrics I got for each GUEST) ?
FYI , I use a 1.2.8 libvirt.
Thanks.
Reagrds,
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, 10 months