0

I have created server via the web UI of my hosting provider. I want to be able to stop (shutdown) and start this server on demand from another server via their Openstack API.

I am using php-opencloud/openstack. I can get server by:

 $compute = $openstack->computeV2(['region' => $region]);
 $server = $compute->getServer(['id' => $server_id]);
 $server->retrieve();

then I can reboot via:

$server->reboot();

but how can I just stop the server and then start it ?

1 Answer 1

0

It turns out this functionality is not implemented yet, but I found a solution here: https://github.com/php-opencloud/openstack/pull/75/files

The API documentation about this can be found here: http://developer.openstack.org/api-ref-compute-v2.1.html#os-server-actions-v2.1

Basically you have to send "os-start" and "os-stop", the code in github shows how.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .