Power on a terminated instance

Asked by HP

How to power on a previously terminated instance?
Example: I have a running instance i-00000001, I terminate it by calling *euca-terminate-instances i-00000001*
Now that instance's data still remain in the database (mysql/nova), and I want to boot it again without having to use any image to create a new instance.
If I use euca-run-instance, I would have to provide an image id and that would create a new instance, not the one I terminated before.
Would much appreciate if you answer this question for both ec2-api and openstack api.
Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Vish Ishaya (vishvananda) said :
#1

Terminate deletes the instance permanently. If you have an instance that exists but is not running you should be able to use euca-reboot-instances

On Jul 28, 2011, at 1:21 PM, HP wrote:

> New question #166294 on OpenStack Compute (nova):
> https://answers.launchpad.net/nova/+question/166294
>
> How to power on a previously terminated instance?
> Example: I have a running instance i-00000001, I terminate it by calling *euca-terminate-instances i-00000001*
> Now that instance's data still remain in the database (mysql/nova), and I want to boot it again without having to use any image to create a new instance.
> If I use euca-run-instance, I would have to provide an image id and that would create a new instance, not the one I terminated before.
> Would much appreciate if you answer this question for both ec2-api and openstack api.
> Thanks
>
> --
> You received this question notification because you are a member of Nova
> Core, which is an answer contact for OpenStack Compute (nova).

Revision history for this message
HP (huy-pham-sc) said :
#2

Thanks. How do I power off an instance using Openstack API or ec2 API?
Of course one can shutdown the instance manually through ssh, but I am interested in getting this done through API, like some services that server can automatically handle.

Revision history for this message
Vish Ishaya (vishvananda) said :
#3

There isn't a command in the api to power off. In the OS admin api there is pause or suspend which are close.

Vish

On Jul 28, 2011, at 7:35 PM, HP wrote:

> Question #166294 on OpenStack Compute (nova) changed:
> https://answers.launchpad.net/nova/+question/166294
>
> Status: Answered => Open
>
> HP is still having a problem:
> Thanks. How do I power off an instance using Openstack API or ec2 API?
> Of course one can shutdown the instance manually through ssh, but I am interested in getting this done through API, like some services that server can automatically handle.
>
> --
> You received this question notification because you are a member of Nova
> Core, which is an answer contact for OpenStack Compute (nova).

Revision history for this message
Farzad Zarasvand (zarasvand) said :
#4

You can use os-start action in nova compute

method: POST
url: http://192.168.1.10:8774/v2/<tenant_id>/servers/<server_id>/action

body:

{
  "os-start":{}
}

Can you help with this problem?

Provide an answer of your own, or ask HP for more information if necessary.

To post a message you must log in.