[libvirt-users] Building XML from working qemu command-line for ARM virtio
by Clark Laughlin
Hello,
I've got a working QEMU command line that I am trying to get into a libvirt dom xml and using domxml-from-native doesn't seem to know how to handle all of it.
It's for ARM using some new virtio syntax:
qemu-system-arm -machine virt -cpu cortex-a15 -enable-kvm -m 512 -kernel mach-virt-guest-3.11-zImage -display none -serial stdio -netdev type=user,id=mynet -device virtio-net-device,netdev=mynet -drive index=0,id=mydrive,file=saucy-server-cloudimg-armhf.img -device virtio-blk-device,drive=mydrive -initrd saucy-server-cloudimg-armhf-initrd-lpae -append "console=ttyAMA0 root=/dev/vda"
Does anyone have any suggestions for converting the rest of it, specifically the -netdev, -drive, and -device params?
Here is what domxml-from-native gives:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>unnamed</name>
<uuid>fab06af7-aa37-45ca-ac4b-85d9bec89e52</uuid>
<memory unit='KiB'>524288</memory>
<currentMemory unit='KiB'>524288</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type machine='virt'>hvm</type>
<kernel>mach-virt-guest-3.11-zImage</kernel>
<initrd>saucy-server-cloudimg-armhf-initrd-lpae</initrd>
<cmdline>console=ttyAMA0 root=/dev/vda</cmdline>
</os>
<cpu mode='custom' match='exact'>
<model fallback='allow'>cortex-a15</model>
</cpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/home/linaro/ubuntu-cloud-image/qemu-system-arm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='saucy-server-cloudimg-armhf.img'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='ide' index='0'/>
<controller type='usb' index='0'/>
<serial type='stdio'>
<target port='0'/>
</serial>
<console type='stdio'>
<target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='sdl'/>
<video>
<model type='cirrus' vram='9216' heads='1'/>
</video>
<memballoon model='virtio'/>
</devices>
<qemu:commandline>
<qemu:arg value='-display'/>
<qemu:arg value='none'/>
<qemu:arg value='-netdev'/>
<qemu:arg value='type=user,id=mynet'/>
<qemu:arg value='-device'/>
<qemu:arg value='virtio-net-device,netdev=mynet'/>
<qemu:arg value='-device'/>
<qemu:arg value='virtio-blk-device,drive=mydrive'/>
</qemu:commandline>
</domain>
Thank you,
Clark L
11 years, 1 month
[libvirt-users] libvirtError: Unable to add bridge br0 port vnet0: Operation not supported
by Maciej Gałkiewicz
Hi
I am using Libvirt 1.1.2 with Openstack Havana (RC2, nova-network) and
openvswitch 1.4.2+git20120612-9.1. Libvirt vif driver (
nova.virt.libvirt.vif.LibvirtGenericVIFDriver) generates config likes this:
<interface type='bridge'>
<mac address='fa:16:3e:44:30:a4'/>
<source bridge='br0'/>
<model type='virtio'/>
<filterref filter='nova-instance-instance-000003d8-fa163e0b07a7'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
</interface>
and instance fails to start with:
2013-10-16 11:16:13.004+0000: 11943: info : virNetDevProbeVnetHdr:122 :
Enabling IFF_VNET_HDR
2013-10-16 11:16:13.105+0000: 11943: error : virNetDevBridgeAddPort:370 :
Unable to add bridge br0 port vnet0: Operation not supported
If I add <virtualport type='openvswitch' /> inside <interface
type='bridge'>...</interface> it seems to work fine. Is it nova-network or
libvirt bug or some misconfiguration?
regards
--
Maciej Gałkiewicz
Shelly Cloud Sp. z o. o., Sysadmin
http://shellycloud.com/, macias(a)shellycloud.com
KRS: 0000440358 REGON: 101504426
11 years, 1 month
[libvirt-users] qemuMonitorIO internal error
by Francois Gaudreault
Hi,
I am trying to get some VMs running under qemu-kvm. At some point the
VM starts, but then they shutdown by themselves and I see those messages
in the log:
2013-10-11 18:28:57.165+0000: 4148: error : qemuMonitorIO:615 : internal
error: End of file from monitor
2013-10-11 18:28:57.165+0000: 4148: debug : qemuMonitorIO:648 : Error on
monitor internal error: End of file from monitor
Any ideas what could cause this behavior?
I am running Ubuntu 13.10 x86_64 with libvirt 1.1.1 and qemu-kvm 1.5.0.
--
Francois Gaudreault
Architecte de Solution Cloud | Cloud Solutions Architect
fgaudreault(a)cloudops.com
514-629-6775
- - -
CloudOps
420 rue Guy
Montréal QC H3J 1S6
www.cloudops.com
@CloudOps_
11 years, 1 month
[libvirt-users] Xen - 4.2.1 with libvirt-1.1.3
by cooldharma06
hi,
i cleared all the stuffs(everything) related to xen and libvirt.
i installed freshly xen-4.2.1 from the source.
*Installation steps are as follows:*
apt-get build-dep xen
apt-get install libc6-dev libglib2.0-dev libyajl-dev yajl-tools libbz2-dev
bison flex zlib1g-dev git-core texinfo debhelper debconf-utils debootstrap
fakeroot
*OR*
apt-get install bcc bin86 gawk bridge-utils iproute libcurl3
libcurl4-openssl-dev bzip2 module-init-tools transfig tgif tgif texinfo
texlive-latex-base gcc-multilib texlive-fonts-extra
texlive-fonts-recommended pciutils-dev mercurial libncurses5-dev patch
libvncserver-dev libsdl-dev libjpeg62-dev iasl libbz2-dev git-core uuid-dev
python python-dev python-twisted build-essential make gcc libc6-dev
zlib1g-dev texlive-latex-recommended e2fslibs-dev
*Download and build the source*
wget http://bits.xensource.com/oss-xen/release/4.2.1/xen-4.2.1.tar.gz
tar zxvf xen-4.2.1.tar.gz
cd xen-4.2.1
-
vi Config.mk
edit the XSM_ENABLE = n --------> XSM_ENABLE= y
-
./configure –enable-githttp --libdir=/usr/lib64 ( if it is 64 bit
machine )
-
vi ./.config
#
write this line -------- > PYTHON_PREFIX_ARG=--install-layout=deb
#
-
make world
-
make deb
-
cd ./dist
-
./install.sh
-
# Important
-
update-grub
-
ls -al /boot/xen*
-
update-rc.d xencommons defaults 19 18
-
update-rc.d xendomains defaults 21 20
-
update-rc.d xen-watchdog defaults 22 23
-
update-grub
*Configuration*
*ln -s /etc/init.d/xendomains /etc/rc0.d/S10xendomains*
*ln -s /etc/init.d/xendomains /etc/rc6.d/S10xendomains*
*ln -s /etc/init.d/xencommons /etc/rc3.d/S98xencommons*
*ln -s /etc/init.d/xendomains /etc/rc3.d/S98xendomains*
*ln -s /root/xendom0caps /etc/rc3.d/S98xendom0caps*
*ln -s /root/iptables-enable /etc/rc3.d/S99iptables-enable (not required)*
*vi /root/xendom0caps (add xl sched-credit -d Domain-0 -w 512)*
*chmod +x /root/xendom0caps*
*vi /etc/rc.local (add /usr/bin/setterm -powersave off -blank 0*
*vi /etc/xen/xend-config.sxp*
*comment it --- > #network-script network-bridge*
*vi /etc/network/interfaces*
*auto xenbr0 *
*iface xenbr0 inet dhcp*
*bridge_ports eth0 *
reboot
* then i enter into the xen.
*root@boss[/]#xl list*
Name ID Mem VCPUs State Time(s)
Domain-0 0 3476 8 r-----
614.7
_______________________
then i installed libvirt form the source and the installtion steps are as
follows:
* ./autogen.sh --system --with-xen=yes --with-libxl=yes
* make
* make install
and then i runned daemon/libvirtd -d
then i runned
*tools/virsh *
*virsh # version*
Compiled against library: libvirt 1.1.3
Using library: libvirt 1.1.3
Using API: QEMU 1.1.3
error: failed to get the hypervisor version
error: internal error: Cannot find suitable emulator for x86_64
- - - - - - - - - - - -
then i started the xend by following command:
/etc/init.d/xend start
then i checked libvirt(virsh)
virsh # version
Compiled against library: libvirt 1.1.3
Using library: libvirt 1.1.3
Using API: Xen 1.1.3
Running hypervisor: Xen 4.2.0
*******
i dont know how to enable the xl with libvirt.
Anyone guide me..
regards,
cooldharma06.
11 years, 1 month
[libvirt-users] event handler
by Alexandr
good day to all.
i still have not solved my problem with event handling.
currently i have following code
void libvirt_eventloop_thr_func()
{
while(true) //TODO: stop somehow on exit
{
if(virEventRunDefaultImpl() < 0)
{
virErrorPtr err = virGetLastError();
fprintf(stderr, "Failed to run event loop: %s\n", err && err->message
? err->message : "Unknown error");
}
}
}
...
virSetErrorFunc(NULL, libvirt_error_handler);
libvirt_connection = virConnectOpen("qemu:///system");
if (virEventRegisterDefaultImpl() < 0)
{
virErrorPtr err = virGetLastError();
fprintf(stderr, "Failed to register event implementation: %s\n", err
&& err->message ? err->message: "Unknown error");
return -1;
}
{
int callback = virConnectDomainEventRegisterAny(libvirt_connection,
NULL, VIR_DOMAIN_EVENT_ID_LIFECYCLE,
VIR_DOMAIN_EVENT_CALLBACK(domain_event_handler), NULL, NULL);
if(callback == -1)
{
std::cout<<"Error: failed to register domain event handle
callback\n";
return -1;
}
}
boost::thread(boost::bind(&libvirt_eventloop_thr_func));
...
libvirt_eventloop_thr_func() called, and locked on
virEventRunDefaultImpl(), can it be called in thread, and if no, how
should i use it correctly ?
sorry for asking again, but i really can't solve it myself.
thx in advance.
11 years, 1 month
[libvirt-users] migrate & virtlockd
by NEVEU Stephane
Hi all,
I'm testing virtlockd with libvirt 1.1.3 and it seems I can't migrate my VMs from the first to my second kvm node (on a NFS storage). Virtlockd is locking my qcow2 :
Error : resource busy Lockspace resource 'ea3jkj78.....' is locked
As a result my VM is paused.
How can I fix this behavior ?
Thank you for your help.
11 years, 1 month
[libvirt-users] Guide to view the libvirt source.
by cooldharma06
hi all,
i am new to this libvirt. Any guide or reference is available to know more
things libvirt (individual programs). because it will give me some idea to
get about the libvirt and its corresponding programs.
If there is available means please guide and share me.
i want to give my contribution to this community.
Lot of thanks in advance.
Regards,
cooldharma06.
11 years, 1 month
[libvirt-users] migration error virsh 0.10
by song
Hello everyone:
I am using CentOS 6.3 and the libvirt version is 0.10,when I'm trying to
migration a vm between hosts,issue command:virsh --connect
qemu:///system migrate --live one-11 qemu+ssh://192.168.0.111/system,an
error reported:
Command "virsh --connect qemu:///system migrate --live one-11
qemu+ssh://192.168.0.111/system" failed: error: XML error: invalid
security type
Any help will be appreciated!
11 years, 1 month