[libvirt-users] signal for shutdown in lxc driver
by Boris Savelev
Hello!
Try to use libvirt with lxc.
I use latest centos6 amd64 as a libvirt host (libvirt from xen4 repo)
libvirt-daemon-1.2.15-3.el6.x86_64
In container I also use latest centos6 amd64. Container starts with
/sbin/init. CentOS 6 came with upstart as default init.
My problem is that I could not shutdown container correctly with libvirt.
virsh -c lxc:/// shutdown test
Domain test is being shutdown
In container I see only:
"init: Re-executing /sbin/init"
in syslog messages
Why it is happened?
lxcDomainShutdownFlags [1] send SIGTERM to initpid. Upstart got it and
reloaded himself instead shutdown. It's default behavior... [2]
The question is why libvirt send SIGTERM? As I can see lxc-stop [3]
send SIGPWR (that works correctly with upstart) and also have ability
to change default signals.
I can understand that when container start with some script not
/sbin/init that handle SIGTERM this situation is ok. But then
container use /sbin/init it is not.
So, is this a bug?-)
[1] https://github.com/libvirt/libvirt/blob/master/src/lxc/lxc_driver.c#L3681
[2] https://bazaar.launchpad.net/~upstart-devel/upstart/trunk/view/head:/init...
[3] http://man7.org/linux/man-pages/man1/lxc-stop.1.html
--
Boris
9 years, 1 month
[libvirt-users] Issues with libvirt virtual networking
by Joshua Atkinson
Hello all,
I am having issues getting my virtual network to work correctly. As of
current, I have set up a virtual network with virt-manager, using the
routed mode to forward network traffic. I have found guests can
see/ping themselves, the host's virtual IP and the host's real IP, but
nothing else. Guests fail to see any other device on the real network
or the internet.
My host is Arch Linux on Linux 4.2.5-1 with the VFIO kernel, and runs
a QEMU/KVM hypervisor. My main guest runs a new install of Windows 10,
with the virtio network interface.
I have only one virtual network configured, and no network interfaces
configured in virt-manager. Does anyone know why my VMs cannot see
anything other than themselves and the host?
My iptables rules (entirely set by libvirt):
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:bootps
ACCEPT tcp -- anywhere anywhere tcp dpt:bootps
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere 192.168.100.0/24
ACCEPT all -- 192.168.100.0/24 anywhere
ACCEPT all -- anywhere anywhere
REJECT all -- anywhere anywhere
reject-with icmp-port-unreachable
REJECT all -- anywhere anywhere
reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:bootpc
Output of "brctl show"
bridge name bridge id STP enabled interfaces
virbr0 8000.52540012f3ab yes virbr0-nic
Output of "ip addr":
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel
state UP group default qlen 1000
link/ether 90:2b:34:68:84:c0 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.8/24 brd 192.168.1.255 scope global enp5s0
valid_lft forever preferred_lft forever
inet6 fe80::922b:34ff:fe68:84c0/64 scope link
valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue
state DOWN group default
link/ether 52:54:00:12:f3:ab brd ff:ff:ff:ff:ff:ff
inet 192.168.100.1/24 brd 192.168.100.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master
virbr0 state DOWN group default qlen 500
link/ether 52:54:00:12:f3:ab brd ff:ff:ff:ff:ff:ff
Many Thanks,
Josh
9 years, 1 month
[libvirt-users] Vm not booting up after manual migration
by Sakhi Hadebe
Hi,
I have two hosts installed with libvirt. We have just installed a latest
version of libvirt on one of the hosts, version
Compiled against library: libvirt 1.2.16
Using library: libvirt 1.2.16
Using API: QEMU 1.2.16
Running hypervisor: QEMU 2.3.0
The host hosting all our virtual machines runs an older version
Compiled against library: libvirt 1.2.2
Using library: libvirt 1.2.2
Using API: QEMU 1.2.2
Running hypervisor: QEMU 2.0.0
I am now trying to manually migrate virtual machines to the host with the
newest version of libvirt. I have copied the qcow2, img, and xml files of
all the virtual machines to this host.
The problem I am encounting is that the newer version uses "Host device
eno1:macvtap" network source for its virtual interface, whisch is not the
same as "Host device vnet18 (Bridge "br0")" in the older version. Not sure
if this is something \i have to worry about.
I have manuall copied all the files across, but when booting up the vm on
the newset version ost it hangs up before booting (see screenshot attached).
Please help me to fully boot up into this virtual machine.
--
Regards,
Sakhi Hadebe
Engineer: South African National Research Network (SANReN)Competency
Area, Meraka, CSIR
Tel: +27 12 841 2308 <+27128414213>
Fax: +27 12 841 4223 <+27128414223>
Cell: +27 71 331 9622 <+27823034657>
Email: sakhi(a)sanren.ac.za <shadebe(a)csir.co.za>
9 years, 1 month
[libvirt-users] blockcopy pauses vm
by Fırat KÜÇÜK
Hello,
I want to live migrate qcow disk image.
virsh snapshot-create-as --domain my-vm migration-snapshot \
--diskspec vda,file=/opt/n0-n1/my-vm-snapshot.img \
--disk-only --atomic --no-metadata
virsh undefine my-vm
virsh blockcopy --domain my-vm vda \
/opt/n0-n1/my-vm.img \
--wait --verbose --timeout 3600
I check the copy status with "virsh blockjob my-vm vda". After %92 VM
pauses and I cannot resume it.
9 years, 1 month
[libvirt-users] regard limiting network bandwidth
by asw Anose
hi all
i am a kvm , qemu user newbie , i am using libvirt and virsh to mange my KVM VMs , i want to limit the network bandwidth of each VM , i come across libvirt xml format option :
<forward mode='nat' dev='eth0'/>
<bandwidth>
<inbound average='1000' peak='5000' burst='5120'/>
<outbound average='128' peak='256' burst='256'/>
</bandwidth>to limit the bandwidth of each vm , however i have a question how does these option applied limit on kvm vm ? through using of linux cgroub or its a qemu network bandwidth limit functionality ?
9 years, 1 month
[libvirt-users] "Allocate entire disk now" with an existing virtual disk
by Boylan, Ross
Have I just overwritten some of my virtual drive, and if so, is there a way to recover?
On a linux host I use LVM logical volumes as the backing for my virtual disks. Using the Virtual Machine Manager 0.9.1 GUI I did this:
1. select source machine, go into details, select virtual disk and removed the hardware.
2. select destination machine, go into details, add storage.
3. click "select managed or other existing storage"
4. click the browser button under it, and select the volume detached from the source machine
5. set device type to virtio.
6. click finish.
Both VM's were off, and the source VM used virtio also. KVM is the hypervisor.
There were actually 2 drives, and so I repeated the steps above twice, except that the second time I clicked on "Allocate entire disk now", which deselected it (I hope) before step 6. The destination machine already had disks.
So, did I just overwrite one of the disks? If so, is there a way to recover?
The reason I suspect a problem is that, although the partition tables appear intact on both virtual drives, the filesystem does not. Within the virtual machine 1 partition from each drive is combined in a volume group. The main logical volume group on that fails to mount:
root@jessie01:~# mount -o ro /dev/markov02/root /mnt/markov02
mount: wrong fs type, bad option, bad superblock on /dev/mapper/markov02-root,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
and e2fsck says
root@jessie01:~# e2fsck /dev/markov02/root
e2fsck 1.42.12 (29-Aug-2014)
/dev/markov02/root: recovering journal
Superblock needs_recovery flag is clear, but journal has data.
It's possible this has nothing to do with the option to allocate the entire disk, since the source VM was having problems anyway (that's why I moved the disks). However, I'm pretty sure I was able to access the filesystem both in the source VM and in an earlier round when I move the disks to the destination.
Thanks.
Ross Boylan
9 years, 1 month
[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.
9 years, 1 month
[libvirt-users] Add host
by Sakhi Hadebe
Hi,
I have two host machines both installed with libvirt and virt-manager,
which provides me with GUI. I have virtual machines running in one of the
host.
Now I want to migrate some of the virtual machines to the other machines. I
am trying to migrate using the Virtual Machine Manager. When I select
migrate, it pops up a window to choose the new host. The dropdown menu to
choose the new host for the virtual machine is empty.
How do you add the new host to the other, so they can know each other? Does
it require a clustering software to achieve that?
I need some assistance in that regard
--
Regards,
Sakhi Hadebe
Engineer: South African National Research Network (SANReN)Competency
Area, Meraka, CSIR
Tel: +27 12 841 2308 <+27128414213>
Fax: +27 12 841 4223 <+27128414223>
Cell: +27 71 331 9622 <+27823034657>
Email: sakhi(a)sanren.ac.za <shadebe(a)csir.co.za>
9 years, 1 month
[libvirt-users] Telling virt-manager to re-read ~/.gconf in RHEL 6
by Digimer
Hi all,
I've written a tool that configured Virtual Machine Manager, but I've
got a condition that I am now sure how to handle...
If the user isn't logged in and I configure their
~/.gconf/apps/virt-manager/*, and then they log in, everything works
great. However, if they've already logged in and there was no prior
virt-manager configuration, the custom config is overwritten and lost
when the user logs out.
Similarly, if VMM is closed, I write the config and then they open VMM
(again, having logged into gnome where there was no
~/.gconf/apps/virt-manager), it acts like there is no configuration (it
tries to auto-connect to localhost and doesn't show the remote machines).
I am guessing this behaviour is a because VMM doesn't check it's
configuration file after logging into gnome (either at all, or at least
when there was no config at gnome login).
Is there a way I can tell virt-manager to re-check the config?
Thanks!
--
Digimer
Papers and Projects: https://alteeve.ca/w/
What if the cure for cancer is trapped in the mind of a person without
access to education?
9 years, 1 month
[libvirt-users] Qemu-ga on Windows 10
by Dominique Ramaekers
Hi,
I have a windows 10 guest with qemu-ga-x64.msi installed from the fedora virtio iso.
qemu-ga version is 0.12.1
host qemu version is 2.1.0 (I know its older but in this version the active block commit works perfectly...)
libvirt version 1.2.12
I have these lines in my xml:
<channel type='unix'>
<source mode='bind' path='/var/lib/libvirt/qemu/channel/target/PCVIRTmbe.org.qemu.guest_agent.0'/>
<target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
<alias name='channel0'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
/var/lib/libvirt/qemu/channel/target/PCVIRTmbe.org.qemu.guest_agent.0 exists on the host and the rights seems to be all right.
On the guest, the folder C:\ProgramData\qemu-ga exists
Still, I can't start the qemu-ga service. I get this error:
Can't start QEMU GuestAgent-service on the local computer
Error 1053: The service didn't answer correctly on the start command
(or something like this, the error message in in Dutch)
If I start the qemu-ga from the cmd I get this error:
error opening path
error opening channel
failed to create guest agent channel
failed to initialize guest agent channel
Does anybody got an idea how to resolve this problem?
Thanks in advance.
Dominique.
9 years, 1 month