[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, 2 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, 5 months
[libvirt-users] virDomainBlockInfo for local volume
by Shahar Havivi
Hi,
I am using virStorageVolGetInfo to get the volume size virStorageVol.download to download a
normal file for VDSM project.
I want to add support for block devices as well, I was able to see the size
via virDomainBlockInfo and download via virDomain.blockPeek which is works
fine for both file and block device.
1. Can I depend on virDomainBlockInfo for non block devices?
2. Does the virDomainBlockInfo return the correct physical size for normal file?
3. Performance wise do we have a difference between virStorageVol.download and virDomain.blockPeek?
Assuming the VMs are down, this is the code I intend to use for all formats:
vm = con.lookupByName(options.vmname)
info = vm.blockInfo(src)
physical = info[2]
off = 0
size = 0
with open(dest, 'w+') as f:
while off < physical:
if (physical - off) < bufsize:
size = physical - off
else:
size = bufsize
buf = vm.blockPeek(src, off, size)
f.write(buf)
off += size
7 years, 11 months
[libvirt-users] Understanding and converting between type='drive' and type='pci'
by Leroy Tennison
First, if this isn't the right list please tell me where i should post.
I've searched for an explanation and I'm either searching for the wrong
thing or it's not there. I'm trying to get an understanding of the
"controller='0' bus='0' target='0' unit='0' " parameters for 'drive'
compared to the "domain='0x0000' bus='0x00' slot='0x05' function='0x0' "
parameters for 'pci'. It appears that 'dev hda' to 'dev hdd' is the
maximum associated with 'drive', how many are available with 'pci' and
what are the valid ranges for those parameters?
If I have an xml using 'drive' and want to convert it to 'pci' what do I
need to do? I've had trouble with this when moving disk images between
hypervisors but have never had the time to investigate fully, does it
have to do with how the drives are referenced (/dev/disk/by0id or
/dev/[h|s|v]da as opposed to UUID)?
Thanks for your help.
7 years, 11 months
[libvirt-users] sudo user to access xen server remotely.
by ganesh kg
HI, i am trying to use sudo user to access xen server remotely. As its documented, libvirtd can be accessed only through root user or users from libvirtd usergroup.
is there any tweak or possibility to access libvirt remotely through sudo user? or by using certificate?
code snippet:
#!/usr/bin/env python
import sys
import libvirt
conn = libvirt.open('xen+ssh://sudo_user@xen_server') <== Trying to establish connection to the remote xen using sudo user.
if conn == None:
print('Failed to open connection to xen+ssh:xen_server')
exit(1)
host = conn.getHostname()
print('Hostname:'+host)
conn.close()
exit(0)
7 years, 12 months
[libvirt-users] Routed mode problem with SSH
by Marcelo Palma
Hi guys, I describe the context of the problem below:
I installed a Tor relay on a virtual machine on my server with IP
9.1.1.101. This
virtual machine needs to use a static IP (9.1.1.102) to work as a Tor
relay. After
that I create a virtual network in *Routed mode* to connect to the physical
network (used as a bridge between the virtual machine and the external
network (Internet)).
Since I change the NAT to Routed mode, I can't access my server via ssh
user(a)9.1.1.101.
Will it be a Routed mode problem?
How can I solve this problem?
Thank you
Marcelo
7 years, 12 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.
7 years, 12 months
[libvirt-users] locking domain memory
by Dennis Jacobfeuerborn
Hi,
is there a way to lock a guests memory so it doesn't get swapped out? I
now there is memoryBacking->locked but that says it requires
memtune->hard_limit and the description of that basically "don't ever do
this" rendering the locked element kind of pointless.
How can I prevent the guests memory from being swapped out without
shooting myself in the foot?
Regards,
Dennis
7 years, 12 months
[libvirt-users] NUMA VM and assigning interfaces
by Amir Shehata
Hello,
Hope all is well.
I've been looking at how I can create a virtual machine which is NUMA
capable. I was able to do that by:
140 <qemu:commandline>
143 <qemu:arg value='-numa'/>
144 <qemu:arg value='node'/>
145 <qemu:arg value='-numa'/>
146 <qemu:arg value='node'/>
147 </qemu:commandline>
This creates two NUMA nodes.
Now I would like to assign my virtual network interfaces, of which I have
three, to the different NUMA nodes on the VM.
Anyone know how I can do that? Any help/pointers would be much appreciated.
I'm trying to create a VM that will enable me to test a NUMA based feature.
thanks
amir
7 years, 12 months
[libvirt-users] Fwd: Re: Attach libvirt guest to an existing openvswitch port
by Ivan Borodin
Thank you, Laine for you time and patience to give me a detailed answer.
I missed the interfaceid parameter in the docs, but now I didn't manage
to get it working.
> http://www.libvirt.org/formatdomain.html
The docs state:
"The Open vSwitch type virtualport accepts two parameters in its
<parameters> element - an interfaceid which is a standard uuid used to
uniquely identify this particular interface to Open vSwitch (if you do
not specify one, a random interfaceid will be generated for you when you
first define the interface[...]"
This interfaceid doesn't seem to have anything to do with ovsdb values.
$ ovs-vsctl find Port 'name=vm_test'
_uuid : f0f06327-6fcc-4073-b8c8-3f42944d43ca
bond_downdelay : 0
bond_fake_iface : false
bond_mode : []
bond_updelay : 0
external_ids : {}
fake_bridge : false
interfaces : [eb7fad6e-3728-4bf7-b31e-4a1693e2ec4b]
lacp : []
mac : []
name : "vm_test"
other_config : {}
qos : []
statistics : {}
status : {}
tag : []
trunks : []
vlan_mode : []
The "_uuid" is ovsdb internal id of a record. If you take "interfaces"
value for "interfaceid", libvirt will silently create its own new ovs
port, with its own new uuid and defining a libvirt guest's interface
with a unique uuid in "interfaceid"... Libvirt will create a new ovs
port, and the ovsdb-"interfaces" value will be the interfaceid... And I
could not find anything specific about this ovsdb/Port/interfaces.
Actually, my point was to find a way to control ovs vlans outside
libvirt. Since virsh doesn't have capabilities to edit interface's vlan
options, the only way to do it is editing domains' xml-configs through
virsh-edit, which is a bit tiresome. (By the way, there must be some
technical reason(beyond virt-xml-validate) for designing libvirt writing
it's own configuration files instead of reading them...)
There should be.. There must be a way to do this. Port parameters are
ovs authority. If there is no such way, could you, please, tell me the
reason.
On 11/21/2016 09:46 PM, Laine Stump wrote:
> On 11/13/2016 01:23 PM, Ivan Borodin wrote:
>> Somehow with interface types 'bridge' and 'network', libvirt does attach
>> domain to the existing port specified in <target dev=''/>, wiping the
>> exixting settings and always deletes this port upon domain shutdown,
>> thus making me loose ovs configuration.
7 years, 12 months