[libvirt-users] <qemu:commandline> domain XML tag is not working?
by Chengyuan Li
Hi,
I tried to enable virtio-blk data plane feature for VMs in my openstack
environment, the hypervisor is ubuntu 14.04, libvirt 1.2.2 and QEMU 2.0.
As nova doesn't support that parameter yet, I did belows
1. nova boot a VM with raw disk image.
2. nova stop the VM.
3. run "virsh edit <instance-id>" on the hyprvisor node, and adding below
into instance xml just before </domain>.
However, the <qemu:commandline> part is ignored and not saved after closing
virsh edit, seems that libvirt rejected these changes. Is there any XML
syntax error here? Or libvirt doesn't support <qemu:commandline> tag?
<qemu:commandline>
<qemu:arg value='-set'/>
<qemu:arg value='device.drive-virtio-disk0.x-data-plane=on'/>
</qemu:commandline>
Regards,
Chengyuan.
9 years, 4 months
[libvirt-users] libvirt and guest processes
by dt sweval
Hi
I wanted to find out if there is way to list all the running processes in a
guest VM from the hypervisor. Like the output of 'ps -ef' from inside the
guest VM, but without logging in or ssh into it.
Thanks
dtsweval
9 years, 4 months
[libvirt-users] inquiry about differences between the tap and the vnet in the virt-manager
by wh.h@foxmail.com
inquiry about differences between the tap and the vnet in the virt-manager
Greetings!
I encounter a problem about the network when using virt-manager to create and run a VM.
when I want to establish a network bridge for the guest OS, I generally use two kinds of ways described as fellow :
First method : create a bridge with the help of linux commad: brctl, or
Second method : using virt-manager
(1) create a bridge with the help of linux commad: brctl
I use a script to establish a bridge, there are many script examples on the web to establish a bridge. when I restart the network service, I get the bridge :
1.1 create network bridge
[root@localhost ~]# ifconfig
br0 Link encap:Ethernet HWaddr C2:CD:89:61:2C:F0
inet addr:192.168.1.189 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::c0cd:89ff:fe61:2cf0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:1080 (1.0 KiB)
eth2 Link encap:Ethernet HWaddr 00:25:90:8E:C0:F0
inet addr:172.16.1.189 Bcast:172.16.255.255 Mask:255.255.0.0
inet6 addr: fe80::225:90ff:fe8e:c0f0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:918998 errors:0 dropped:0 overruns:0 frame:0
TX packets:2033 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:84486598 (80.5 MiB) TX bytes:148116 (144.6 KiB)
Memory:fbe20000-fbe3ffff
[root@localhost ~]# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.0025908ec0f0 no
virbr0 8000.525400b1de42 yes virbr0-nic
1.2 add bridge interface
the eth2 device is a physical ethernet device,
[root@localhost ~]# brctl addif br0 eth2
[root@localhost ~]# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.0025908ec0f0 no eth2
virbr0 8000.525400b1de42 yes virbr0-nic
1.3 create tap and add it to the bridge
create tap:
tunctl -t tap0 -u root
brctl addif br0 tap0
ifconfig tap0 up
chmod a+rw /dev/net/tun
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -j MASQUERADE
add it to the bridge
[root@localhost ~]# brctl addif br0 tap0
[root@localhost ~]# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.0025908ec0f0 no eth2
tap0
virbr0 8000.525400b1de42 yes virbr0-nic
[root@localhost kvm_img]# ifconfig
br0 Link encap:Ethernet HWaddr 00:25:90:8E:C0:F0
inet addr:172.16.1.189 Bcast:172.16.255.255 Mask:255.255.0.0
inet6 addr: fe80::c0cd:89ff:fe61:2cf0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:37947 errors:0 dropped:0 overruns:0 frame:0
TX packets:10485 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2581300 (2.4 MiB) TX bytes:40996927 (39.0 MiB)
eth2 Link encap:Ethernet HWaddr 00:25:90:8E:C0:F0
inet6 addr: fe80::225:90ff:fe8e:c0f0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:957962 errors:0 dropped:34 overruns:0 frame:0
TX packets:38466 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:87721507 (83.6 MiB) TX bytes:42551007 (40.5 MiB)
Memory:fbe20000-fbe3ffff
tap0 Link encap:Ethernet HWaddr F2:55:FC:F8:95:DC
inet6 addr: fe80::f055:fcff:fef8:95dc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11 errors:0 dropped:0 overruns:0 frame:0
TX packets:1328 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:846 (846.0 b) TX bytes:173159 (169.1 KiB)
1.4 boot the guest (using the tap0)
kvm -boot c -localtime -m 4G -hda /home/kvm_img/centos6p4.img -net nic -net tap,ifname=tap0,script=no -enable-kvm
(2) using virt-manager
2.1 create network bridge
[root@localhost ~]# ifconfig
br0 Link encap:Ethernet HWaddr C2:CD:89:61:2C:F0
inet addr:192.168.1.189 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::c0cd:89ff:fe61:2cf0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:1080 (1.0 KiB)
eth2 Link encap:Ethernet HWaddr 00:25:90:8E:C0:F0
inet addr:172.16.1.189 Bcast:172.16.255.255 Mask:255.255.0.0
inet6 addr: fe80::225:90ff:fe8e:c0f0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:918998 errors:0 dropped:0 overruns:0 frame:0
TX packets:2033 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:84486598 (80.5 MiB) TX bytes:148116 (144.6 KiB)
Memory:fbe20000-fbe3ffff
[root@localhost ~]# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.0025908ec0f0 no
virbr0 8000.525400b1de42 yes virbr0-nic
2.2 add bridge interface
the eth2 device is a physical ethernet device,
[root@localhost ~]# brctl addif br0 eth2
[root@localhost ~]# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.0025908ec0f0 no eth2
virbr0 8000.525400b1de42 yes virbr0-nic
2.3 run the virt-manager and select the NIC option
I find the bridge created above , configure it as fellow :
in "Virtual Network Interface " setting:
Source device: Host device tap0 (bridge br0)
Device model: e1000
Mac address: 52:54:00:84:E3:62
2.4 I start the VM using virt-manager
I get a vnet0 device created by virt-manager,
[root@localhost ~]# ifconfig
br0 Link encap:Ethernet HWaddr 00:25:90:8E:C0:F0
inet addr:172.16.1.189 Bcast:172.16.255.255 Mask:255.255.0.0
inet6 addr: fe80::c0cd:89ff:fe61:2cf0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:62160 errors:0 dropped:1 overruns:0 frame:0
TX packets:22071 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4007196 (3.8 MiB) TX bytes:59626981 (56.8 MiB)
eth2 Link encap:Ethernet HWaddr 00:25:90:8E:C0:F0
inet6 addr: fe80::225:90ff:fe8e:c0f0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:982209 errors:0 dropped:47 overruns:0 frame:0
TX packets:61101 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:89496644 (85.3 MiB) TX bytes:61778801 (58.9 MiB)
Memory:fbe20000-fbe3ffff
vnet0 Link encap:Ethernet HWaddr FE:54:00:84:E3:62
inet6 addr: fe80::fc54:ff:fe84:e362/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:114 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:670 (670.0 b) TX bytes:13720 (13.3 KiB)
both of the methods above seems that the network of guest OS is OK at most of environments, and I can get the attributes of the virtual network device . They are seemed to be the same.
about the tap0:
[root@localhost ~]# ethtool -i tap0
driver: tun
version: 1.6
firmware-version:
bus-info: tap
supports-statistics: no
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
about the vnet0 created by virt-manager :
[root@localhost ~]# ethtool -i vnet0
driver: tun
version: 1.6
firmware-version:
bus-info: tap
supports-statistics: no
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
but the action between tap and vnet is not exactly the same!I will describe it in the following.
this is my project environment:
hardware : intel xeon E5 2600 server from supermicro
host OS: centos 6.4 (kernel version is changed to 3.15.10 by me)
virtual software : KVM+qemu 2.1.3
guest OS: centos 6.4 (kernel is not changed : 2.6.32 64bit)
when I establish the network by the first method: create a bridge with the help of Linux commad: brctl, tap0 device is created in the host and assigned to the guest OS. tap0 device gets a name “eth0” in the guest OS.
I use “ping ” command to test network state . I get the following result :
concept explanation :
local host: the OS where the guest OS is running
remote host: another server which is connected to the local host using ethernet network .
and this is my results:
ping local host from guest OS is OK, I get reply from local host;
ping remote host from local host is OK, I get reply from remote host;
ping remote host from guest OS is not OK, I don’t get any reply from remote host; and this is my question.
when I establish the network by the second method: using virt-manager, at this time , vnet0 device is created in the host and assigned to the guest OS. vnet0 device gets a name “eth0” in the guest OS.
I also use “ping ” command to test network state . I get the following result :
ping local host from guest OS is OK, I get reply from local host;
ping remote host from local host is OK, I get reply from remote host;
ping remote host from guest OS is OK, I get reply from remote host;
my question is :
why I cannot get reply when I ping remote host from guest OS using the first method?
I use the same bridge: br0, so I think that the bridge: br0 is not responsible for the fault. and I have also stop the firewall .
I guess the reason is that there are some differences between the tap device created by linux command and vnet device created by virt-manager. could you please kindly give my some advices to solve the problem ?
I would be grateful if you could give me some advice . look forward to your reply !
weihua
wh.h(a)foxmail.com
9 years, 4 months
[libvirt-users] Question regarding management of VMs using libvirtd.
by somenathpal .
Hi All,
I have a question regarding the uses of libvirtd. We have the following
situation to manage.
We have several hosts with libvirtd running. We have one management
application to manage different VMs launched in those different hosts.
We want to configure the system such a way so that one libvirtd can collect
information about the VMs launched by other libvirtd running in different
hosts. Is it possible? Could you please point me to some resource around
this?
In this we will be able to get information about VMs from single source and
need not to query different host for VMs info.
Regards,
Somenath
9 years, 4 months
[libvirt-users] virsh shutdown <domain> not fully working on win7 ?
by Marko Weber | 8000
hello list,
i have a running vm with win7.
When i fire up an 'virsh shutdown win7' nothing happens.
When i fire up a second the same command, then the win7 machine is
shutting down.
Why do i need to fire up this command twice?
Any ideas?
best regards
marko
--
9 years, 4 months
[libvirt-users] (no subject)
by Daniel Sanabria
Hi,
After upgrading my systems to Fedora 21 I decided to give Firewalld and
NetworkManager technologies a try instead of keep relying on iptables and
network.service but I now have my doubts.
I have a F21 host with br0 configured with a network-script file to obtain
its IP via dhcp (no problems with this), firewalld is running on the host
and the guests are using br0 and dhcp to obtain the IPs from the same
source the host/br0 is getting its own IP.
The problem I'm having is that, after some time, packets from the guests
are not being forwarded by br0 but I can't quite locate the reason for
this. It is not until I restart the guest that everything starts working
again (restarting NetworkManager in the guest does not work).
Why br0 stops forwarding packets? What would be the right approach to get
this setup working? Should I just forget about Firewalld and NetworkManager
by disable them and instead keep using iptables and network.service?
Thanks in advance,
Daniel
9 years, 4 months
[libvirt-users] virsh shutdown <domain> not fully working on win7 ?
by Marko Weber | 8000
hello list,
i have a running vm with win7.
When i fire up an 'virsh shutdown win7' nothing happens.
When i fire up a second the same command, then the win7 machine is
shutting down.
Why do i need to fire up this command twice?
Any ideas?
best regards
marko
--
9 years, 4 months
[libvirt-users] New application, which uses libvirt
by Maciej Nabożny
Hello,
a couple years ago, I've asked you to add the Cracow Cloud One project
to application list (http://libvirt.org/apps.html). For over one year
I'm developing new IaaS cloud, based on that application, which is its
fork. Would it be possible to add this new project to Libvirt
application list?
CloudOver - elastic and modular IaaS cloud designed to run in small
environments, like computer labs and offices. Provides graphical web
interface and simple python bindings to manage all resources. Additional
plugins make easy to extend its core functionality.
Regards,
Maciej Nabożny
9 years, 4 months
[libvirt-users] unknown driver format value 'qcow3'
by Jatin Davey
Hi All
I am trying to deploy VMs using libvirt and a domainXML file where i
mention the parameters for the VM to be deployed.
I am using libvirt version: libvirt 0.10.2
**********
virsh # version
Compiled against library: libvirt 0.10.2
Using library: libvirt 0.10.2
Using API: QEMU 0.10.2
Running hypervisor: QEMU 0.12.1
***********
I get this libvirt exception while deploying a VM.
Exception trace **************
2015-04-14 18:06:28,240 [pool-1-thread-45] ERROR
defineDomain(SimpleAppliance.java:581) - Failed to define domain/VM from XML
org.libvirt.LibvirtException: unsupported configuration: unknown driver
format value 'qcow3'
at org.libvirt.ErrorHandler.processError(Unknown Source)
at org.libvirt.Connect.processError(Unknown Source)
at org.libvirt.Connect.processError(Unknown Source)
at org.libvirt.Connect.domainDefineXML(Unknown Source)
********************************
Do i need to upgrade to any specific version of libvirt ? or change any
file to make this work ?
Thanks
Jatin
9 years, 4 months
[libvirt-users] VM Performance using KVM Vs. VMware ESXi
by Jatin Davey
Hi All
We are currently testing our product using KVM as the hypervisor. We are
not using KVM as a bare-metal hypervisor. We use it on top of a RHEL
installation. So basically RHEL acts as our host and using KVM we deploy
guests on this system.
We have all along tested and shipped our application image for VMware
ESXi installations , So this it the first time we are trying our
application image on a KVM hypervisor.
On this front i have done some tests to find out how our application's
response time is when deployed on KVM and then compare it with a VM
deployed on VMware ESXi. We have a benchmark test that basically loads
the application simulating a load of 100 parallel users logging into the
system and downloading reports. These tests basically use a HTTP GET
query to load the application VM. In addition to that i have taken care
to use the same hardware for both the tests , one with RHEL(Host)+KVM
and another with VMware ESXi. All the hardware specifications for both
the servers remain the same. The load test also remains the same for
testing with both the servers.
First observation is that the average response time on the VMware ESXi
is : 500 milli-seconds while the application's average response time
when deployed using RHEL(Host)+ KVM is : 1050 milli-seconds. The
response time of the application when deployed on KVM is twice as much
as when it is deployed using VMware ESXi.
I did few more tests to find which sub-system on these servers shows
varying metrics.
First i started with IOZone to find out if there is any mismatch in the
speed with which data is read / written to the local disk on the two VMs
and found that "Read" speed in the VM that was deployed using
RHEL(Host)+KVM was twice as slow as the VM which was deployed using
VMware ESXi.
For more on IoZone , Please refer : http://www.iozone.org/
more specifically the following IoZone metrics were twice as less when
compared to the server running with VMware ESXi:
Read
Re-read
Reverse-Read
Stride Read
Pread
Note: I had run the IoZone tests on the VMs on both the servers.
Second observation to be made was the output from the "top" command. I
could see that the VM deployed on RHEL(Host)+KVM was showing high
numbers for the following metrics when compared with the VM deployed on
VMware ESXi:
load averages
%sy for all the logical processors
%si for all the logical processors
i debugged further to find out which device is causing more interrupts
and found it to be "ide0" , See the output from the /proc/interrupts
file below:
The other interrupts apart from ide0 are pretty much similar to the VM
deployed using VMware ESXi.
************/proc/interrupts *******************
[root@localhost ~]# cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3 CPU4 CPU5
CPU6 CPU7
0: 795827 0 0 0 0 0
0 0 IO-APIC-edge timer
1: 65 0 0 0 0 0
0 0 IO-APIC-edge i8042
6: 2 0 0 0 0 0
0 0 IO-APIC-edge floppy
8: 0 0 0 0 0 0
0 0 IO-APIC-edge rtc
9: 0 0 0 0 0 0
0 0 IO-APIC-level acpi
10: 425785 0 0 0 0 0
0 0 IO-APIC-level virtio0, eth0
11: 47 0 0 0 0 0
0 0 IO-APIC-level uhci_hcd:usb1, HDA Intel
12: 730 0 0 0 0 0
0 0 IO-APIC-edge i8042
14: 188086 0 0 0 0 0
0 0 IO-APIC-edge ide0
NMI: 0 0 0 0 0 0
0 0
LOC: 795813 795798 795783 795767 795752 795737
795723 795709
ERR: 0
MIS: 0
*********************************************
Any pointers to improving the response time for the VM for
RHEL(Host)+KVM installation would be greatly appreciated.
Thanks
Jatin
9 years, 4 months