WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

Re: [Xen-API] Constructors and Destructors on classes

To: Hetal Badheka <hetal.badheka@xxxxxxxxxx>
Subject: Re: [Xen-API] Constructors and Destructors on classes
From: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Date: Tue, 6 Mar 2007 16:45:35 +0000
Cc: xen-api@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 06 Mar 2007 08:44:34 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <45ED7C8A.9050408@xxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <45ED7C8A.9050408@xxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Tue, Mar 06, 2007 at 08:06:58PM +0530, Hetal Badheka wrote:

> Hello,
> 
> Does a constructor on class VM just create an instance of the class in 
> Xen's memory or does it actually provision a new VM and conversely, what 
> does a destructor do, delete the VM class instance from memory or 
> destroy a virtual machine?

Think of it like a database record.  VM.create creates a record, and
VM.destroy deletes that record again.  (Xend doesn't actually use a
DBMS, but that's the mental model you need).  A running domain is
created and destroyed using VM.start, VM.clean_shutdown, and so on.
VM.create does not imply that a domain is created to match -- you are
merely creating the record corresponding to a non-running VM.

> The class "host" and "host_cpu" also have create and destroy methods on 
> them and since you can't create and destroy a physical host or a 
> physical cpu, I am guessing that the answer to my question above for VMs 
> is that the create and destroy methods just instantiate and destroy a 
> class instance and do not actually cause the provisioning and 
> decommissioning of a virtual machine.

These methods should never have been added, and will be removed
immediately if they're still there.  A host and some host_cpu records
are created implicitly by Xend at startup.

HTH,

Ewan.

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api

<Prev in Thread] Current Thread [Next in Thread>