[Ovirt-devel] Managed Node qpid Modeling

Ian Main imain at redhat.com
Tue Jul 22 17:56:38 UTC 2008


OK, one more time :)

Daniel and I went through it some more and this is where we're at currently.  It's basically the libvirt API with some methods moved to properties.  I did do one last iteration since Dan last looked at it but at this point I think it'd be best to just implement it and work out the kinks then.

This version does not have any lookup methods in it.  According to Ted Ross the management infrastructure tracks all the objects and lookups can be done through the management infrastructure.

<schema package="Libvirt">

  <!-- This is an object model of the libvirt API.
       access: Access mode: RC = Read/Create, RO = read only, RW = read/write.
       dir: Direction of argument: I = in, O = out, IO = in/out.
  -->

  <!-- In libvirt this is really the 'Connect' class, I may end up changing it.. -->

  <class name="Node">
    <property name="type" type="sstr" desc="Hypervisor type"/>
    <property name="hostname" type="sstr" access="RC" desc="Host name"/>
    <property name="version" type="sstr" access="RC" desc="Hypervisor Version"/>
    <property name="uri" type="sstr" access="RC" desc="URI of libvirt"/>
    <property name="libvirt_version" type="sstr" access="RC" desc="Version of libvirt on the managed node"/>
    
    <!-- Set up an association of the node with the host info class. -->
    <property name="host_info" type="objId" reference="NodeInfo" 
     desc="Host information and statistics gathered from qpid modeling agent."/>

    <!-- This should be a property or statistic, but I think it's too slow to poll? -->
    <method name="get_free_memory" desc="provides the free memory available on the Node.">
      <arg name="result" dir="O" type="int64" desc="Amount of free memory in KB."/>
    </method>

    <method name="define_domain_xml" desc="Define a new domain, but does not start it.">
      <arg name="xml_desc" dir="I" type="sstr" desc="XML domain description"/>

      <arg name="domain" dir="O" type="sstr" desc="Newly created domain object"/>
    </method>
   
    <method name="storage_pool_define_xml" 
     desc="Define a new inactive storage pool based on its XML description. The pool is persistent, until explicitly undefined.">
      <arg name="xml_desc" type="sstr" desc="XML Description of the storage pool"/>
      
      <arg name="pool" dir="O" type="ObjID" desc="Newly created storage pool"/>
    </method>
    
    <method name="storage_pool_create_xml" 
     desc="Create a new storage based on its XML description. The pool is not persistent, so its definition will disappear when it is destroyed, or if the host is restarted">
      <arg name="xml_desc" type="sstr" desc="XML Description of the storage pool"/>
      
      <arg name="pool" dir="O" type="ObjID" desc="Newly created storage pool"/>
    </method>
  </class>

  <!-- Mapped in from the 'Node' class. -->
  <class name="NodeInfo">
    <property name="model" type="sstr"/>
    <property name="memory" type="int64"/>
    <property name="cpus" type="int32"/>
    <property name="mhz" type="int32"/>
    <property name="nodes" type="int32"/>
    <property name="sockets" type="int32"/>
    <property name="cores" type="int32"/>
    <property name="threads" type="int32"/>
  </class>

  <class name="Domain">
    <property name="uuid" type="sstr" desc="Domain UUID"/>
    <property name="name" type="sstr" desc="Domain name"/>
    <property name="id" type="sstr" desc="Hypervisor Domain id"/>
    
    <!-- Set up an association of hosts to VMs.  This will setup a domain list in the node object
         and give us a reference here to the node object. -->
    <property name="node" type="objId" reference="Node" desc="Node of this VM"/>
    
    <property name="domain_info" type="objId" reference="DomainInfo" 
     desc="Domain information.  This will be updated on a regular basis."/>

    <method name="create" desc="Start stopped VM"/>
    </method>
    
    <method name="destroy" desc="Stop this VM"/>
    </method>
    
    <method name="undefine" desc="Undefine the domain"/>
    </method>
    
    <method name="suspend" desc="Suspend this VM"/>
    </method>

    <method name="resume" desc="Resume suspended VM"/>
    </method>

    <method name="save" desc="Save this VM"/>
      <arg name="filename" type="sstr" desc="Name of file to save VM image in"/>
    </method>
    
    <method name="restore" desc="Restore saved VM"/>
      <arg name="filename" type="sstr" desc="Name of file to restore from"/>
    </method>
    
    <method name="shutdown" desc="Shutdown a VM"/>
    </method>

    <method name="reboot" desc="Reboot VM"/>
    </method>
    
    <method name="xml_desc" desc="Return an XML description of the domain."/>
      <arg name="description" dir="O" type="sstr" desc="XML description of the domain."/>
    </method>
    
    
    <method name="migrate" desc="Migrate this VM to another host"/>
      <arg name="destination_node" dir="I" type="ObjID" desc="Object representing destination host."/>
      <arg name="flags" dir="I" type="int32" desc="Flags for migration, see documentation for details."/>
      <arg name="new_domain_name" dir="I" type="sstr" desc="New domain name on new host if applicable."/>
      <arg name="uri" dir="I" type="sstr" desc="Destination hostname/URI as seen from host."/>
      <arg name="bandwidth" dir="I" type="int32" desc="Maximum bandwidth to consume in Mbps."/>
      
      <arg name="domain" dir="O" type="ObjID" desc="New VM object on new host"/>
    </method>
  </class>

  <class name="DomainInfo">
    <property name="state" type="sstr" desc="State of Domain.  'suspended', 'running' etc."/>
    <property name="maximum_memory" type="int64" desc="Maximum memory allowed in KB."/>
    <property name="memory" type="int64" desc="Memory used in KB."/>
    <property name="num_vcpus" type="int32" desc="Number of virtual CPUs."/>
    <property name="cpu_time" type="int64" desc="CPU time used in nanoseconds."/>
  </class>

  <class name="Pool">
    <property name="uuid" type="sstr" desc="Pool UUID"/>
    <property name="name" type="sstr" desc="Pool host"/>
    
    <!-- Set up an association of hosts to storage pools.  This will setup a list of pools in the node object
         and give us a reference here to the node. -->
    <property name="node" type="objId" reference="Node" desc="Node of this storage pool"/>
    
    <method name="xml_desc" desc="Return an XML description of the storage pool."/>
      <arg name="description" dir="O" type="sstr" desc="XML description of the storage pool."/>
    </method>
    
    <method name="create" desc="Starts an inactive storage pool.">
    </method>
    
    <method name="destroy" desc="Destroy an active storage pool. This will deactivate the pool on the host, but keep any persistent config associated with it. If it has a persistent config it can later be restarted with a create() call">
    </method>

    <method name="delete" desc="Destroy the pool and delete its definition">
    </method>
    
    <method name="create_volume_xml" desc="Create a storage volume within a pool based on an XML description.  Not all pool types support volume creation.">

      <arg name="xml_desc" type="sstr" desc="XML Description of the volume to create"/>
      
      <arg name="volume" dir="O" type="ObjID" desc="Newly created volume"/>
    </method>
    
    <method name="lookup_volume_by_name" desc="Look up a storage volume by name.">
      <arg name="volume_name" dir="I" type="sstr" desc="Volume name."/>
      <arg name="volume" dir="O" type="ObjID" desc="Volume if found."/>
    </method>

    <method name="lookup_volume_by_key" desc="Look up a storage volume by key.">
      <arg name="volume_key" dir="I" type="sstr" desc="Volume key."/>
      <arg name="volume" dir="O" type="ObjID" desc="Volume if found."/>
    </method>

    <method name="lookup_volume_by_path" desc="Look up a storage volume by path.">
      <arg name="volume_path" dir="I" type="sstr" desc="Volume path."/>
      <arg name="volume" dir="O" type="ObjID" desc="Volume if found."/>
    </method>
  </class>
 
  <class name="Volume">
    <property name="key" type="sstr" desc="Storage volume key"/>
    <property name="path" type="sstr" desc="Storage volume path"/>
    <property name="name" type="sstr" desc="Storage volume name"/>

    <property name="storage_pool" type="objId" reference="Pool" desc="Pool where this storage volume exists"/>

    <method name="xml_desc" desc="Return an XML description of the volume."/>
      <arg name="description" dir="O" type="sstr" desc="XML description of the volume."/>
    </method>
  </class>

</schema>




More information about the ovirt-devel mailing list