Bug 772752

Summary: Monitor, instances - restart is really sending a "reset" to vsphere
Product: [Retired] CloudForms Cloud Engine Reporter: wes hayutin <whayutin>
Component: aeolus-conductorAssignee: Michal Fojtik <mfojtik>
Status: CLOSED CURRENTRELEASE QA Contact: wes hayutin <whayutin>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.0.0CC: akarol, deltacloud-maint, mfojtik, rlandy, ssachdev
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: http://server/conductor/deployments/1?details_tab=instances
Whiteboard:
Fixed In Version: r1235216 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-30 17:17:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Screenshot of Vsphere console with 'Reboot guest' lines none

Description wes hayutin 2012-01-09 21:25:50 UTC
Description of problem:
Monitor, instances - restart is really sending a "reset" to vsphere

Recreate:
1. start a vsphere instance via aeolus conductor
2. navigate to the deployment, click "restart"

Expected results:
The instance goes through the reboot process.. 

Actual results:
The box is reset, meaning the power is pulled and instance boots back up.



[root@qeblade31 yum.repos.d]# rpm -qa | grep aeolus
aeolus-conductor-daemons-0.9.0-1.el6.noarch
rubygem-aeolus-cli-0.4.0-1.el6.noarch
rubygem-aeolus-image-0.4.0-1.el6.noarch
aeolus-all-0.9.0-1.el6.noarch
aeolus-configure-2.6.0-1.el6.noarch
aeolus-conductor-0.9.0-1.el6.noarch
aeolus-conductor-doc-0.9.0-1.el6.noarch
[root@qeblade31 yum.repos.d]# rpm -qa | grepd deltacloud
-bash: grepd: command not found
[root@qeblade31 yum.repos.d]# rpm -qa | grep deltacloud
deltacloud-core-ec2-0.5.0-0.rc1.el6.noarch
deltacloud-core-vsphere-0.5.0-0.rc1.el6.noarch
deltacloud-core-0.5.0-0.rc1.el6.noarch
rubygem-deltacloud-client-0.4.0-3.el6.noarch
deltacloud-core-rhevm-0.5.0-0.rc1.el6.noarch

Comment 1 wes hayutin 2012-01-12 16:34:13 UTC
adding to ce-sprint

Comment 2 wes hayutin 2012-01-12 16:40:31 UTC
removing ce-sprint-next tracker

Comment 3 Tomas Hrcka 2012-01-23 14:47:10 UTC
vsphere doesn§t support ACPI reboot operation just reset: http://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.VirtualMachine.html

Comment 4 Michal Fojtik 2012-01-24 12:11:19 UTC
diff --git a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
index 581500a..a2a5249 100644
--- a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
+++ b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
@@ -317,7 +317,7 @@ module Deltacloud::Drivers::VSphere
 
     # Reboot an instance, given its id.
     def reboot_instance(credentials, id)
-      find_vm(credentials, id)[:instance].ResetVM_Task
+      find_vm(credentials, id)[:instance].RebootGuest
     end
 
     # Start an instance, given its id.

Comment 5 Michal Fojtik 2012-01-24 14:13:18 UTC
Tests:

Processing /api/instances/test-setup/reboot (for 127.0.0.1 at Tue Jan 24 15:12:30 +0100 2012) [POST] [VSphere]
Parameters: {"_method"=>"post"}
Provider: vsphere.virt.bos.redhat.com
Authentication: Basic
Server: thin 1.3.1 codename Triple Espresso
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8


Completed in 0.000000 | 0.000000 | 303 | text/html | http://localhost:3045/api/instances/test-setup/reboot

==========

Current results: In console I can see the instance is being rebooted.

Comment 7 Ronelle Landy 2012-01-24 16:43:23 UTC
Tested that a 'reboot' action from Delatcloud results in a "reboot guest" not a 'restart' or 'power down'

 Command issued from Delatcloud:

curl -X POST --user 'uname:password' "http://server:3003/api/instances/Deployment-4jmu1-testVsphere/reboot?format=xml"

See attached screenshot for Vsphere console registering this action as a reboot.

Also Deltacloud API always shows the guest as running (truncated API output copied below):

 curl -X GET --user 'username:password' "http://server/api/instances/Deployment-4jmu1-testVsphere?format=xml"
<?xml version='1.0' encoding='utf-8' ?>
...
  <state>RUNNING</state>
  ...
  <private_addresses></private_addresses>
</instance>

Comment 8 Ronelle Landy 2012-01-24 16:44:15 UTC
Created attachment 557266 [details]
Screenshot of Vsphere console with 'Reboot guest' lines