All of lore.kernel.org
 help / color / mirror / Atom feed
* QEMU / KVM support in libvirt & virt-manager
@ 2007-02-22 22:16 Daniel P. Berrange
       [not found] ` <20070222221654.GR22473-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel P. Berrange @ 2007-02-22 22:16 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

FYI, as of libvirt 0.2.0  and virt-manager 0.3.1 there is now (experimental!)
support for managing virtual machines running under QEMU or KVM virtualization
platforms, as well as the existing Xen support.

Project sites:

  http://libvirt.org/
  http://virt-manager.org/

Release announcements here:

  http://www.redhat.com/archives/libvir-list/2007-February/msg00033.html
  http://www.redhat.com/archives/et-mgmt-tools/2007-February/msg00121.html

A little background info, since we've not updated any docs yet... (yes we
suck, will do better with docs soon)

The QEMU driver provides a spawn-on-demand daemon which manages all the QEMU
instances, their monitor consoles, and config files for offline guest VMs.
The KVM support is implemented as part of the generic QEMU driver in libvirt,
and can be activated by setting the domain type to 'kvm' in the XML description
of a guest being created. As an example description of a KVM guest with QEMUs
slirp based user networking, a single harddisk and VNC graphics console, the
XML would look like:

  <domain type='kvm'>
    <name>demo</name>
    <uuid>c7a5fdb0-3daf-9455-926a-d65c16db1809</uuid>
    <memory>403456</memory>
    <currentMemory>403456</currentMemory>
    <vcpu>1</vcpu>
    <os>
      <type arch='i686' machine='pc'>hvm</type>
      <boot dev='hd'/>
    </os>
    <devices>
      <emulator>/usr/bin/qemu</emulator>
      <disk type='file' device='disk'>
        <source file='/home/berrange/q.img'/>
        <target dev='hda'/>
      </disk>
      <interface type='user'>
      </interface>
      <graphics type='vnc' port='-1'/>
    </devices>
  </domain>

The 'virsh' tool can be used to interact with libvirt & QEMU/KVM from the 
shell by specifying an explicit hypervisor URI. eg to list machines:

   virsh --connect  qemu://session  list

The 'virt-install' tool has also been adapted to support provisioning of
QEMU / KVM guests, for example:

   virt-install \
       --connect qemu://session \
       --name demo \
       --ram 400 \
       --file /home/berrange/q.img \
       --cdrom /home/berrange/fedora-core-6-boot-x86_64.iso \
       --accelerate  \
       --vnc \
       --vncport 5905

Finally, 'virt-manager' has been adapted to support all its usual management
capabilities for QEMU / KVM guests. Simply select 'QEMU' as the hypevisor
type when it puts up the initial 'open connection' dialog.

NB. These are the very first prototype releases to support QEM & KVM and
we know of many bugs[1] / limitations. We expect to have updated releases over
the coming weeks/months which will make it much more robust / generally useful
to regular users....

Regards,
Dan.

[1] The spawn-on-demand bit is broken, so requires /usr/libexec/libvirt_qemud
    to be run manually.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: QEMU / KVM support in libvirt & virt-manager
       [not found] ` <20070222221654.GR22473-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2007-02-25  5:32   ` Avi Kivity
       [not found]     ` <45E11F8A.8080306-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Avi Kivity @ 2007-02-25  5:32 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Daniel P. Berrange wrote:
> FYI, as of libvirt 0.2.0  and virt-manager 0.3.1 there is now (experimental!)
> support for managing virtual machines running under QEMU or KVM virtualization
> platforms, as well as the existing Xen support.
>
>   

Great; as I see it hit FC6-updates I'll give it a shot.

One thing I saw is that it pulls in Xen as part of the dependencies; 
perhaps a libvirt-xen and libvirt-kvm subpackage split is called for?

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: QEMU / KVM support in libvirt & virt-manager
       [not found]     ` <45E11F8A.8080306-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-02-25  8:34       ` Avi Kivity
       [not found]         ` <45E14A07.6090207-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  2007-02-25 15:50       ` Daniel P. Berrange
  1 sibling, 1 reply; 8+ messages in thread
From: Avi Kivity @ 2007-02-25  8:34 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Avi Kivity wrote:
> Daniel P. Berrange wrote:
>   
>> FYI, as of libvirt 0.2.0  and virt-manager 0.3.1 there is now (experimental!)
>> support for managing virtual machines running under QEMU or KVM virtualization
>> platforms, as well as the existing Xen support.
>>
>>   
>>     
>
> Great; as I see it hit FC6-updates I'll give it a shot.
>
>   

How is one supposed to use it?  I tried entering 'qemu://' and 'kvm://' 
in the 'other hypervisor' thingy, but that didn't work.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: QEMU / KVM support in libvirt & virt-manager
       [not found]     ` <45E11F8A.8080306-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  2007-02-25  8:34       ` Avi Kivity
