Skip to contentSkip to conversation

Live migration without SDL

DISCUSSION Ty! Boyack 5 participants 6 messages Jul 10, 2008 – Jul 11, 2008 1 message not in the archive KVM

lore
Share & tools
lore

Ty! Boyack

author
#0 lore raw

Folks,

I'm afraid I'm missing something very basic here. I'm looking to try out the live migration facility, and all the documentation I'm seeing shows to initiate the migration by going to the qemu monitor from the SDL windows (alt-ctrl-2). However, I'd like to run my VMs with a VNC "head," so I'm not sure where the interface is to initiate the migration without the SDL layer in place.

Is the qemu monitor available through some other mechanism?

This would be most helpful if the mechanism was reachable (and scriptable) from the HOST os, so that the HOST (in cooperation with another HOST) could initiate a migration of one or more GUEST VMs.

If anyone could point me in the right direction, I would sure appreciate it.

I have not subscribed to the list, so e-mail replies would be appreciated.

-Ty!

Signature · 6 lines
-===========================-
 Ty! Boyack
 NREL Unix Network Manager
 [email protected]
 (970) 491-1186
-===========================-
#1 lore raw
Quoted 4 lines · Ty! Boyack

Folks,

I'm afraid I'm missing something very basic here. I'm looking to try out the live migration facility, and all the documentation I'm seeing shows to initiate the migration by going to the qemu monitor from the SDL windows (alt-ctrl-2). However, I'd like to run my VMs with a VNC "head," so I'm not sure where the interface is to initiate the migration without the SDL layer in place. Is the qemu monitor available through some other mechanism?

It's available through VNC fwiw, but you can also redirect it to somethign else with the -monitor option.

Regards,

Anthony Liguori

Quoted 10 lines

This would be most helpful if the mechanism was reachable (and scriptable) from the HOST os, so that the HOST (in cooperation with another HOST) could initiate a migration of one or more GUEST VMs.

If anyone could point me in the right direction, I would sure appreciate it.

I have not subscribed to the list, so e-mail replies would be appreciated.

-Ty!

#2 lore raw
In reply to Ty! Boyack

You can get to the monitor the same way in vnc as you do with the sdl gui.

You can also have the monitor connected to a socket or network port.

See the qemu docs for more info.

Quoted 21 lines · Ty! Boyack

Folks,

I'm afraid I'm missing something very basic here. I'm looking to try out the live migration facility, and all the documentation I'm seeing shows to initiate the migration by going to the qemu monitor from the SDL windows (alt-ctrl-2). However, I'd like to run my VMs with a VNC "head," so I'm not sure where the interface is to initiate the migration without the SDL layer in place.

Is the qemu monitor available through some other mechanism?

This would be most helpful if the mechanism was reachable (and scriptable) from the HOST os, so that the HOST (in cooperation with another HOST) could initiate a migration of one or more GUEST VMs.

If anyone could point me in the right direction, I would sure appreciate it.

I have not subscribed to the list, so e-mail replies would be appreciated.

-Ty!

#3 lore raw
In reply to Ty! Boyack
Quoted 8 lines · Ty! Boyack

Folks,

I'm afraid I'm missing something very basic here. I'm looking to try out the live migration facility, and all the documentation I'm seeing shows to initiate the migration by going to the qemu monitor from the SDL windows (alt-ctrl-2). However, I'd like to run my VMs with a VNC "head," so I'm not sure where the interface is to initiate the migration without the SDL layer in place.

I have no trouble switching to the monitor for a VM with a VNC head: alt-ctrl-2 works as expected in the VNC client.

Quoted 1 line

Is the qemu monitor available through some other mechanism?

You can configure qemu to expose the monitor console via any of the serial port configuration types. That lets you make the monitor available at a udp or tcp port, e.g.:

# qemu-system-x86_64 <other options> -monitor tcp::4444

The double colon is intended. There are lots of additional features beyond that example.

Quoted 3 lines

This would be most helpful if the mechanism was reachable (and scriptable) from the HOST os, so that the HOST (in cooperation with another HOST) could initiate a migration of one or more GUEST VMs.

