EC2 terminate allows partial terminations

Bug #979336 reported by Joshua Harlow
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Joe Gordon

Bug Description

When using ec2 it seems like all the instance ids that are given should either be terminated or none should be terminated? Currently it looks like the EC2 terminate operation can partially succeed, then throw an exception (thus signifying failure when actually some instances were terminated).

See: https://github.com/openstack/nova/blob/master/nova/api/ec2/cloud.py#L1318

You will notice that the instance ids are validated inside the loop, instead of beforehand, thus if instance ids 1, 2, 3 are passed in, 3 could be invalid, but 1 and 2 would have been terminated already, but an exception would be thrown for #3, thus sending a error back to the user, when really 2 instances were terminated.

That seems bad. Possible verify before u terminate and report partial success....

Tags: ec2
Revision history for this message
Joshua Harlow (harlowja) wrote :

This also seems valid for reboot instances, stop instances, ......

Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
tags: added: ec2
Joe Gordon (jogo)
Changed in nova:
assignee: nobody → Joe Gordon (joe-gordon0)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/12747

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/12747
Committed: http://github.com/openstack/nova/commit/c2501d81b581536ae83793ac3d9879899f21dc1d
Submitter: Jenkins
Branch: master

commit c2501d81b581536ae83793ac3d9879899f21dc1d
Author: Joe Gordon <email address hidden>
Date: Tue Sep 11 00:22:55 2012 +0000

    Prevent Partial terminations in EC2

    When passing in a valid and an invalid EC2 id, the API should not partially
    execute the command, and instead just return an error.

    Fix bug 979336

    Also prevents partial:
    * starts
    * stops
    * reboots

    Change-Id: I28fb4f34aadfb7af14774db983d44584e61c5414

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-rc1 → 2012.2
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.