[libvirt-users] libvirt shortcomings of virsh domxml-to-native and domxml-from-native
by 张光鹏
Hi,all.
we use libvirt to manage some host and vms on vmware hypervisor.I have found the libvirt there are some shortcomings .
Such as virsh domxml-to-native and domxml-from-native .I have reviewed the libvirt source --src/vmx/vmx.c, code as follows :
libvirt0.9.13源码xml 转化成vmxvmx转化成xml
/* def:os.arch -> vmx:guestOS */
if (def->os.arch == NULL || STRCASEEQ(def->os.arch, "i686")) {
virBufferAddLit(&buffer, "guestOS = \"other\"\n");
} else if (STRCASEEQ(def->os.arch, "x86_64")) {
virBufferAddLit(&buffer, "guestOS = \"other-64\"\n");
} else {
VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
_("Expecting domain XML attribute 'arch' of entry 'os/type' "
"to be 'i686' or 'x86_64' but found '%s'"), def->os.arch);
goto cleanup;
}/* vmx:guestOS -> def:os.arch */
if (virVMXGetConfigString(conf, "guestOS", &guestOS, true) < 0) {
goto cleanup;
}
if (guestOS != NULL && virFileHasSuffix(guestOS, "-64")) {
def->os.arch = strdup("x86_64");
} else {
def->os.arch = strdup("i686");
}
if (def->os.arch == NULL) {
virReportOOMError();
goto cleanup;
}
Vmware support many guestOS types like "windows7srv-64 ",If I use 64-bit Windows virtual machine, other-64 this type is not correct. NIC e1000 system can not be used .
So I suggest to The libvirt improve the vmware support, especially the mutual transformation of the xml and vmx format guestOS only one parameter.
Thanks all.
张光鹏
tel: 13718913184
mail: zhanggp(a)neusoft.com
移动互联网事业部
东软集团股份有限公司
http://www.neusoft.com
---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s)
is intended only for the use of the intended recipient and may be confidential and/or privileged of
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is
not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying
is strictly prohibited, and may be unlawful.If you have received this communication in error,please
immediately notify the sender by return e-mail, and delete the original message and all copies from
your system. Thank you.
---------------------------------------------------------------------------------------------------
12 years, 4 months
[libvirt-users] No /dev/tty device within LXC guest?
by Yufang Zhang
Hi all,
When I create a LXC guest(RHEL5.4) via libvirt, the guest could boot
successfully. I could ping to guest, but can not ssh into the it. The
secure log in the guest shows that this is due to lack of '/dev/tty' device:
# tail /path/to/rootfs/of/container/var/log/secure
Jul 27 04:25:25 xen2143v sshd[671]: Accepted password for zhangyufang from
10.0.0.1 port 34102 ssh2
Jul 27 04:25:25 xen2143v sshd[671]: pam_unix(sshd:session): session opened
for user zhangyufang by (uid=0)
Jul 27 04:25:25 xen2143v sshd[671]: pam_loginuid(sshd:session):
set_loginuid failed
*Jul 27 04:25:25 xen2143v sshd[671]: error: PAM: pam_open_session(): Cannot
make/remove an entry for the specified session*
*Jul 27 04:25:25 xen2143v sshd[674]: error: open /dev/tty failed - could
not set controlling tty: No such file or directory*
*Jul 27 04:25:25 xen2143v sshd[673]: Received disconnect from 10.0.0.1: 11:
disconnected by user*
The xml of the guest:
# virsh --connect lxc:/// dumpxml instance-00000034
<domain type='lxc' id='30090'>
<name>instance-00000034</name>
<uuid>8387e0f1-6df3-41c8-82ba-cde7d2b60844</uuid>
<memory>524288</memory>
<currentMemory>524288</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='x86_64'>exe</type>
<init>/sbin/init</init>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/libexec/libvirt_lxc</emulator>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/var/lib/nova/instances/instance-00000034/rootfs'/>
<target dir='/'/>
</filesystem>
<interface type='bridge'>
<mac address='fa:16:3e:3c:1d:95'/>
<source bridge='demonetbr0'/>
<target dev='veth0'/>
<filterref filter='nova-instance-instance-00000034-fa163e3c1d95'>
<parameter name='DHCPSERVER' value='10.0.0.1'/>
<parameter name='IP' value='10.0.0.3'/>
</filterref>
</interface>
<console type='pty' tty='/dev/pts/0'>
<source path='/dev/pts/0'/>
<target type='serial' port='0'/>
</console>
</devices>
</domain>
Could anyone point me to where the problem is? Thanks.
Best Regards.
Yufang
12 years, 4 months
[libvirt-users] VM dies with error regarding "virConnectNumOfInterfaces"
by Helga Velroyen
Hi!
I ran into a problem using a USB device and was wondering if
you could help me.
I'm running a Win XP SP3 in a VM with libvirt on a Xubuntu 11.10.
I configured it to talk to several USB devices.
With one particular device (a Phonak Compilot[1], admittedly a probably
rather unusual device), the VM dies with the following error in the
libvirtd.log:
2012-07-20 21:04:19.591+0000: 1282: error :
virConnectNumOfInterfaces:9803 : this function is not supported by the
connection driver: virConnectNumOfInterfaces
2012-07-20 21:05:05.762+0000: 1276: error : qemuMonitorIO:603 : internal
error End of file from monitor
This happens no matter if is it the only configured USB device or if
there is another USB device present in the config or not.
I configured it doing the following steps:
- I looked up the vendor / product ID using lsub
Bus 001 Device 003: ID 180f:1002
(Interestingly, it does not show a name of the device here.)
- I added it to the VM's xml configuration using virsh / edit $vmname
<domain>
...
<devices>
...
<hostdev mode='subsystem' type='usb' managed='no'>
<source>
<vendor id='0x180f'/>
<product id='0x1002'/>
</source>
</hostdev>
...
</devices>
</domain>
- I run the VM using the virt-manager UI.
Any ideas what the problem could be? Do I need to run/configure
differently than how I did it? To me it sounds as if there is some
implementation missing? Is there a workaround for it?
I hope you can give me some clues.
Thank you!
Helga
[1]
http://www.phonak.com/com/b2c/en/products/accessories/compilot-tvlink-s/o...
12 years, 4 months
[libvirt-users] virsh iface-list error
by Arun Sharma
Hello
Facing below error while trying to access the iface-list.
# virsh iface-list
*error: Failed to list active interfaces
error: this function is not supported by the connection driver:
virConnectNumOfInterfaces*
root@kvm-1:/usr/local/src/libvirt# virsh list
Id Name State
----------------------------------------------------
1 vm1 running
After some finding, i saw it require me to build libvirt with --with-netcf.
I tried that too but still facing the same problem.
Here are the steps perform on Ubuntu 1204 (64 bit) + qemu KVM.
# git clone git://libvirt.org/libvirt.git
# ./autogen.sh --prefix=/usr --with-qemu --with-init-script=upstart
--with-yajl --with-netcf --with-network --with-init-script=upstart
--with-libvirtd
# make
# make install
# /usr/sbin/libvirtd &
# /usr/sbin/dnsmasq --strict-order --bind-interfaces
--pid-file=/var/run/libvirt/network/default.pid --conf-file=
--except-interface lo --listen-address 192.168.122.1 --dhcp-range
192.168.122.2,192.168.122.254
--dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases
--dhcp-lease-max=253 --dhcp-no-override
Pl. let me know what could be the problem?
Thanks
Arun
12 years, 4 months
[libvirt-users] CPU-Capabilties for Nested Virtualization
by Michael Beham
Hi,
I have some questions about the CPU-Capabilities for Virtualization
especially for Nested Virtualization like the Turtles Project.
I am trying to create a Nested Environment by following the instruction
of:
http://kashyapc.wordpress.com/2012/01/18/nested-virtualization-with-kvm-a...
The bare-metal system is a Dell Server with following CPU-Flags (virsh
capabilities)
<cpu>
<arch>x86_64</arch>
<model>Opteron_G4</model>
<vendor>AMD</vendor>
<topology sockets='1' cores='8' threads='2'/>
<feature name='nodeid_msr'/>
<feature name='wdt'/>
<feature name='skinit'/>
<feature name='ibs'/>
<feature name='osvw'/>
<feature name='cr8legacy'/>
<feature name='extapic'/>
<feature name='cmp_legacy'/>
<feature name='fxsr_opt'/>
<feature name='mmxext'/>
<feature name='osxsave'/>
<feature name='monitor'/>
<feature name='ht'/>
<feature name='vme'/>
</cpu>
After adding this Flags to the XML of my first VM, the following
XML-Attributes are written to the file, after reopening it.
<cpu mode='custom' match='exact'>
<model fallback='allow'>Opteron_G4</model>
<vendor>AMD</vendor>
<feature policy='require' name='nodeid_msr'/>
<feature policy='require' name='wdt'/>
<feature policy='require' name='skinit'/>
<feature policy='require' name='ibs'/>
<feature policy='require' name='osvw'/>
<feature policy='require' name='cr8legacy'/>
<feature policy='require' name='extapic'/>
<feature policy='require' name='cmp_legacy'/>
<feature policy='require' name='fxsr_opt'/>
<feature policy='require' name='mmxext'/>
<feature policy='require' name='osxsave'/>
<feature policy='require' name='monitor'/>
<feature policy='require' name='ht'/>
<feature policy='require' name='vme'/>
</cpu>
The problem is, that after adding this attributes to the XML, I am not
able to load the kvm-modules in the VM. So I?m not able to install the
Nested VM in the VM.
But when I?m not adding the attributes to the XML and keep the XML-File
of the VM unmodified, I?m able to load the KVM modules in the VM and I
can install the Nested Guest.
So my first question is, what difference it makes for the Nested
Virtualization, when I?m not adding the Attributes and keep the
XML-Files unmodified?
And my second qestion is, what essential difference is between the qemu
version 0.14 which was used by the instruction of Kashyap Chamarthy and
the version 1.0 related to Nested Virtualization?
I hope you understand my problem because it is quite confusing for me
and I?m not sure that I?m using the right techniqe for my Nested
Environment!!
Best Regards,
Mike
12 years, 4 months
[libvirt-users] Setting CPU type for a vm
by Mauricio Tavares
I have a Windows XP vm and would like to know how should I set its cpu
so it is seen by the vm as a proper 32bit one. In its xml file, I have
<os>
<type arch='i686' machine='rhel6.2.0'>hvm</type>
<boot dev='cdrom'/>
<boot dev='hd'/>
<bootmenu enable='yes'/>
</os>
And this is the machine I have (an intel i5):
[root@vmhost ~]# virsh nodeinfo
CPU model: x86_64
CPU(s): 4
CPU frequency: 1600 MHz
CPU socket(s): 1
Core(s) per socket: 4
Thread(s) per core: 1
NUMA cell(s): 1
Memory size: 5904548 kB
and this is what virsh thinks my vm has:
[root@vmhost ~]# virsh vcpuinfo xp
VCPU: 0
CPU: 2
State: running
CPU time: 521.3s
CPU Affinity: yyyy
[root@vmhost ~]#
But, the vm reports it not only as a 286 but also claims not to have the
right drivers for it. How can I make the vm see it as a 686 or something
like that?
12 years, 4 months
[libvirt-users] help about libvirt console
by lei yang
Hi list,
My xml is like below, it works well with "virsh console qemu1"
<domain type='kvm'>
<name>qemu1</name>
<memory>1024000</memory>
<currentMemory>512000</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='hd' />
<kernel>/boot/bzImage</kernel>
<cmdline>console=ttyS0 root=/dev/hda rw</cmdline>
</os>
<devices>
<disk type='file' device='disk'>
<source file='/boot/test.img.raw' />
<target dev='hda' bus='ide' />
</disk>
<console type='pty'>
<target type='serial' port='0'/>
</console>
</devices>
</domain>
I want to use virtio console, so I change
<console type='pty'>
<target type='virtio' port='0'/>
then
I do
#virsh define newvm.xml
#virsh start qemu1
#virsh console qemu1
it show nothing
any help for the virtio console seting?
Lei
12 years, 4 months
[libvirt-users] libvirt shortcomings of virsh domxml-to-native and domxml-from-native
by 张光鹏
Hi,all.
we use libvirt to manage some host and vms on vmware hypervisor.I have found the libvirt there are some shortcomings .
Such as virsh domxml-to-native and domxml-from-native .I have reviewed the libvirt source --src/vmx/vmx.c, code as follows :
libvirt0.9.13源码xml 转化成vmxvmx转化成xml
/* def:os.arch -> vmx:guestOS */
if (def->os.arch == NULL || STRCASEEQ(def->os.arch, "i686")) {
virBufferAddLit(&buffer, "guestOS = \"other\"\n");
} else if (STRCASEEQ(def->os.arch, "x86_64")) {
virBufferAddLit(&buffer, "guestOS = \"other-64\"\n");
} else {
VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
_("Expecting domain XML attribute 'arch' of entry 'os/type' "
"to be 'i686' or 'x86_64' but found '%s'"), def->os.arch);
goto cleanup;
}/* vmx:guestOS -> def:os.arch */
if (virVMXGetConfigString(conf, "guestOS", &guestOS, true) < 0) {
goto cleanup;
}
if (guestOS != NULL && virFileHasSuffix(guestOS, "-64")) {
def->os.arch = strdup("x86_64");
} else {
def->os.arch = strdup("i686");
}
if (def->os.arch == NULL) {
virReportOOMError();
goto cleanup;
}
Vmware support many guestOS types like "windows7srv-64 ",If I use 64-bit Windows virtual machine, other-64 this type is not correct. NIC e1000 system can not be used .
So I suggest to The libvirt improve the vmware support, especially the mutual transformation of the xml and vmx format guestOS only one parameter.
Thanks all.
张光鹏
tel: 13718913184
mail: zhanggp(a)neusoft.com
移动互联网事业部
东软集团股份有限公司
http://www.neusoft.com
---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s)
is intended only for the use of the intended recipient and may be confidential and/or privileged of
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is
not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying
is strictly prohibited, and may be unlawful.If you have received this communication in error,please
immediately notify the sender by return e-mail, and delete the original message and all copies from
your system. Thank you.
---------------------------------------------------------------------------------------------------
12 years, 4 months
[libvirt-users] INTERNAL ERROR:can not attach network interface for vm
by Gao Yongwei
hello,i got a error message when use virsh attach-interface for a vm:
first, list the vm's interface,there's no interface now.
virsh # domiflist ubuntum-124
Interface Type Source Model MAC
-------------------------------------------------------
then,i did an attach-interface action:
virsh # attach-interface ubuntum-124 bridge br0 --persistent
Interface attached successfully
virsh # domiflist ubuntum-124
Interface Type Source Model MAC
-------------------------------------------------------
vnet0 bridge br0 - 52:54:00:3d:d1:ea
second,detach the interface:
virsh # detach-interface ubuntum-124 bridge
Interface detached successfully
virsh # domiflist ubuntum-124
Interface Type Source Model MAC
-------------------------------------------------------
3rd,attach interface again,at this step ,i got erros like below:
virsh # attach-interface ubuntum-124 bridge br0 --persistent
error: Failed to attach interface
error: internal error unable to execute QEMU command 'device_add':
Duplicate ID 'net0' for device
virsh # attach-interface ubuntum-124 bridge br0
error: Failed to attach interface
error: internal error unable to execute QEMU command 'device_add':
Duplicate ID 'net0' for device
virsh # version
Compiled against library: libvir 0.9.10
Using library: libvir 0.9.10
Using API: QEMU 0.9.10
Running hypervisor: QEMU 0.12.1
any one can help?thanks.
12 years, 4 months
[libvirt-users] vm grub errors
by aprender-caminando@riseup.net
Hello,
I've set up a kvm host and used virt-install to create a new guest VM
installed to logical volumes. It works great!
However all subsequent guests I attempt to create the same way refuse to
boot. They all get stuck at the grub rescue menu reporting "no such
device".
I tried installing a new guest and dropping to a shell just before
finalizing the installation so I could examine the contents of grub.cfg
To my eyes it actually looks just fine. It is referencing the correct
virtual drive. Here is a pastebin with a few commands and output I
thought might be relevant.
http://pastebin.com/GwqbY7X7
Once I finalize the installation the same thing happens. Grub reports
the same error.
At the grub rescue prompt if I attempt to:
ls (hd0,msdos1)/
error: unknown filesystem.
In the host I can see that the logical volume where I installed
the root partition of the VM above is in fact active. This is exactly
the same way I installed the first VM on the same host and that one i
still working fine. On a local machine I practiced setting up multiple
VM's this way and had no problem so it's not an error I can reproduce
anywhere other than the production server.
Can anyone offer ideas of other things I should try or check?
12 years, 4 months