From: "Daniel P. Berrange" <berrange-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: QEMU / KVM support in libvirt & virt-manager
Date: Sun, 25 Feb 2007 16:29:45 +0000 [thread overview]
Message-ID: <20070225162945.GA13570@redhat.com> (raw)
In-Reply-To: <45E14A07.6090207-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
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
next prev parent reply other threads:[~2007-02-25 16:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
[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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070225162945.GA13570@redhat.com \
--to=berrange-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox