[libvirt-users] A RFE for libvirt

Hi, I am a libvirt user , there is a requirement about libvirt : I need a virsh cmd like "#virsh *create-as* --disk --net " to create a very sample guest I have not xml file and I think it's a little hard for me to create a NEW xml for libvirt , so I need a virsh cmd like "vol-create-as " help me do that. I know there are a lot of options for creating a guest , I just need --disk and --net options , others libvirt can set a defaut value . I just want an easy way to create a guest :> Wenlong -- Best Regards! Wenlong Huang IRC Account: wenlong Phone: 62608117 / 15011214521

On 06/05/2012 12:23 AM, whuang wrote:
Hi,
I am a libvirt user , there is a requirement about libvirt : I need a virsh cmd like "#virsh *create-as* --disk --net " to create a very sample guest I have not xml file and I think it's a little hard for me to create a NEW xml for libvirt , so I need a virsh cmd like "vol-create-as " help me do that. I know there are a lot of options for creating a guest , I just need --disk and --net options , others libvirt can set a defaut value . I just want an easy way to create a guest :>
I personally find it easier to use virt-manager or virt-install or gnome-boxes to create an initial guest template, then to modify that XML for any final tweaks before using the guest in earnest. I'm not sure how easy it would be to add guest templating directly into libvirt, nor whether it would be duplicating effort that has already been coded elsewhere. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 2012年06月07日 06:38, Eric Blake wrote:
On 06/05/2012 12:23 AM, whuang wrote:
Hi,
I am a libvirt user , there is a requirement about libvirt : I need a virsh cmd like "#virsh *create-as* --disk --net " to create a very sample guest I have not xml file and I think it's a little hard for me to create a NEW xml for libvirt , so I need a virsh cmd like "vol-create-as " help me do that. I know there are a lot of options for creating a guest , I just need --disk and --net options , others libvirt can set a defaut value . I just want an easy way to create a guest :>
I personally find it easier to use virt-manager or virt-install or gnome-boxes to create an initial guest template, then to modify that XML for any final tweaks before using the guest in earnest. I'm not sure how easy it would be to add guest templating directly into libvirt,
It would need too much defaults, and differs for different hypervisor drivers, and it's a good question that what defaults are the best choices for each driver. (recall Daniel Berrange talked it internally for qemu driver). I once thought the RFE is not a valid request from a command p.o.v (if we provide too much options for the various config tags, it's just duplicate work of tools like virt-install, and somehow it's even not better than XML), but now IMHO it'd be wonderful if we have the best default configuration template for each driver. And if so, using the templates to implement the command will make sense. Regards, Osier

Thanks guys ,I will use virt-install to create simple guest for me . 于 06/07/2012 05:04 PM, Osier Yang 写道:
On 2012年06月07日 06:38, Eric Blake wrote:
On 06/05/2012 12:23 AM, whuang wrote:
Hi,
I am a libvirt user , there is a requirement about libvirt : I need a virsh cmd like "#virsh *create-as* --disk --net " to create a very sample guest I have not xml file and I think it's a little hard for me to create a NEW xml for libvirt , so I need a virsh cmd like "vol-create-as " help me do that. I know there are a lot of options for creating a guest , I just need --disk and --net options , others libvirt can set a defaut value . I just want an easy way to create a guest :>
I personally find it easier to use virt-manager or virt-install or gnome-boxes to create an initial guest template, then to modify that XML for any final tweaks before using the guest in earnest. I'm not sure how easy it would be to add guest templating directly into libvirt,
It would need too much defaults, and differs for different hypervisor drivers, and it's a good question that what defaults are the best choices for each driver. (recall Daniel Berrange talked it internally for qemu driver).
I once thought the RFE is not a valid request from a command p.o.v (if we provide too much options for the various config tags, it's just duplicate work of tools like virt-install, and somehow it's even not better than XML), but now IMHO it'd be wonderful if we have the best default configuration template for each driver. And if so, using the templates to implement the command will make sense.
Regards, Osier
-- Best Regards! Wenlong Huang IRC Account: wenlong Phone: 62608117 / 15011214521

On 06/07/2012 03:04 AM, Osier Yang wrote:
I once thought the RFE is not a valid request from a command p.o.v (if we provide too much options for the various config tags, it's just duplicate work of tools like virt-install, and somehow it's even not better than XML), but now IMHO it'd be wonderful if we have the best default configuration template for each driver. And if so, using the templates to implement the command will make sense.
The idea of templates has merit. I could see it being similar to how we have <nwfilter> and even <network> as templates, where a <domain> can refer to one of these other entities by name instead of calling out the details itself. That is, we would add a new virDomainTemplatePtr, whose XML is a subset of <domain> XML, then you could write a domain that uses <domain template='xyz'>...</domain> which picks up defaults from template xyz instead of the current default of omitting anything not specified. A template could specify typical memory usage, things such as default disk policy (cache='writethrough' vs. cache='none', use of virtio, and so forth), a default graphics device (spice vs. vnc setup, or serial console only), existence of the plumbing for a guest agent, and so forth. I could also see libosinfo providing a set of templates for use in conjunction with various guest OS, even having such things as a template tuned for a guest acting as a mail hub vs. a different template tuned for a guest acting as a database server, or a template that knows Windows and Linux support a guest agent vs. a guest that lacks an agent. But it sounds like quite a bit of work, and it's not at the top of my personal to-do list (since I have a lot on my plate for improving snapshot and storage volume management). I'm more throwing the idea out there in the hopes that someone else will be able to take and run with it (I will gladly review patches, though!) -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

[ CC to libvir-list for further discussing ] On 2012年06月07日 20:20, Eric Blake wrote:
On 06/07/2012 03:04 AM, Osier Yang wrote:
I once thought the RFE is not a valid request from a command p.o.v (if we provide too much options for the various config tags, it's just duplicate work of tools like virt-install, and somehow it's even not better than XML), but now IMHO it'd be wonderful if we have the best default configuration template for each driver. And if so, using the templates to implement the command will make sense.
The idea of templates has merit. I could see it being similar to how we have<nwfilter> and even<network> as templates, where a<domain> can refer to one of these other entities by name instead of calling out the details itself. That is, we would add a new virDomainTemplatePtr, whose XML is a subset of<domain> XML, then you could write a domain that uses <domain template='xyz'>...</domain> which picks up defaults from template xyz instead of the current default of omitting anything not specified. A template could specify typical memory usage, things such as default disk policy (cache='writethrough' vs. cache='none', use of virtio, and so forth), a default graphics device (spice vs. vnc setup, or serial console only), existence of the plumbing for a guest agent, and so forth.
It's quite good thought from my p.o.v. That means we don't have to focus too much on what are the best defaults for each driver, as we could have multiple templates, each of them could use the best choices for different purposes. I could also see libosinfo providing a set of templates
for use in conjunction with various guest OS, even having such things as a template tuned for a guest acting as a mail hub vs. a different template tuned for a guest acting as a database server, or a template that knows Windows and Linux support a guest agent vs. a guest that lacks an agent.
Sounds excited. Yeah, libosinfo could help.
But it sounds like quite a bit of work,
Yes. Work will be big. and it's not at the top of my
personal to-do list (since I have a lot on my plate for improving snapshot and storage volume management). I'm more throwing the idea out there in the hopes that someone else will be able to take and run with it (I will gladly review patches, though!)
It needs to figure out lot of stuffs before the real work, I'm willing to do the work if we have a clear plan after the discussion and if I'm not buried in the work on my plate too much. Regards, Osier
participants (4)
-
Eric Blake
-
Osier Yang
-
whuang
-
Xing.x.Gao