@ 2007-02-25 15:50       ` Daniel P. Berrange
       [not found]         ` <20070225155025.GB4132-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel P. Berrange @ 2007-02-25 15:50 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Sun, Feb 25, 2007 at 07:32:58AM +0200, Avi Kivity wrote:
> Daniel P. Berrange wrote:
> >FYI, as of libvirt 0.2.0  and virt-manager 0.3.1 there is now 
> >(experimental!)
> >support for managing virtual machines running under QEMU or KVM 
> >virtualization
> >platforms, as well as the existing Xen support.
> >
> >  
> 
> Great; as I see it hit FC6-updates I'll give it a shot.
> 
> One thing I saw is that it pulls in Xen as part of the dependencies; 
> perhaps a libvirt-xen and libvirt-kvm subpackage split is called for?

Yeah, we've not figured out exactly how to address that dependancy
issue yet - the libvirt.so has to link to libxenstore as part of the
Xen driver, so even if you only want to manage QEMU instances we still
end up pulling in Xen. We're certainly going to make it possible to
turn off the Xen stuff at compile time. Not clear how we'd address the
RPM dep issue though because the Fedora builds of libvirt will include
both Xen & QEMU support. Perhaps we'll have to try a dlopen() approach.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: QEMU / KVM support in libvirt & virt-manager
       [not found]         ` <45E14A07.6090207-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-02-25 16:29           ` Daniel P. Berrange
       [not found]             ` <20070225162945.GA13570-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel P. Berrange @ 2007-02-25 16:29 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Sun, Feb 25, 2007 at 10:34:15AM +0200, Avi Kivity wrote:
> Avi Kivity wrote:
> >Daniel P. Berrange wrote:
> >  
> >>FYI, as of libvirt 0.2.0  and virt-manager 0.3.1 there is now 
> >>(experimental!)
> >>support for managing virtual machines running under QEMU or KVM 
> >>virtualization
> >>platforms, as well as the existing Xen support.
> >>
> >>  
> >>    
> >
> >Great; as I see it hit FC6-updates I'll give it a shot.
> 
> How is one supposed to use it?  I tried entering 'qemu://' and 'kvm://' 
> in the 'other hypervisor' thingy, but that didn't work.

The virt-manager in Fedora Core 6 hasn't been updated to the newest 
0.3.1 release yet - only the underling libvirt has been pushed to FC6
thus far. What follows is an example illustrating use of the low level 
'virsh' command. First we create an XML file describing the VM we want
to create, then create a file to serve as a disk image. Then we start
virsh connecting to the QEMU hypervisor, define the domain, start it
and dump the runtime info & XML. Finally it connects to the VNC port
to access the console

 $ cat > newvm.xml <<EOF
 <domain type='qemu'>
   <name>Fedora</name>
   <uuid>c7a5fdbdcdaf9455926ad65c16db1809</uuid>
   <os>
     <type>hvm</type>
     <boot dev='cdrom'/>
   </os>
   <memory>219200</memory>
   <vcpu>2</vcpu>
   <devices>
     <disk type='file' device='disk'>
       <source file='/home/berrange/fedora.img'/>
       <target dev='hda'/>
     </disk>
     <disk type='file' device='cdrom'>
       <source file='/home/berrange/boot.iso'/>
       <target dev='hdc'/>
     </disk>
     <interface type='user'>
       <mac address='00:16:3e:62:a5:08'/>
     </interface>
     <graphics type='vnc' port='5900'/>
   </devices>
 </domain>
 EOF
 $ dd if=/dev/zero of=/home/berrange/fedora.img bs=1M seek=5000 count=0
 $ virsh --connect qemu:///session
 Welcome to virsh, the virtualization interactive terminal.

 Type:  'help' for help with commands
        'quit' to quit

 virsh > define /home/berrange/qemu.xml
 Domain Fedora defined from /home/berrange/qemu.xml

 virsh > list --all
  Id Name                 State
 ----------------------------------
   - Fedora               shut off

 virsh > start Fedora
 Domain Fedora started

 virsh > list
  Id Name                 State
 ----------------------------------
   4 Fedora               running

 virsh > dominfo Fedora
 Id:             4
 Name:           Fedora
 UUID:           c7a5fdbd-cdaf-9455-926a-d65c16db1809
 State:          running
 CPU(s):         2
 CPU time:       0.0s
 Max memory:     219200 kB
 Used memory:    219200 kB

 virsh > dumpxml Fedora
 <domain type='qemu' id='4'>
   <name>Fedora</name>
   <uuid>c7a5fdbd-cdaf-9455-926a-d65c16db1809</uuid>
   <memory>219200</memory>
   <currentMemory>219200</currentMemory>
   <vcpu>2</vcpu>
   <os>
     <type arch='i686' machine='pc'>hvm</type>
     <boot dev='cdrom'/>
   </os>
   <devices>
     <emulator>/usr/bin/qemu</emulator>
     <disk type='file' device='cdrom'>
       <source file='/home/berrange/boot.iso'/>
       <target dev='hdc'/>
       <readonly/>
     </disk>
     <disk type='file' device='disk'>
       <source file='/home/berrange/fedora.img'/>
       <target dev='hda'/>
     </disk>
     <interface type='user'>
     </interface>
     <graphics type='vnc' port='5900'/>
   </devices>
 </domain>

 virsh > quit

 $ vncviewer :0

 VNC Viewer Free Edition 4.1.2 for X - built 
 ...


The above illustrates creating a QEMU domain. The use of KVM is
completely identical - still use  qemu:///session as the hypervisor
URL. The change is in the XML file describing the guest VM - in the
top level '<domain>' attribute use type='kvm' instead of type='qemu'.
You can also use type='kqemu' if desired. NB you can create 'qemu'
guests as an user, but if you want to create kvm/kqemu guests you
must either be root, or chown the device nod.e

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: QEMU / KVM support in libvirt & virt-manager
       [not found]         ` <20070225155025.GB4132-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2007-02-25 16:48           ` Avi Kivity
  0 siblings, 0 replies; 8+ messages in thread
From: Avi Kivity @ 2007-02-25 16:48 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Daniel P. Berrange wrote:
> On Sun, Feb 25, 2007 at 07:32:58AM +0200, Avi Kivity wrote:
>   
>> Daniel P. Berrange wrote:
>>     
>>> FYI, as of libvirt 0.2.0  and virt-manager 0.3.1 there is now 
>>> (experimental!)
>>> support for managing virtual machines running under QEMU or KVM 
>>> virtualization
>>> platforms, as well as the existing Xen support.
>>>
>>>  
>>>       
>> Great; as I see it hit FC6-updates I'll give it a shot.
>>
>> One thing I saw is that it pulls in Xen as part of the dependencies; 
>> perhaps a libvirt-xen and libvirt-kvm subpackage split is called for?
>>     
>
> Yeah, we've not figured out exactly how to address that dependancy
> issue yet - the libvirt.so has to link to libxenstore as part of the
> Xen driver, so even if you only want to manage QEMU instances we still
> end up pulling in Xen. We're certainly going to make it possible to
> turn off the Xen stuff at compile time. Not clear how we'd address the
> RPM dep issue though because the Fedora builds of libvirt will include
> both Xen & QEMU support. Perhaps we'll have to try a dlopen() approach.
>
>   

I would suggest a /usr/lib/libvirt/xen.so and a 
/usr/lib/libvirt/qemu.so, which are enumerated by reading 
/usr/lib/libvirt, and dlopen()ed by libvirt.so.  Only 
/usr/lib/libvirt/xen.so links to libxenstore.

That way, a third party can add a backend by dropping a .so into 
/usr/lib/libvirt, and libvirt.so itself has no backend-related 
dependencies -- it doesn't know anything concrete about the backends, in 
fact.


-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: QEMU / KVM support in libvirt & virt-manager
       [not found]             ` <20070225162945.GA13570-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2007-02-27 15:20               ` Avi Kivity
       [not found]                 ` <45E44C3B.3010305-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Avi Kivity @ 2007-02-27 15:20 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Daniel P. Berrange wrote:
