You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2011/07/21 13:06:33 UTC

svn commit: r1149114 - in /incubator/deltacloud/trunk/server: lib/deltacloud/base_driver/features.rb lib/deltacloud/drivers/vsphere/vsphere_driver.rb views/instances/new.html.haml

Author: mfojtik
Date: Thu Jul 21 11:06:32 2011
New Revision: 1149114

URL: http://svn.apache.org/viewvc?rev=1149114&view=rev
Log:
VSphere: Renamed user_data feature to user_iso

Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/features.rb
    incubator/deltacloud/trunk/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
    incubator/deltacloud/trunk/server/views/instances/new.html.haml

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/features.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/features.rb?rev=1149114&r1=1149113&r2=1149114&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/features.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/features.rb Thu Jul 21 11:06:32 2011
@@ -175,6 +175,14 @@ module Deltacloud
       end
     end
 
+    declare_feature :instances, :user_iso do
+      description "Make user-defined ISO available inside instance"
+      operation :create do
+        param :user_iso, :string, :optional, [],
+        "Base64 encoded gzipped ISO file will be accessible as CD-ROM drive in instance"
+      end
+    end
+
     declare_feature :instances, :user_files do
       description "Accept up to 5 files to be placed into the instance before launch."
       operation :create do

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb?rev=1149114&r1=1149113&r2=1149114&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb Thu Jul 21 11:06:32 2011
@@ -27,10 +27,10 @@ module Deltacloud::Drivers::VSphere
     include Deltacloud::Drivers::VSphere::Helper
     include Deltacloud::Drivers::VSphere::FileManager
 
-    # You can use 'user_data' feature to set 'user_data' parameter when creating
+    # You can use 'user_iso' feature to set 'user_iso' parameter when creating
     # a new instance where this parameter can hold gzipped CDROM iso which will
     # be mounted into created instance after boot
-    feature :instances, :user_data
+    feature :instances, :user_iso
     feature :instances, :user_name
 
     # There is just one hardware profile where memory is measured using maximum
@@ -229,12 +229,12 @@ module Deltacloud::Drivers::VSphere
         # encoded gzipped ISO image.
         # This image will be uplaoded to the Datastore given in 'realm_id'
         # parameter and them attached to instance.
-        if opts[:user_data] and not opts[:user_data].empty?
+        if opts[:user_iso] and not opts[:user_iso].empty?
           device = vm[:instance].config.hardware.device.select { |hw| hw.class == RbVmomi::VIM::VirtualCdrom }.first
           if device
-            VSphere::FileManager::store_iso!(datastore, opts[:user_data], "#{opts[:name]}.iso")
+            VSphere::FileManager::store_iso!(datastore, opts[:user_iso], "#{opts[:name]}.iso")
             machine_config[:extraConfig] << {
-              :key => 'user_data_file', :value => "#{opts[:name]}.iso"
+              :key => 'user_iso_file', :value => "#{opts[:name]}.iso"
             }
             device.backing = RbVmomi::VIM.VirtualCdromIsoBackingInfo(:fileName => "[#{opts[:realm_id] || vm[:datastore]}] "+
                                                                      "/#{VSphere::FileManager::DIRECTORY_PATH}/#{opts[:name]}.iso")
@@ -299,7 +299,7 @@ module Deltacloud::Drivers::VSphere
     # well.
     def destroy_instance(credentials, instance_id)
       vm = find_vm(credentials, instance_id)
-      user_file = vm[:instance].config[:extraConfig].select { |k| k.key == 'user_data_file' }.first
+      user_file = vm[:instance].config[:extraConfig].select { |k| k.key == 'user_iso_file' }.first
       VSphere::FileManager::delete_iso!(vm[:instance].send(:datastore).first, user_file.value) if user_file
       vm[:instance].Destroy_Task.wait_for_completion
     end

Modified: incubator/deltacloud/trunk/server/views/instances/new.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/instances/new.html.haml?rev=1149114&r1=1149113&r2=1149114&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/views/instances/new.html.haml (original)
+++ incubator/deltacloud/trunk/server/views/instances/new.html.haml Thu Jul 21 11:06:32 2011
@@ -27,11 +27,11 @@
         %option
         - @load_balancers.each do |load_balancer|
           %option{:value => load_balancer.id} #{load_balancer.id}
-  -if driver_has_feature?(:user_data)
+  -if driver_has_feature?(:user_iso)
     %p
       %label
-        User data (Base64):
-      %textarea{:name => :user_data, :cols => 60, :rows => 10, :placeholder => "Copy&Paste a Base64 string here..."}
+        User ISO (Base64):
+      %textarea{:name => :user_iso, :cols => 60, :rows => 10, :placeholder => "Copy&Paste a Base64 string here..."}
   -if driver_has_feature?(:authentication_key)
     %p
       %label