That would be the "monitor" command line option then.

<snip>

Signature · 1 line
David.

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#5 lore raw

Great point. I'm hoping to get control of all the VMs on multiple hosts, but I plan to have a distributed application across all the hosts that talks over secure channels, but then the app on each host would connect to the individual monitors via a local socket.

FWIW, the goal is to have a tool that can (based on rules/policies) perform live migration of VMs to dynamically balance the loads and reduce total power consumption by powering down/up the hosts automatically. Do you know of any such project in the works already to which I should be looking to contribute, rather than starting from scratch?

And as long as I'm jumping topics all over on this thread (sorry), do you happen to have any idea why my live migration is failing on F9's qemu-kvm (kvm 65, qemu 0.9.1) with the following error:
qemu: warning: instance 0x38313339 of device '' not present in current VM

My startup line for both VMs is:
source:
/usr/bin/qemu-kvm -M pc -m 512 -smp 1 -name f9test -monitor tcp:127.0.0.1:4444,server,nowait -boot c -drive file=/VirtGuestRoots/F9test.img,if=ide,index=0,boot=on -net nic,macaddr=de:ad:be:ef:74:00,vlan=0 -net tap,script=/root/qemu-ifup,vlan=0,ifname=vnet0 -parallel none -vnc 127.0.0.1:0 -k en-us destination:
/usr/bin/qemu-kvm -M pc -m 512 -smp 1 -name f9test -monitor tcp:127.0.0.1:4444,server,nowait -boot c -drive file=/VirtGuestRoots/F9test.img,if=ide,index=0,boot=on -net nic,macaddr=de:ad:be:ef:74:00,vlan=0 -net tap,script=/root/qemu-ifup,vlan=0,ifname=vnet0 -parallel none -vnc 127.0.0.1:0 -k en-us -incoming tcp://0:636

And initiating the migration from the source's monitor via:
migrate -d tcp://destination:636

I had set serial to pty and enabled USB, but I pulled those options off thinking they might be causing the missing device. But still no luck. The disk image file is on a GFS share, and I have not yet looked to see if there is a locking issue with multiple hosts trying to open that image file at the same time. I don't think that is the case since I get the same error with offline migration where I stop the source VM, copy the image file to a new image file, start the destination VM in incoming mode with the new copy of the image file, and then initiate the migration. So it looks to me like somehow I'm getting a different device setup on the two systems.

Thanks again for all the help!

-Ty!

Quoted 14 lines

Please be aware of the security implications of allowing the monitor
to be accessed via VNC, or any other channel which does not require
strong authentication. If you have access to the monitor & guest, then in effect you have access to any file on the host machine that is readable by the user running QEMU, since you can use the monitor
to map any files into the guest as disks.

This is totally unauthenticated so anyone on your network can connect to it. I'd recommend using only the local-access methods for the monitor - UNIX socket, PIPE, PTY or STDIO, so that anyone
accessing it has to first login via secure channel like SSH.

Daniel

Signature · 6 lines
-===========================-
 Ty! Boyack
 NREL Unix Network Manager
 [email protected]
 (970) 491-1186
-===========================-
#6 lore raw
In reply to Ty! Boyack
Quoted 11 lines · Ty! Boyack

Folks,

I'm afraid I'm missing something very basic here. I'm looking to try out the live migration facility, and all the documentation I'm seeing shows to initiate the migration by going to the qemu monitor from the SDL windows (alt-ctrl-2). However, I'd like to run my VMs with a VNC "head," so I'm not sure where the interface is to initiate the migration without the SDL layer in place.

Is the qemu monitor available through some other mechanism?

as others also stated, qemu monitor is also available through vnc. maybe your vnc client blocks ALT. i have to click on the titlebar and choose "Alt" (realvnc).

but mostly i do redirect montior to a socket. with this command line
switches: -monitor unix:/var/run/kvm-<vm-name>,server,nowait

i then connect with a tool called socat (socat stdio /var/run/kvm-<vm- name>).

don't try to exit the console with "quit". :)

- Thomas