[libvirt-users] 2 Problems with attaching/detaching disks with virsh and KVM
by Daniele Testa
Hi,
I am having 2 issues with disks and KVM.
ISSUE 1:
I am unable to detach a disk from a running KVM.
(root@h2)-(/tmp)# virsh dumpxml vps_99
<domain type='kvm' id='224'>
<name>vps_99</name>
<uuid>5e24e17c-f0e4-1030-ac57-0050560018a2</uuid>
<memory>524288</memory>
<currentMemory>524288</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='x86_64' machine='pc-0.12'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>restart</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/kvm</emulator>
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/nbd1'/>
<target dev='vda' bus='virtio'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/nbd2'/>
<target dev='vdb' bus='virtio'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/nbd3'/>
<target dev='vde' bus='virtio'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/nbd4'/>
<target dev='vdg' bus='virtio'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/nbd5'/>
<target dev='vdi' bus='virtio'/>
</disk>
<interface type='bridge'>
<mac address='00:50:56:00:1b:24'/>
<source bridge='br0'/>
<target dev='vnet3'/>
<model type='virtio'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5999' autoport='no' keymap='en-us'/>
<video>
<model type='cirrus' vram='9216' heads='1'/>
</video>
</devices>
<seclabel type='dynamic' model='apparmor'>
<label>libvirt-5e24e17c-f0e4-1030-ac57-0050560018a2</label>
<imagelabel>libvirt-5e24e17c-f0e4-1030-ac57-0050560018a2</imagelabel>
</seclabel>
</domain>
(root@h2)-(/tmp)# cat disk.xml
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/nbd5'/>
<target dev='vdi' bus='virtio'/>
</disk>
(root@h2)-(/tmp)# virsh detach-device vps_99 disk.xml
error: Failed to detach device from disk.xml
error: operation failed: disk vdi cannot be detached - no PCI address for
device
(root@h2)-(/tmp)# virsh detach-disk vps_99 vdi
error: operation failed: disk vdi cannot be detached - no PCI address for
device
I have tried specifing a <address> for each disk, ie:
address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
However, I still get the same "no PCI" error.
I am able to add and remove NEW disks to the virtual server after it has
been started, but I can't detach the disks that were defined when the KVM
was created (even though it looks exactly the same in the XML-file).
ISSUE 2:
When I add a disk to a KVM running linux (ubuntu in this case), it totally
ignores my "target dev". I.e if I specify this:
<target dev='vdi' bus='virtio'/>
The disk is still being detected as "vdc". Removing the disk and adding it
again, gives it "vdd" etc. So it seems it is pretty much just increamenting
the letter and totally ignore my config. I read in the documentation that
the target defined is just a "hint" for the system and is not always
honered, but sorry, I simply cannot accept that :)
There must be a way to specify the device the disk should be connected to.
Amazon Web Services seems to be able to do this just fine. It will be a
pain to write automated scripts when new disks are just attached to random
devices.
Regards,
Daniele
11 years, 7 months
[libvirt-users] virt-manager slow to connect, hangs on new host dialog
by martin f krafft
Hello,
I am using virt-manager 0.9.4 on a Debian unstable system (libvirt
0.9.12) to connect to a libvirtd via SSH running on a Debian testing
system (also version 0.9.12), and I have a problem using
virt-manager, which first takes ages to connect, then freezes.
The SSH connection is top-quality, the hosts are next to each other
and connected by Gigabit Ethernet. virsh connections work fine.
Unfortunately, when I run virt-manager and connect to the host, the
host's capabilities are fetched very quickly (according to
virt-manager's debug output), but it then takes 20–30 seconds until
the connection is established.
Logging libvirtd with log_level=2 produces nothing useful. Hence
I tried with log_level=1, which is mayhem. Attached is the log
output from the moment I told virt-manager to connect until shortly
after the connection has been established. Maybe someone can figure
out what's going on? I cannot…
The next problem is that when I then try to create a host, I am
shown the dialog and can enter one or two characters into the name
field, then the GUI completely freezes, and so does libvirtd on the
other system (ctrl-c does not work anymore).
I have also captured this part of the session in a second log file,
which provides no clues for me.
Does anyone else know what might be going on?
Thanks,
--
martin | http://madduck.net/ | http://two.sentenc.es/
"es ist immer etwas wahnsinn in der liebe.
es ist aber auch immer etwas vernunft im wahnsinn."
- friedrich nietzsche
spamtraps: madduck.bogus(a)madduck.net
11 years, 7 months
[libvirt-users] Host modifications
by Benoit Friry
Hello,
I test libvirt 0.9.12 on Debian.
I am disappointed by changes made on my host without any notice.
Examples:
- editing interfaces with virsh or virt-manager modifies my
/etc/network/interfaces. It's not clear at first glance that I can even
cut myself from the host when editing remotely. The initial file is not
even saved.
- starting default network (nat) adds rules in netfilter. I have not
seen how to create another network nat conf without calling
clean-traffic nwfilter (it is not explicit in network XML file). Is it
hardcoded ?
I think it would be nice:
- to be alerted before any host modification,
- to be able to change the templates, for instance:
- not including any nwfilter when creating a network,
- script called when adding a file in a dir pool,
- and so on.
Did I miss something?
Am I alone to disappointed by such behavior?
Thanks,
Benoit
11 years, 7 months
[libvirt-users] Cannot recv data: Connection reset by peer
by Guillaume Thouvenin
Hello,
I'm trying to install and use libvirt 1.0.4 on an Ubuntu 12.04.2. I
compiled libvirt by doing:
$ ./configure --with-selinux=no --with-gnutls
$ make
$ sudo make install
Everything works fine and are installed under /usr/local
Then I started the libvirtd manually and try to start a linux container
that has the following configuration:
$ virsh -c lxc:/// dumpxml lxcvm1
<domain type='lxc'>
<name>lxcvm1</name>
<uuid>168edaae-e3b5-2d06-7c65-9aa444a6f234</uuid>
<memory unit='KiB'>2097152</memory>
<currentMemory unit='KiB'>2097152</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64'>exe</type>
<init>/bin/sh</init>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/local/libexec/libvirt_lxc</emulator>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/home/thouveng/lxc_dir/lxcvm1/rootfs'/>
<target dir='/'/>
</filesystem>
<console type='pty'>
<target type='lxc' port='0'/>
</console>
</devices>
</domain>
When I start the container I have the following error:
$ virsh -c lxc:/// start lxcvm1
error: Failed to start domain lxcvm1
error: internal error guest failed to start: PATH=/bin:/sbin TERM=linux
container=lxc-libvirt
container_uuid=168edaae-e3b5-2d06-7c65-9aa444a6f234
LIBVIRT_LXC_UUID=168edaae-e3b5-2d06-7c65-9aa444a6f234
LIBVIRT_LXC_NAME=lxcvm1 /bin/sh
error receiving signal from container: Input/output error
The libvirtd is started with info option so I can see:
2013-04-03 08:49:20.167+0000: 17046: error : virNetSocketReadWire:1362
: Cannot recv data: Connection reset by peer
2013-04-03 08:49:20.267+0000: 17051: error : virLXCProcessStart:1248 :
internal error guest failed to start: PATH=/bin:/sbin TERM=linux
container=lxc-libvirt
container_uuid=168edaae-e3b5-2d06-7c65-9aa444a6f234
LIBVIRT_LXC_UUID=168edaae-e3b5-2d06-7c65-9aa444a6f234
LIBVIRT_LXC_NAME=lxcvm1 /bin/sh
error receiving signal from container: Input/output error
In libvirtd.conf I have:
auth_unix_ro = "none"
auth_unix_rw = "none"
auth_tcp = "none"
auth_tls = "none"
And in libvirt.conf everything is commented.
I have this error as normal user (in libvirtd group) and also as root.
Any hints to go further in the debugging are welcome.
Regards,
Guillaume
11 years, 7 months
[libvirt-users] migrate qemu domains
by Yin Olivia-R63875
Hi,
I tried to migrate qemu domains between same two Freescale PPC platforms.
1) Migrate test domain from Host1(10.193.20.109) to Host2(10.193.20.181).
root@ppc-host1:~# virsh migrate test qemu+tls://10.193.20.181/system
or
root@ppc-host2:~# virsh -c qemu+tls://10.193.20.109/system migrate test qemu:///system
I waited for a while and finally got error message as below:
error: Unable to read from monitor: Connection reset by peer
Exactly, when waiting (I guess during migration), the migrated domain is pasued on
both source and destination nodes.
root@ppc-host1:~# virsh -c qemu:///system list --all
Id Name State
----------------------------------------------------
5 test paused
And meanwhile, the destination domain is also paused when waiting
root@ppc-host2:~# virsh -c qemu:///system list --all
Id Name State
----------------------------------------------------
2 test paused
Finally, the migrated domain on source node is shut off.
root@ppc-host1:~# virsh -c qemu:///system list --all
Id Name State
----------------------------------------------------
- test shut off
But can't find any domain on destination node any longer.
root@ppc-host2:~# virsh -c qemu:///system list --all
Id Name State
----------------------------------------------------
As I know qemu-system-ppc doesn't support live migration on Freescale PPC platform yet.
My question is whether it depends on qemu implementation to migrate qemu hypervisor with libvirt?
>From the above experiment, it seemed that migration happened but not succeeded finally.
Best Regards,
Olivia
11 years, 7 months
[libvirt-users] virt-manager connect remote KVM host and graphic control guest problem
by cochen
Hi developer, i got a problem and need your help!(my english not very good)
My KVM host in IDC, and there are some restrict in there lead to me connect to KVM host by port 22 or 16509 impossible. In generally If i want login my KVM host i must login in to a "stepping stones" first, then login to that KVM host.( Now assume that the KVM host ip is 1.1.1.1 and the "stepping stones" ip is 2.2.2.2).
So i use the "portforwarding" (i used the manner of "qemu+tcp" to connect KVM host, the default port is 16509), I visit the port 16509 in "stepping stones" machine 1.1.1.1 and then 1.1.1.1 port forwarding to 2.2.2.2:16509. And then my virt-manager connect KVM host successful!
But my trouble is comming too. I can't use virt-manager to control my guest by graphic. I "portforwarding" the port 5911(i had already defined my guest vnc port), but is unuseful. I used command "netstat -antl" in KVM host found that :
tcp 0 0 127.0.0.1:5911 0.0.0.0:* LISTEN
tcp 0 0 1.1.1.1:16509 2.2.2.2:63325 ESTABLISHED
tcp 0 0 0.0.0.0:16509 0.0.0.0:* LISTEN
As you see, 5911 listen into localhost(127.0.0.1), but 16509 listen into the 1.1.1.1 and 0.0.0.0. So I think if 5911 listen 0.0.0.0 or 1.1.1.1 everything is ok.
Here is my virt-manager.log:
[Thu, 28 Mar 2013 00:57:16 virt-manager 3242] DEBUG (engine:471) window counter incremented to 2
[Thu, 28 Mar 2013 00:57:16 virt-manager 3242] DEBUG (console:1078) Starting connect process for proto=vnc trans=tcp connhost=2.2.2.2 connuser=root connport=None gaddr=127.0.0.1 gport=5911 gsocket=None
[Thu, 28 Mar 2013 00:57:16 virt-manager 3242] DEBUG (console:374) VNC connecting to 2.2.2.2:5911
[Thu, 28 Mar 2013 00:57:18 virt-manager 3242] DEBUG (console:961) Viewer disconnected
How can i use virt-manager to control my guest by graphic?
thank you very much!!!
11 years, 7 months
[libvirt-users] How to give access to /dev/tty
by Guillaume Thouvenin
Hello,
First I apologize because I sent this email on the lxc-users mailing
by error. So sorry for the double message.
I'm trying to run an X server inside a container. I was able to
achieve this with lxc-tools (and that is why I mixed myself between the
2 lists) by setting the option lxc.tty = 4 that allows access to 4 tty.
Now I want to use libvirt because my final goal is to create a
container with GPU capabilities from Openstack (that uses libvirt).
When I start an X server with "startx -- :1" in a container I have the error:
Fatal server error:
xf86OpenConsole: Cannot open /dev/tty0 (No such file or directory)
I also tried with :2 and :3 but I still have the same error (except
that the name of the log file changed between Xorg.{1,2,3}.log. I
copied the xml file of my container at the end of the email.
Thus my question is how can I give an access to /dev/tty0 to the
container? Or maybe it is not the right way to start an X server in the
container. Best regards,
Guillaume
<domain type='lxc' id='28247'>
<name>lxcvm1</name>
<uuid>d4014dfc-f4db-5791-c0d2-817547921ce1</uuid>
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>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>restart</on_crash>
<devices>
<emulator>/usr/lib/libvirt/libvirt_lxc</emulator>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/home/thouveng/virtualization/lxc/lxcvm1/rootfs'/>
<target dir='/'/>
</filesystem>
<interface type='network'>
<mac address='00:16:3e:3e:06:4d'/>
<source network='default'/>
<target dev='veth0'/>
</interface>
<console type='pty' tty='/dev/pts/2'>
<source path='/dev/pts/2'/>
<target type='lxc' port='0'/>
<alias name='console0'/>
</console>
<console type='pty'>
<source path='/dev/pts/6'/>
<target type='lxc' port='1'/>
<alias name='console1'/>
</console>
<console type='pty'>
<source path='/dev/pts/7'/>
<target type='lxc' port='2'/>
<alias name='console2'/>
</console>
</devices>
<seclabel type='none'/>
</domain>
11 years, 7 months
[libvirt-users] problem in view vm created by virsh create
by 高松
<domain type='kvm'>
<name>eucalyptus-windows</name>
<os>
<type>hvm</type>
<boot dev='cdrom'/>
</os>
<features>
<acpi/>
</features>
<memory>524288</memory>
<vcpu>1</vcpu>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file'>
<source file='/root/windows.server_2003_sp2.img'/>
<target dev='hda'/>
</disk>
<disk type='file' device='disk'>
<source file='/root/secondary.img'/>
<target dev='vda' bus='virtio'/>
</disk>
<disk type='file' device='floppy'>
<source file='/root/floppy.img'/>
<target dev='fda'/>
</disk>
<disk type='file' device='cdrom'>
<source file='/root/windows_server_2003_sp2.iso'/>
<target dev='hdc'/>
<readonly/>
</disk>
<interface type='bridge'>
<source bridge='eucabr899'/>
<model type='rtl8139'/>
</interface>
<!--<interface type='bridge'>
<source bridge='br0'/>
<model type='virtio'/>
</interface> -->
<graphics type='vnc' port='-1' listen='0.0.0.0' passwd='123456'/>
</devices>
</domain>
=========================================================
I issue the command of "virsh create libvirt-kvm-windows.xml" to create
a vm, and it is
successful.Above is the content,but when I try to connect to the VM both
try vinagre and
virt-manager,what I got is only black screen,I can't understand and
please help!
11 years, 7 months