incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1055024 - /incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
Date Tue, 04 Jan 2011 13:11:28 GMT
Author: mfojtik
Date: Tue Jan  4 13:11:28 2011
New Revision: 1055024

URL: http://svn.apache.org/viewvc?rev=1055024&view=rev
Log:
Fixed specifying a memory and cpu cores for instance

Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb?rev=1055024&r1=1055023&r2=1055024&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb Tue Jan
 4 13:11:28 2011
@@ -182,9 +182,9 @@ class RHEVMDriver < Deltacloud::BaseDriv
       vm_template = "<template id='#{image_id}'/>"
       vm_cluster = opts[:realm_id] ? "<cluster id='#{opts[:realm_id]}'/>" : "<cluster
id='0'/>"
       vm_type = opts[:hwp_id] ? "<type>#{opts[:hwp_id]}</type>" : "<type>DESKTOP</type>"
-      # FIXME: Setting a memory from RHEV-API leads to Internal Server Error on
-      # RHEV-M API side
       vm_memory = opts[:hwp_memory] ? "<memory>#{opts[:hwp_memory].to_i*1024}</memory>"
 : ''
+      vm_cpus = opts[:hwp_cpu] ? "<cpu><topology cores='#{opts[:hwp_cpu]}' sockets='1'/></cpu>"
 : ''
+      puts vm_cpus.inspect
       # TODO: Add storage here (it isn't supported by RHEV-M API so far)
       convert_instance(client, ::RHEVM::Vm::new(client, client.create_vm(
         "<vm>"+
@@ -192,7 +192,8 @@ class RHEVMDriver < Deltacloud::BaseDriv
         vm_template +
         vm_cluster +
         vm_type +
-        # vm_memory +
+        vm_memory +
+        vm_cpus +
         "</vm>"
       ).xpath('vm')))
     end
@@ -283,13 +284,13 @@ class RHEVMDriver < Deltacloud::BaseDriv
   # Disabling this error catching will lead to more verbose messages
   # on console (eg. response from RHEV-M API (so far I didn't figure our
   # how to pass those message to our exception handling tool)
-  def catched_exceptions_list
-    {
-      :auth => RestClient::Unauthorized,
-      :error => RestClient::InternalServerError,
-      :glob => [ /RestClient::(\w+)/ ]
-    }
-  end
+  #def catched_exceptions_list
+  #  {
+  #    :auth => RestClient::Unauthorized,
+  #    :error => RestClient::InternalServerError,
+  #    :glob => [ /RestClient::(\w+)/ ]
+  #  }
+  #end
 
 end
 



Mime
View raw message