Bug #24965
closedCan not start Stoped Openstack Servers
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