[libvirt-users] [virtual interface] detach interface during boot succeed with no changes
by Yalan Zhang
Hi guys,
when I detach an interface from vm during boot (vm boot not finished), it
always fail. I'm not sure if there is an existing bug. I have
confirmed with someone that for disk, there is similar behavior, if
this is also acceptable?
# virsh destroy rhel7.2; virsh start rhel7.2 ;sleep 2; virsh
detach-interface rhel7.2 network 52:54:00:98:c4:a0; sleep 2; virsh
dumpxml rhel7.2 |grep /interface -B9
Domain rhel7.2 destroyed
Domain rhel7.2 started
Interface detached successfully
<address type='pci' domain='0x0000' bus='0x00' slot='0x06'
function='0x0'/>
</controller>
<interface type='network'>
<mac address='52:54:00:98:c4:a0'/>
<source network='default' bridge='virbr0'/>
<target dev='vnet0'/>
<model type='rtl8139'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
</interface>
When I detach after the vm boot, expand the sleep time to 10, it will succeed.
# virsh destroy rhel7.2; virsh start rhel7.2 ;sleep 10; virsh
detach-interface rhel7.2 network 52:54:00:98:c4:a0; sleep 2; virsh
dumpxml rhel7.2 |grep /interface -B9
Domain rhel7.2 destroyed
Domain rhel7.2 started
Interface detached successfully
-------
Best Regards,
Yalan Zhang
IRC: yalzhang
Internal phone: 8389413
2 years, 3 months
[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, 4 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, 7 months
[libvirt-users] virDomainSaveImageDefineXML
by llilulu
Hi:
When I make snapshot use virDomainSave,before I resume the snapshot , I use virDomainSaveImageDefineXML change the domain info, like disk path. but I can't change the <devices> , for example detach a disk or interface, Can't tell me what can I change use virDomainSaveImageDefineXML before resume snapshot.
7 years, 2 months
[libvirt-users] domain xml <video> doubt
by llilulu
Hi
My libvirt is 3.4.0,When I create a kvm domain, I use default <video> (type=cirrus, I not set video) create guest(debian9.1.0), but when finish install the guest and reboot, the guest will block in "started update utmp about system runlevel changes", I search on Internet, and find is graphics card problem, I change the <video> type=vga, the problem disppear。The domain xml docs say, I can set type=qxl, ..., but qemu -vga args has other type support, (qemu --help, -vga [std|cirrus|qxl....), I want to know how I use other <video> type in my domain xml.
Thanks very!!!
7 years, 3 months
[libvirt-users] Rollback to running VM
by Jackson, Gary L.
I would like to make a snapshot of a running VM, let it continue to run after the shapshot, and then at some later time roll back the VM to that previous running state. Can I do that with libvirt? If so, how? I understand that this will cause all kinds of havoc with things like ongoing TCP connections, and I accept that risk.
--
Gary Jackson
7 years, 3 months
[libvirt-users] How could I set a VNC server's screen size?
by 刘磊
Dear Libvirt,
How could I set a VNC server’s screen size? I access my virtual machine via NoVNC from web browser, but the desktop’s size is different based on OS. For example, A RHEL5’s screen is about half of RHEL7’s. But it has same graphics configuration. I read the online doc, but I don’t find any to set this. So could you help me? Thanks for your reply.
Best Regards,
Clark Liu
7 years, 3 months
[libvirt-users] How automatically set group.devices.allow for libvirt-lxc container after start ?
by mxs kolo
Hi.
I need to use /dev/ppp inside the lxc container, for very ancient software.
Problem solved this way:
1) virsh edit container name and add section:
<features>
<capabilities policy='default'>
<mknod state='on'/>
</capabilities>
</features>
2) start container
3) attach or ssh container, be root:
#mknod /dev/ppp c 108 0
4) inside container (or from hardware node, no difference) run:
# echo "c 108:0 rwm" >
/sys/fs/cgroup/devices/machine.slice/machine-lxc\\x2d${PID}\\x2d${CONTAINER_NAEM}scope/devices.allow
5) Now pppd work inside lxc:
#pppd call reuters debug nodetach
using channel 1
Using interface ppp0
Connect: ppp0 <--> /dev/pts/2
sent [LCP ConfReq id=0x1 <mru 1000> <asyncmap 0x0> <magic 0x567d90ae>]
...
But such method has several drawbacks.
1) I do not want to give cap_mknod, no need extra holes. With
cap_mknod you can make /de/block_device and using device.allow to give
it the rights rwm.
2) libvirt-lxc has some analog of lxc/lxd options lxc.group.devices.allow ?
lxc.cgroup.devices.allow = c 108:0 rwm
And yes, I need run "mknod" and "echo" each time after container
restart and before start pppd daemon inside.
p.s.
It would be nice specify any device in the xml domain config, for example:
<devices>
<device type='char' maj='108' min='0' allow='rwm' name="/dev/ppp"/>
</devices>
At start libvirt executes mknod and then writes the necessary rights
to cgroups device.allow.
b.r.
Maxim Kozin
7 years, 3 months
[libvirt-users] Re : Libvirt Java Bindings
by Kartik Vaishnav
I am developing a Java Application using Libvirt. I found that the Java
Bindings are not in active development.
I need to obtain the IP Address of the Domain. In C, it may relate to
virDomainInterfaceAddresses. Is there any way to implement it in Java.
7 years, 3 months