On Tue, Apr 18, 2006 at 05:40:07PM -0400, Daniel Veillard wrote:
On Tue, Apr 18, 2006 at 04:40:13PM -0400, Daniel Veillard wrote:
> So we have 2 more APIs which allows to define the XML for a domain
> and name it. That then allow to reserve that name, and the domain may be started
> later with a simpler API.
Since I have troubles understanding why you have such an issue with this,
let's try to be as clear as possible. What I would expect is the following
APIs to be added:
/* define a domain, but does not start it */
virDomainPtr virDomainDefineXML(virConnectPtr conn, const char *xml);
/* undefine a domain but does not stop it if running */
int virDomainUndefine(virDomainPtr domain);
/* list the defined domains */
int virConnectListDefinedDomains(virConnectPtr conn, const char **names,
int maxnames);
/* launch a defined domain */
int virDomainCreate(virDomainPtr domain);
What would you anticipate the scope of the domains defined with these
APIs to be. Would they be visible to only to the app defining them (ie
just kept in process memory), shared between any locally running app
using libvirt on the host, or shared between arbitrary apps connecting
to the HV, even if connecting remotely ?
extensions to the current behaviour:
- new state for defined non-running domains showing in virNodeGetInfo
- virDomainLookupByName() could return a defined non-running domain
- virDomainCreateLinux() would fail if a domain with the same name is
already defined
- a number of existing APIs would fail on defined but non-running domains.
that's it. Now what is fundamentally wrong with that ? You don't have to
use it if you don't need it I assume the problem is harder than this.
There is nothing fundamentally wrong - *if* you are only aiming to support
the needs of a simple local management tool. In the broader case though it
does not look to be effective because it:
- Pre-supposes that there is a relation between a passive VM
and a particular host. This may be true in the simple local case, of
VMWare Workstation type tool, but in a distributed environment it is
just doesn't make any sense - you have a group of passives VMs and
a group of potential hosts to run them on - there is no 1-to-1 mapping
between passive domains & hosts.
- Pre-supposes that the application creating/editing the passive VM
configurations wants to store them in the libvirt XML format. Again
while this may be true in the basic case it doesn't bear up to more
interesting scenarios, such as the idea of VM templates. In such a
case a generic template would define # of CPUs, # disk adapters, and
other general VM capabilities. A passive VM would only maintain perhaps
its name, path to disk image & a template name.
- Assumes that passive domains are concept which neccessarily even exist
a head of time. A web server farm may merely comprise a stateless OS
image, and a set of potential hosts - domains for new OS images are
defined on the fly as demand requires.
Now I know there is nothing that requires an application to make use of these
APIs - one could simply call virDomainCreate(const char *xml) at the time the
new domain is needed, but in doing so there are now a broad set of scenarios
where 'virConnectListDefinedDomains' will return an empty list.
So I think my core question is - what are the client application uses cases
& scenarios which these APIs are intended to serve. If the app use cases /
scenario were clearly described, then it could well be the case that the
points I raise above are completely irrelevant. But without this info on
uses cases I can't say whether the APIs described are sufficiently flexible
or not.
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 -=|