deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 1/3] VSphere: Report instance launch time
Date Thu, 25 Oct 2012 12:31:54 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb | 2 ++
 server/views/instances/show.xml.haml                    | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
index 43818fe..d4879ef 100644
--- a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
+++ b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
@@ -182,6 +182,7 @@ module Deltacloud::Drivers::Vsphere
           else
             public_addresses = [InstanceAddress.new(vm.guest[:net].first[:ipAddress].first)]
           end
+          p vm.runtime[:bootTime]
           Instance.new(
             :id => properties[:name],
             :name => properties[:name],
@@ -194,6 +195,7 @@ module Deltacloud::Drivers::Vsphere
             :private_addresses => [],
             :instance_profile => instance_profile,
             :actions => instance_actions_for( instance_state ),
+            :launch_time => vm.runtime.props[:bootTime],
             :create_image => true
           )
         end
diff --git a/server/views/instances/show.xml.haml b/server/views/instances/show.xml.haml
index a91c0c5..6a888f7 100644
--- a/server/views/instances/show.xml.haml
+++ b/server/views/instances/show.xml.haml
@@ -26,7 +26,7 @@
         %link{:rel => 'run', :method => :post, :href => "#{run_instance_url(@instance.id)};id=#{@instance.id}"}
       - if @instance.can_create_image?
         %link{:rel => 'create_image', :method => :post, :href => "#{create_image_url};instance_id=#{@instance.id}"}
-  - if @instance.instance_variables.include?("@launch_time")
+  - if @instance.launch_time
     %launch_time<
       =@instance.launch_time
   - if @instance.public_addresses
-- 
1.7.12.1


Mime
View raw message