Enable ACPI call for Stop/Terminate

Bug #1346741 reported by Thiago Martins
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned
OpenStack Dashboard (Horizon)
Invalid
Wishlist
Kamlesh Kapoor

Bug Description

Add a "Stop Instance" button to Horizon, so it will be possible to shutdown a instance using ACPI call (like running "virsh shutdown instance-000000XX" directly at the Compute Node.

Currently, the Horizon button "Shut Off Instance" just destroy it.

I'm not seeing a way to gracefully shutdown a instance from Horizon.

Thiago Martins (martinx)
summary: - Enable "Stop Instance" buttons
+ Enable "Stop Instance" button
Changed in horizon:
assignee: nobody → Kamlesh Kapoor (kamlesh-kapoor)
Revision history for this message
Victoria Martinez de la Cruz (vkmc) wrote : Re: Enable "Stop Instance" button

What do you mean with the 'Shut off' button destroy the instance? 'Shut off' calls nova stop action.

What is the expected behavior?

Revision history for this message
Thiago Martins (martinx) wrote : Re: [Bug 1346741] Re: Enable "Stop Instance" button

Victoria,

The Horizon / Dashboard command "Shut Off Instance" does not do a
gracefully halt, the instance is just destroyed (like cutting energy source
of physical hardware - "virsh destroy instance-000001"), which can cause
data loss.

I think that we need a new button ("Stop Instance"), to gracefully halt an
instance (like pushing ACPI Power Button of physical hardware - "virsh
shutdown instance-00000001").

-
 Thiago

On 25 July 2014 15:14, Victoria Martínez de la Cruz <
<email address hidden>> wrote:

> What do you mean with the 'Shut off' button destroy the instance? 'Shut
> off' calls nova stop action.
>
> What is the expected behavior?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1346741
>
> Title:
> Enable "Stop Instance" button
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/horizon/+bug/1346741/+subscriptions
>

Revision history for this message
Julie Pichon (jpichon) wrote : Re: Enable "Stop Instance" button

Hi Thiago. Shut off uses the "nova stop" API in the backend. Could you let us know what Nova API call you would expect this new button to make?

Revision history for this message
Thiago Martins (martinx) wrote :

Julie,

I'm stoned, it seems that Nova does not have an API to send an ACPI call to Power Off an instance. Or, "nova stop <server>" is broken.

I read this:

http://docs.openstack.org/user-guide/content/nova_cli_stop_start.html

And this:

http://docs.openstack.org/user-guide/content/novaclient_commands.html

And I an unable to figure out how to gracefully shutdown an Instance from Nova... It seems that OpenStack Nova is missing this one.

This is very odd... :-/

I found a command that is similar, called "shelve", which gracefully shuts down a Instance but, it also triggers a snapshot, which is not desired (when you just want to shut it down).

So, what can we do?!

Should I fill a bug report at Nova?

Thanks in advance!

Best,
Thiago

Revision history for this message
Thiago Martins (martinx) wrote :

BTW Julie,

I'm not alone, look:

[Openstack-operators] Graceful VM shutdown:
http://lists.openstack.org/pipermail/openstack-operators/2013-May/003015.html

[Openstack] [Nova] How to graceful shutdown a windows instance on kvm hypervisor?
http://lists.openstack.org/pipermail/openstack/2013-November/002848.html

See it? There are more people looking for this feature... It is very weird that OpenStack does not come with this by default.

Regards,
Thiago

Revision history for this message
Gary W. Smith (gary-w-smith) wrote :

Marking as wishlist since this is really a new feature request. This will also require a new feature in nova.

Changed in horizon:
importance: Undecided → Wishlist
Revision history for this message
Thiago Martins (martinx) wrote :

Guys,

I just realized one more thing... This new "feature in nova", that is required to make this "Stop button" to work, which is an `ACPI Call` called via libvirt at the Compute Node, needs to be applied to "Terminate button" too!

I mean, currently, the "Terminate button" also does not gracefully shutdown an instance! It simple destroys it.

This is very bad, simple because lots of cloud providers (Like AWS EC2, RackSpace, etc) sends an `ACPI Call` to a instance that is about to be destroyed, this is the only way to trigger the famous "decommissioning scripts" within an instance, that is heavily used by Righscale, for example, and by my company.

The current implementation of Nova (libvirt), make it impossible to decommission an Instance! Because it is just destroyed (not gracefully halted), so, `init 0` is never triggered by the Linux guest S.O..

So, before "Terminate", and delete an Instance, Nova needs to first, send an `ACPI call` to trigger "init 0" on Linux instances, wait about 5 minutes to destroy (and delete) it, then, the decommissioning scripts will work.

Best!
Thiago

Revision history for this message
Julie Pichon (jpichon) wrote :

Opening a task on Nova based on the last couple of comments, also tweaked the description accordingly. Maybe someone more familiar with Nova can shed more light on what is needed here.

summary: - Enable "Stop Instance" button
+ Enable ACPI call for Stop/Terminate
Revision history for this message
Sean Dague (sdague) wrote :

Nova already does this with the os-stop operation, which which by default send a clean shutdown signal (verified this code path in libvirt driver right now).

POST /severs/%UUID/action

{ 'os-stop': null}

This looks like this is exposed via server.stop() in the python novaclient.

Revision history for this message
Sean Dague (sdague) wrote :

There is a set of configuration required to determine whether or not stop should be graceful or not, sharing your nova.conf is important to determine why it's not happening in your environment.

Changed in nova:
status: New → Incomplete
Sean Dague (sdague)
Changed in nova:
status: Incomplete → Invalid
Revision history for this message
Akihiro Motoki (amotoki) wrote :

horizon depends on nova API, so there is nothing to do in horizon side with the current situation. Marking this as Invalid.

Changed in horizon:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.