[Libvir] Create domU without any disks

Hi, I'm working on RHEL5.1 (libvirt-0.2.3-9.el5). I would like to know if it is possible, using libvirt, to create a Xen PVM domU that has no disks? And if this is possible how to code this ( a simple example is ok). I can create a configfile for "xm create ..." that works (just use "disk = [ ]"). But I also need to do this koan (companion to cobbler) and it uses libvirt. Thanks, Tim -- Tim Verhoeven - tim.verhoeven.be@gmail.com - 0479 / 88 11 83 Hoping the problem magically goes away by ignoring it is the "microsoft approach to programming" and should never be allowed. (Linus Torvalds)

Tim Verhoeven wrote:
I'm working on RHEL5.1 (libvirt-0.2.3-9.el5). I would like to know if it is possible, using libvirt, to create a Xen PVM domU that has no disks? And if this is possible how to code this ( a simple example is ok).
Did you try taking the XML, either from another running domain or from the examples we give[1], and stripping out all the <disk> sections? I looked at the code and it ought to work -- if it doesn't, then it's probably a bug. Rich. [1] http://libvirt.org/format.html -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

Richard W.M. Jones wrote:
Tim Verhoeven wrote:
I'm working on RHEL5.1 (libvirt-0.2.3-9.el5). I would like to know if it is possible, using libvirt, to create a Xen PVM domU that has no disks? And if this is possible how to code this ( a simple example is ok).
Did you try taking the XML, either from another running domain or from the examples we give[1], and stripping out all the <disk> sections? I looked at the code and it ought to work -- if it doesn't, then it's probably a bug.
(From IRC), Tim says it works for Xen ... and I just verified that qemu doesn't like it.
Rich.
[1] http://libvirt.org/format.html
------------------------------------------------------------------------
-- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Thu, Nov 29, 2007 at 12:54:38PM -0500, Michael DeHaan wrote:
Richard W.M. Jones wrote:
Tim Verhoeven wrote:
I'm working on RHEL5.1 (libvirt-0.2.3-9.el5). I would like to know if it is possible, using libvirt, to create a Xen PVM domU that has no disks? And if this is possible how to code this ( a simple example is ok).
Did you try taking the XML, either from another running domain or from the examples we give[1], and stripping out all the <disk> sections? I looked at the code and it ought to work -- if it doesn't, then it's probably a bug.
(From IRC), Tim says it works for Xen ... and I just verified that qemu doesn't like it.
Yep, QEMU itself wants at least one disk otherwise it complains bitterly. One option is '-hda /dev/null' - libvirt should probably add this itself if no disks are set in the XML. 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 -=|

On Thu, Nov 29, 2007 at 05:18:20PM +0100, Tim Verhoeven wrote:
Hi,
I'm working on RHEL5.1 (libvirt-0.2.3-9.el5). I would like to know if it is possible, using libvirt, to create a Xen PVM domU that has no disks? And if this is possible how to code this ( a simple example is ok).
I can create a configfile for "xm create ..." that works (just use "disk = [ ]"). But I also need to do this koan (companion to cobbler) and it uses libvirt.
Well libvirt can dump XML for existing Xen domains, use virsh dumpxml domainname even if you used xm to create the domain. Now I suppose you will just end up with a dump without any <disk> entry in <devices> (but you will have a network one at least), Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

Tim Verhoeven wrote:
Hi,
I'm working on RHEL5.1 (libvirt-0.2.3-9.el5). I would like to know if it is possible, using libvirt, to create a Xen PVM domU that has no disks? And if this is possible how to code this ( a simple example is ok).
I can create a configfile for "xm create ..." that works (just use "disk = [ ]"). But I also need to do this koan (companion to cobbler) and it uses libvirt.
I'm thinking the answer is "don't add the disks in the code". Which I'm trying now to verify that works. I think it does. --virt-size=0 on the profile edit makes for good syntax, methinks. FWIW -- Tim mentioned on IRC that he wants this machine to keep the storage on ISCSI and was thinking about doing some interesting things to get the initrd out of Anaconda to save off an NFS partition (for startup purposes). So the usual bootup stuff won't work unless you pull out the initrd/etc. Any thoughts on that part?
Thanks, Tim
participants (5)
-
Daniel P. Berrange
-
Daniel Veillard
-
Michael DeHaan
-
Richard W.M. Jones
-
Tim Verhoeven