compute.instance.create.end no longer has launched_at populated

Bug #1338736 reported by Andrew Laski
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Andrew Laski

Bug Description

The launched_at instance field should be populated with the launch time in the compute.instance.create.end notification. Since the move to build_and_run_instance this field is no longer populated when the notification is sent.

Andrew Laski (alaski)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
Tiago Mello (timello) wrote :

Andrew, you mean this change?

diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 93a752c..6f07834 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -1968,6 +1968,7 @@ class ComputeManager(manager.Manager):
                                       injected_files, admin_password,
                                       network_info=network_info,
                                       block_device_info=block_device_info)
+ instance.launched_at = timeutils.utcnow()
                     self._notify_about_instance_usage(context, instance,
                             'create.end',
                             extra_usage_info={'message': _('Success')},
@@ -2019,7 +2020,6 @@ class ComputeManager(manager.Manager):
         instance.power_state = self._get_power_state(context, instance)
         instance.vm_state = vm_states.ACTIVE
         instance.task_state = None
- instance.launched_at = timeutils.utcnow()
         instance.save(expected_task_state=task_states.SPAWNING)

     @contextlib.contextmanager

Revision history for this message
Andrew Laski (alaski) wrote :

Not sure why it didn't update, but https://review.openstack.org/#/c/105276/ is intended to address this.

Changed in nova:
assignee: nobody → Andrew Laski (alaski)
status: New → In Progress
Revision history for this message
Andrew Laski (alaski) wrote :

Tiago, that would address the launched_at time. I reported the scope of the bug too narrowly as really it's the power_state, vm_state, and task_state that should be updated as well.

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

Reviewed: https://review.openstack.org/105276
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=acb47630f35716f4f3aa1f50d05e3b9280a0a1db
Submitter: Jenkins
Branch: master

commit acb47630f35716f4f3aa1f50d05e3b9280a0a1db
Author: Andrew Laski <email address hidden>
Date: Mon Jul 7 16:44:13 2014 -0400

    Send compute.instance.create.end after launched_at is set

    Downstream consumers of notifications want to know when an instance was
    launched from the compute.instance.create.end notification. This value
    was previously set in the notification but commit
    70196c4854e6cc1cb566dc9fc5b1a3397a4b69ab changed things so that it was
    no longer set. It will now be set, and is tested to be set.

    Change-Id: If5ac00529d52e3898cda7fd942535ed3ba2039d5
    Closes-bug: 1338736

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