Comment 2 for bug 905270

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/2417
Committed: http://github.com/openstack/nova/commit/932f3aafd1c735a8ec9e158a94ebb983d6baeb0e
Submitter: Jenkins
Branch: master

commit 932f3aafd1c735a8ec9e158a94ebb983d6baeb0e
Author: Isaku Yamahata <email address hidden>
Date: Wed Dec 14 16:15:52 2011 +0900

    Unbreak start instance and fixes bug 905270

    This patch fixes the bug 905270
    https://bugs.launchpad.net/nova/+bug/905270

    According to EC2 documentation, EBS-instances that initiated shutdown
     result in stopped state. And then it can be started again. (On the
     other hand non-EBS instance result in terminted when instance
     initiated shutdown)

    However, the current nova case, the shutdowned instance always results
     in terminated status. As related issues are
     - describe-instance-attribute instance_initiated_shutdown_behavior doesn't
       work correctly
     - instance attribute disable_api_termination isn't supported
     - stop instance was broken by the change set of the following.
       It needs unbreak.

      > commit eb03d47fecd3bfc24243da29ee01679b334a08fe
      > Author: Vishvananda Ishaya <email address hidden>
      > Date: Fri Sep 23 09:22:32 2011 -0700
      >
      > Remove AoE, Clean up volume code
      >
      > * Removes Ata Over Ethernet
      > * Adds drivers to libvirt for volumes
      > * Adds initialize_connection and terminate_connection to volume api
      > * Passes connection info back through volume api
      >
      > Change-Id: I1b1626f40bebe8466ab410fb174683293c7c474f

    This patch
    - unbreak start instance
    - implement instance_initiated_shutdown_behavior and make it EC2 compatible
    - implement disable_api_termination

    ---
    Changes 5 -> 6:
    - fixes to catch up 26b7b9457a5899ecca93fd67d3879efcad4e4968

    Changes 4 -> 5:
    - HACKING compilance

    Changes 3 -> 4:
    - rebased to 4c5586a28fd7a085369c49f6039876ffdc86b526
      sqlalchemy migrate version

    Changes 2 -> 3:
    - rename long name to shorter one
      s/instance_initiated_shutdown_behavior/shutdown_terminate/g
      s/disable_api_termination/disable_terminate/g
      as suggested Kevin L. Mitchell
    - improved nova.api.ec2.cloud._state_description
    - pep8
    - broken out patches are available for easy review at
      git://github.com/yamahata/nova.git lp905270-2

    Changes 1 -> 2:
    - fixed an unit test failure pointed out by Mark.
      (I think ebtabls failure strongly suggests installation problem)
    - introduce vm_states.SHUTOFF and put instance state which is in
      power_state.{NOSTATE, SHUTOFF} into vm_states.SHUTOFF.
    - simplified logic a bit by vm_states.SHUTOFF as suggested by Vish.
    - instance_initiated_shutdown_behavior:String(255)
       =>
      instance_initiated_shutdown_terminate:Boolean()
      as suggested by Vish.
    - Added Johannes Erdfelt to reviews as they written the vm_states state
      machine checker.
      I'd have liked to add David Subiros either, but he doesn't seem to be a
      registered user of the gerrit.

    Change-Id: Ibeb94f65137feadad2c343913b39195e3f96a35e