Rebuilding Stopped Instance Sets Terminated_at

Bug #1189554 reported by Andrew Melton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Phil Day

Bug Description

At the end of a rebuild action, nova checks the original vm_state of the instance to see if it was stopped. If the instance was originality stopped, nova will stop the newly rebuild instance. Right before the stop, nova updates the instance and sets it's terminated_at to utcnow(). Due to this, the periodic usage audit does not send usage for the instance.

Steps to reproduce:
1) With instance_usage_audit turned on.
2) Stop instance, observe vm_state = 'stopped', empty terminated_at
3) Rebuild instance
4) After rebuild completes, observe populated terminated_at
5) After period ends, observe that no compute.instance.exists is generated for newly rebuilt instance.

Tags: compute
description: updated
melanie witt (melwitt)
tags: added: compute
melanie witt (melwitt)
Changed in nova:
importance: Undecided → High
status: New → Triaged
melanie witt (melwitt)
Changed in nova:
status: Triaged → Confirmed
importance: High → Medium
Lawrance (jing)
Changed in nova:
assignee: nobody → Lawrance (jing)
Revision history for this message
Phil Day (philip-day) wrote :

Hi Lawance - are you actively working on this ? Its causing us a bit pf pain and I'd be willing to take it over

Phil

Phil Day (philip-day)
Changed in nova:
assignee: Lawrance (jing) → Phil Day (philip-day)
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/47556

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/47556
Committed: http://github.com/openstack/nova/commit/7eb3dd3f7badfb58f32e2414860549b5d4de9927
Submitter: Jenkins
Branch: master

commit 7eb3dd3f7badfb58f32e2414860549b5d4de9927
Author: Phil Day <email address hidden>
Date: Fri Sep 20 11:30:08 2013 +0000

    Rebuilding stopped instance should not set terminated_at

    At the end of a rebuild action, nova checks the original vm_state
    of the instance to see if it was stopped. If the instance was
    originality stopped, nova will stop the newly rebuild instance.
    Right before the stop, nova updates the instance and sets it's
    terminated_at to utcnow(). Due to this, the periodic usage audit
    does not send usage for the instance.

    There's no reason for setting tereminated_at here, it should only
    be set as part of instance deletion

    Fixes bug: 1189554

    Change-Id: I141aba1b4f3c15a4c17e1fc401ae9479acafb23f

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