2009/4/2 Daniel P. Berrange <berrange@redhat.com>
On Thu, Apr 02, 2009 at 06:36:15PM +0400, Evgeniy Sokolov wrote:The trouble with this is that given the XML config of a guest, you can
>
> Config /etc/vz/conf/ve-XXX.conf-sample define there are many parameters
> like memory, CPU etc. This parameters are not properties of <filesystem>.
>
> Daniel, usage of pre-defined configs in really usefull. Can we create
> additional tag inside <domain></domain>?
no longer determine what its configuration is, because a large amount
of configuration is hidden in this opaque 'template'.
If we're to support templates, I think we need to make them first class
objects, so you can query what templates exist, and see their associated
config settings.
eg, expose a simple API
virDomainTemplatePtr;
int virConnectListDomainTemplates(virConnectPtr conn, const char **names);
virDomainTemplatePtr virDomainTemplateLookupbyName(virConnectPtr con, const char *name)
char *virDomainTemplateGetXMLDesc(virDomainTemplatePtr tmpl);
virDomainTemplatePtr virDomainTemplateDefineXML(virConnectPtr conn, const char *xml)
int virDomainTemplateUndefine(virDomainTemplatePtr tmpl);
int virDomainTemplateFree(virDomainTemplatePtr tmpl);
Then, we could either include a <template>$NAME</template> parameter in
the XML for a guest. Or have an alternate API for creating guests
virDomainCreateXMLWithTemplate(virConnectPtr conn,
const char *xmlDesc,
const char *template)
It depends whether we'd want to track the template <-> guest association
forever, or just use it once to fill-in the guest XML and then forget
about the template after that.