> The virt-manager in Fedora Core 6 hasn't been updated to the newest 
> 0.3.1 release yet - only the underling libvirt has been pushed to FC6
> thus far.

Will we see it in FC6-updates?  I'd like to try it, but I'm not keen on 
rawhide.


-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: QEMU / KVM support in libvirt & virt-manager
       [not found]                 ` <45E44C3B.3010305-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-02-27 15:31                   ` Daniel P. Berrange
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel P. Berrange @ 2007-02-27 15:31 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Tue, Feb 27, 2007 at 05:20:27PM +0200, Avi Kivity wrote:
> Daniel P. Berrange wrote:
> >The virt-manager in Fedora Core 6 hasn't been updated to the newest 
> >0.3.1 release yet - only the underling libvirt has been pushed to FC6
> >thus far.
> 
> Will we see it in FC6-updates?  I'd like to try it, but I'm not keen on 
> rawhide.

Understandable :-)

I'll push it out to FC6 updates soon - I need to do more testing to
ensure I don't introduce regressions in the otherwise stable FC6 stack.

Regards,
Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-02-27 15:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-22 22:16 QEMU / KVM support in libvirt & virt-manager Daniel P. Berrange
     [not found] ` <20070222221654.GR22473-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2007-02-25  5:32   ` Avi Kivity
     [not found]     ` <45E11F8A.8080306-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-02-25  8:34       ` Avi Kivity
     [not found]         ` <45E14A07.6090207-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-02-25 16:29           ` Daniel P. Berrange
     [not found]             ` <20070225162945.GA13570-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2007-02-27 15:20               ` Avi Kivity
     [not found]                 ` <45E44C3B.3010305-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-02-27 15:31                   ` Daniel P. Berrange
2007-02-25 15:50       ` Daniel P. Berrange
     [not found]         ` <20070225155025.GB4132-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2007-02-25 16:48           ` Avi Kivity

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.