Project

General

Profile

Bug #24965

Can not start Stoped Openstack Servers

Added by Clemens Bergmann 3 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Category:
Compute resources - OpenStack
Target version:
-
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

When Clicking the link to start a Server that runs on openstack we get an Error that the policy does not allow this action.
The Reason lies in https://github.com/theforeman/foreman/blob/develop/app/models/concerns/fog_extensions/openstack/server.rb#L16. If the VM is in mode "SHUTOFF" it can not be started with resume_server but must be called with start_server.
I suspect that five years ago when this code was written (https://projects.theforeman.org/issues/2891). Openstack did not support the SHUTOFF state.
I suggest adding an if option for that state (https://github.com/cbergmann/foreman/commit/1e786556dea1a7e6127fd72e529fa374b62b606e).
The second question is how to implement the stop function. Currently it is implementend with "suspend_server" but I suggest changing this to stop_server.
In the Openstack enviroment we use (Open Telekom Cloud) the suspend Function is not allowed. VMs are only allowed to be started and stopped.
The problem is that this change would change the behavior for existing installations. VMs that where suspended before would then be stopped. That might irritate users.
What is your opinion on this?

Kind regards
Clemens

Associated revisions

Revision 39a7d53a (diff)
Added by Clemens Bergmann 3 months ago

Fixes #24965 - can't start Openstack Servers

Instead of suspending servers in openstack they should be stopped.

Revision 273d73be (diff)
Added by Stephen Benjamin 3 months ago

refs #24965 - add mising 'end' in openstack fog extensions

History

#1 Updated by Clemens Bergmann 3 months ago

  • Description updated (diff)

#2 Updated by Clemens Bergmann 3 months ago

  • Assignee set to Daniel Lobato Garcia

I suggest Daniel looks at this because he implemented the functions in the first place.

Thanks again.
Clemens

#3 Updated by Marek Hulán 3 months ago

  • Assignee deleted (Daniel Lobato Garcia)

Sorry, it's not how it works :-) Daniel might be busy with other tasks atm. Would you be interesting on working on the patch? We coukd try to help at our dev irc channel.

#4 Updated by Clemens Bergmann 3 months ago

Hi,

thanks for the reply.
Sorry for the assignment. I just wanted to notify Daniel because I thought he surely had a good reasons to use suspend and tried to ask him about these.
My suggested patch is in the commit found here: https://github.com/cbergmann/foreman/commit/1e786556dea1a7e6127fd72e529fa374b62b606e
Do you think this might be a valid change or would the implied change in behavior negatively affect user expectations?

#5 Updated by Marek Hulán 3 months ago

  • Category set to Compute resources - OpenStack

I'm not openstack domain expert but the patch looks reasonable to me. Would you mind opening a PR with this patch? Hopefully someone with more knowledge would review and test. If you're not sure about the process, please see https://theforeman.org/contribute.html#SubmitPatches

#6 Updated by The Foreman Bot 3 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6085 added

#7 Updated by Lukas Zapletal 3 months ago

  • Fixed in Releases 1.20.0 added

#8 Updated by The Foreman Bot 3 months ago

  • Assignee set to Stephen Benjamin
  • Pull request https://github.com/theforeman/foreman/pull/6086 added

#9 Updated by Anonymous 3 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF