[libvirt] [virt-tools-list] [RFC] virt-disk : a command line tool for modify domain XML's disk of inactive domains.

KAMEZAWA Hiroyuki kamezawa.hiroyu at jp.fujitsu.com
Wed Feb 23 02:26:42 UTC 2011


On Tue, 22 Feb 2011 07:36:18 -0500
Cole Robinson <crobinso at redhat.com> wrote:

> On 02/21/2011 06:48 PM, KAMEZAWA Hiroyuki wrote:
> > On Mon, 21 Feb 2011 10:08:46 -0500
> > Cole Robinson <crobinso at redhat.com> wrote:
> > 
> >> On 02/21/2011 03:23 AM, KAMEZAWA Hiroyuki wrote:
> >>> Hi, now, with qemu, virsh attach-disk doesn't work with inactive disks and
> >>> we need to edit XML with virsh edit.
> >>> IIUC, libvirt and virsh is designed as it is.
> >>>
> >>> But I want to modify domain XML via commandline tools
> >>>  - for middleware, which modify domains by scripting.
> >>>  - for concsoles, where curses can't work correctly.
> >>>  - for me, I can't remember XML definition detaisl ;)
> >>>  
> >>> So, I write one.
> >>>
> >>> Following script is a script for modify domain XML and allows
> >>>   - add disks
> >>>   - delete disks
> >>>   - show list of disks
> >>>
> >>> I think most of elements defined in http://libvirt.org/formatdomain.html#elementsDisks
> >>> is supported. But I'm an only qemu user and didn't test with Xen and other VMs.
> >>>
> >>> What I wanted to hear opinions as 'RFC' is
> >>>  - Can this be shipped with libvirt as one of a tool ? (with more documents)
> >>>    (If so, we'll write other scripts for cpu,network,memory,etc...)
> >>>
> >>>  - If not, what is the best way other than making this as my house script ?
> >>>    I'm grad if this is shipped with libvirt is because catching new definition
> >>>    of XML is easy.
> >>>
> >>>  - Doesn't this one work with your environment ?
> >>>
> >>>  
> >>
> >> Thanks for taking a stab at this, I've been meaning to start a similar tool
> >> for some time. However, you should be able to leverage virtinst to accomplish
> >> nearly all the XML parsing, and reuse existing virt-install command line
> >> options and documentation. Additionally the tool could build or edit any
> >> arbitrary domain XML and wouldn't be specific to disks.
> >>
> > 
> > Thank you, that's the information I wanted to hear ...where this kind of command
> > should be packaged into. I'll look virt-inst package. And, as I wrote, this is 
> > just an example, we'll support all cpu,memory,interface,usb etc....
> > 
> > Do you think should all be supported by 'a' command ? or by a set of commands ?
> > 
> > [at modify cpu]
> > % virt-modify --cpu .....
> > or
> > % virt-cpu-modify   .....
> > 
> 
> I would say just a single command. I imagined it would be called virt-xml and
> would be able to do the following:
> 
> - Lookup an existing libvirt object and edit inactive XML in place
> - Lookup an existing libvirt object and perform hotplug operations
> - Take an XML document from a file or stdin and edit XML
> - Generate domain device XML, possibly also pool, vol, network, interface,
> etc. XML
> 
> Maybe we should have separate tools for domain vs. storage vs. network etc,
> but I think the first iteration of the tool will be domain specific anyways so
> we can defer the question for a bit.
> 

For me, the 1st choice is supporting virsh attach-disk because our customers
will move from Xen to KVM.
The reason customer moves from Xen to KVM is just because they'll move from RHEL5
to RHEL6.

Considering moving from RHEL5 to RHEL6, 'virsh-detach disk doesn't work as RHEL5'
is a regression. So, we'd like to fix virsh-attach/detach-disk. please allow.
(Customers don't are what is the bundled VM, just take care of commands they used
 works.)
 
But yes, I think doing 'full support' of XML in virsh.c will make the code dirty
commands complex. 

Hmm, but, after a brief hack, it seems libvirt's /conf codes does enough jobs.
I'll try 'virsh' 1st.

Thanks,
-Kame








More information about the libvir-list mailing list