[Ovirt-devel] Managed Node qpid Modeling

Ian Main imain at redhat.com
Thu Jul 10 04:55:44 UTC 2008


So here's what I've come up with so far.  I have run this past a few folks and hopefully it's in a reasonable shape now.  I suspect there may be some aspects that are lacking or need changing but that's what lots of eyes are for. :)  Also once we get into implementation it'll flesh itself out.

For those who haven't seen this yet, this is an XML markup for qpid modeling.  qpid is an implementation of the AMQP specification, see http://cwiki.apache.org/qpid/ for more information.  The modeling aspect is pretty new and I don't know if there's any good documentation on it yet.  It's also not released yet so I guess that's to be expected.. :)

This defines a model or object oriented API that taskomatic will use to talk to the managed nodes.  Properties are updated when set on the nodes and statistics are pushed at a regular interval.  Methods can be called asynchronously or synchronously.  

The idea is to unify our communications between the nodes and wui with qpid modeling.  If you look at what is available here and what taskomatic, host-status, host-collect and even some of ovirt-identify-node do, you'll see that's pretty much all contained within this model/API.

So please take a look and feel free to post questions or comments.

Thanks!

	Ian

--

<schema package="ManagedNode">

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

  <class name="Node">
    <property name="uuid" index="y" type="sstr" access="RC"/>
    <property name="hypervisor_type" type="sstr" desc="Hypervisor type"/>
    <property name="hardware_pool_id" type="sstr" desc="Hardware pool this host belongs to"/>
    <property name="hostname" type="sstr" access="RC" desc="Host name"/>
    <property name="OS version" type="sstr" access="RC" desc="Operating system information and version"/>
    <property name="arch" type="sstr" access="RC" desc="Architecture"/>
    <property name="num_cpus" type="sstr" access="RC" desc="Number of CPUs on system"/>
    <property name="cpu_speed" type="sstr" access="RC" desc="Speed of CPUs"/>
    <property name="memory" type="sstr" access="RC" desc="Amount of memory in KB"/>
  
    <!-- Statistics are pushed to the broker every 10s by default from the agent. -->
    <statistic name="load_average" type="count64" unit="message" desc="Load average of host"/>
    <statistic name="free_memory" type="count64" unit="message" desc="Amount memory available in KB"/>
 
    <!-- We may get this for free in the broker.  We'll have to see. -->
    <statistic name="heartbeat" type="count64" unit="message" desc="Incremented in 5 second intervals to measure host availability"/>

    <method name="create_domain" desc="Start a new domain">
      <arg name="description" dir="I" type="sstr" desc="Domain description"/>
      <arg name="vcpus" dir="I" type="unit32" desc="Number of virtual CPUs"/>
      <arg name="max_memory" dir="I" type="unit32" desc="Maximum memory allocated in KB"/>
      <arg name="current_memory" dir="I" type="unit32" desc="Memory to use in KB"/>
      <arg name="boot_device" dir="I" type="sstr" desc="Boot device"/>

      <arg name="domain" dir="O" type="sstr" desc="Newly created domain object"/>
      <arg name="result" dir="O" type="ObjID" desc="Description of result.  'success' or 'failure: error msg'"/>
    </method>

    <method name="create_storage_pool" desc="Create a new storage pool">
      <arg name="uuid" type="sstr" desc="Storage pool UUID"/>
      <arg name="description" type="sstr" desc="Storage pool description"/>
      <arg name="type" type="sstr" desc="Type of storage; nfs, iscsi etc."/>
      <arg name="allocation" type="uint64" desc="Allocation size in KB"/>
      <arg name="capacity" type="uint64" desc="Capacity to allocate in bytes"/>
      <arg name="available" type="uint64" desc="The free space available for allocating new volumes in the pool in KB"/>
      <arg name="host" type="sstr" desc="Storage host"/>
      <arg name="device_path" type="sstr" desc="Device path"/>

      <arg name="pool" dir="O" type="sstr" desc="Newly created storage pool"/>
      <arg name="result" dir="O" type="ObjID" desc="Description of result.  'success' or 'failure: error msg'"/>
    </method>
  </class>

  <class name="Domain">
    <property name="uuid" type="sstr" desc="Domain UUID"/>
    <property name="boot_volume" type="ObjID" desc="Boot storage volume object"/>
    <property name="boot_device" type="sstr" desc="Boot device"/>
    <property name="num_vcpus" type="uint32" desc="Number of virtualized CPUs for domain"/>
    <property name="num_vcpus_used" type="uint32" desc="Number of virtualized CPUs used"/>
    <property name="memory_allocated" type="uint32" desc="Amount of memory allocated for domain in KB"/>
    <property name="memory_used" type="uint32" desc="Amount of memory used by domain in KB"/>
    <property name="vnic_mac_addr" type="sstr" desc="Virtualized NIC MAC address"/>
    <property name="state" type="sstr" desc="VM State: 'running', 'stopped', 'suspended'"/>
    <property name="vnc_port" type="uint32" access="RW" index="y" desc="VNC viewer port"/>
    
    <!-- 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"/>
    
    <method name="add_volume" desc="Add a storage volume to this VM"/>
      <arg name="storage_volume" type="ObjID" desc="storage volume to add to Domain"/>
      <arg name="target" type="sstr" desc="target for volume"/>

      <arg name="result" dir="O" type="sstr" desc="Description of result.  'success' or 'failure: error msg'"/>
    </method>
    
    <method name="remove_volume" desc="Add a storage volume to this VM"/>
      <arg name="storage_volume" type="ObjID" desc="storage volume to add to remove"/>
      
      <arg name="result" dir="O" type="sstr" desc="Description of result.  'success' or 'failure: error msg'"/>
    </method>


    <method name="start" desc="Start stopped VM"/>
      <arg name="result" dir="O" type="sstr" desc="Description of result.  'success' or 'failure: error msg'"/>
    </method>
    
    <method name="stop" desc="Stop this VM"/>
      <arg name="result" dir="O" type="sstr" desc="Description of result.  'success' or 'failure: error msg'"/>
    </method>
    
    <method name="destroy" desc="Destroy this VM instance"/>
      <arg name="result" dir="O" type="sstr" desc="Description of result.  'success' or 'failure: error msg'"/>
    </method>
    
    <method name="suspend" desc="Suspend this VM"/>
      <arg name="result" dir="O" type="sstr" desc="Description of result.  'success' or 'failure: error msg'"/>
    </method>

    <method name="resume" desc="Resume suspended VM"/>
      <arg name="result" dir="O" type="sstr" desc="Description of result.  'success' or 'failure: error msg'"/>
    </method>

    <method name="save" desc="Save this VM"/>
      <arg name="filename" type="sstr" desc="Name of file to save VM image in"/>
      <arg name="result" dir="O" type="sstr" desc="Description of result.  'success' or 'failure: error msg'"/>
    </method>
    
    <method name="restore" desc="Restore saved VM"/>
      <arg name="result" dir="O" type="sstr" desc="Description of result.  'success' or 'failure: error msg'"/>
    </method>
    
    <method name="migrate" desc="Migrate this VM to another host"/>
      <arg name="host" dir="I" type="ObjID" desc="Object representing a host to migrate to"/>
      
      <arg name="result" dir="O" type="sstr" desc="Description of result.  'success' or 'failure: error msg'"/>
      <arg name="domain" dir="O" type="sstr" desc="New VM object on new host"/>
    </method>
  </class>

  <class name="Pool">
    <property name="uuid" type="sstr" desc="Pool UUID"/>
    <property name="hostname" type="sstr" desc="Pool host"/>
    <property name="device_info" type="sstr" desc="Target device name or nfs path"/>
    <property name="type" type="sstr" desc="Storage type"/>

    <!-- 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="destroy" desc="Destroy this storage pool">
      <arg name="result" dir="O" type="ObjID" desc="Description of result.  'success' or 'failure: error msg'"/>
    </method>
  </class>
 
  <class name="Volume">
    <property name="uuid" type="sstr" access="RC" index="y" desc="Storage Volume UUID"/>
    <property name="path" type="sstr" desc="Storage volume path"/>
    <property name="size" type="sstr" desc="Volume size in KB"/>
    <property name="type" type="sstr" desc="Storage type"/>
    <property name="lun" type="sstr" desc="Target lun if iscsi"/>

    <!-- A storage volume is linked to a domain.  -->
    <property name="domain" type="objId" reference="Domain" desc="Domains using this storage volume"/>

    <!-- And also linked to its storage pool.  I think we can make this populate as soon as the storage
         pool is created on the host, so a list of volumes would show up in the pool as a property.  -->
    <property name="storage_pool" type="objId" reference="Pool" desc="Pool where this storage volume exists"/>
  </class>

</schema>






More information about the ovirt-devel mailing list