|  |  | 
  
    |  |  | 
 
  |   |  | 
  
    |  |  | 
  
    |  |  | 
  
    |   xen-api
Re: [Xen-API] Constructors and Destructors on classes 
| 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
 | 
 |  | 
  
    |  |  |