-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completely stop/suspend VM, not just partially #206
Conversation
cc @miha-plesko |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sasoc thanks for this awesome PR, I only have two cosmetic comments, otherwise looks really good.
context '.raw_stop' do | ||
it 'stops the virtual machine' do | ||
expect(connection).to receive(:post_undeploy_vapp).with('id', :UndeployPowerAction => 'powerOff').and_return(response) | ||
expect(connection).to receive(:process_task).and_return(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't really need the .and_return(true)
part, please feel free to remove it (also below, for suspend).
let(:ems) { FactoryGirl.create(:ems_vmware_cloud) } | ||
let(:vm) { FactoryGirl.create(:vm_vcloud, :ext_management_system => ems, :ems_ref => 'id') } | ||
let(:connection) { double('connection') } | ||
let(:response) { double('response', :body => nil) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicking, but can you please vertically align {
. I know that Rubocop says nothing, but still it's prettier.
If you stop/suspend VM in vCloud Director UI, it stops/suspends completely. But when calling same action using vCloud API it only stops/suspends VM partially, that is because it stays in `deployed` state. To reach the same effect as in vCloud Director UI we now use`post_undeploy_vapp` with `UndeployPowerAction'` set to `'powerOff'`/`'suspend'` Signed-off-by: sasoc <saso.cvitkovic@gmail.com>
acde81f
to
4c60f14
Compare
Checked commit sasoc@4c60f14 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 nice @sasoc
Completely stop/suspend VM, not just partially (cherry picked from commit 30e5ad2) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1553389
Gaprindashvili backport details:
|
If you stop/suspend VM in vCloud Director UI, it stops/suspends completely. But when calling same action using vCloud API it only stops/suspends VM partially, that is because it stays in
deployed
state. To reach the same effect as in vCloud Director UI we now usepost_undeploy_vapp
with'UndeployPowerAction'
set to'powerOff'
/'suspend'
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1551534