** Changed in: nova
       Status: In Progress => Opinion

** Changed in: nova
     Assignee: Brad Pokorny (bpokorny) => (unassigned)

** Changed in: nova
   Importance: Undecided => Wishlist

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1237106

Title:
  "updated" field from nova show output doesn't reflect updates to
  metadata

Status in OpenStack Compute (Nova):
  Opinion
Status in Python client library for Nova:
  Won't Fix

Bug description:
  The "updated" field in output from "nova show" gets updated when
  certain fields, such as server name are changed.  However, changing
  metadata doesn't cause the field to be updated.

  Steps to recreate:
  - Run the "nova show" command on an existing instance and note the timestamp 
in the "updated" field.
  - Add or change metadata on the instance:

  curl -i http://[Server IP Address]:8774/v2/[Tenant
  ID]/servers/[Instance ID]/metadata -X POST -H "X-Auth-Project-Id:
  admin" -H "User-Agent: python-novaclient" -H "Content-Type:
  application/json" -H "Accept: application/json" -H "X-Auth-Token:
  [Token from Keystone]" -d '{"metadata": {"new_key": "new_value"}}'

  - Run the "nova show" command on the instance and note that although
  the metadata has been added/changed, the timestamp in the "updated"
  field hasn't changed.

  Expected result:
  - The timestamp in the "updated" field should be changed to show when the 
metadata was changed.

  
  The reason it doesn't currently get changed is that the timestamp for the 
last update of an instance is stored in the instances table, while the last 
update of metadata is stored in the instance_metadata table.  When metadata is 
updated, only the instance_metadata table gets updated, and the "nova show" 
output only queries the instances table to fill in the "updated" timestamp.

  This is an issue for a user who has access to the API's/CLI and wants
  to see when metadata was last updated for an instance.  There's not
  currently a way to see when metadata was last updated via the
  API's/CLI.

  Here are a few options for fixing:
  - Update the nova code so that whenever metadata is updated, the "updated" 
timestamp in the instances table is also updated.
  Pros: Existing users of the API's and CLI (using "nova show") who want to 
know when updates happen to metadata don't need to make changes.
  Cons: Changes the behavior of "nova show".  Possibly requires a dummy update 
to the instances table just to update the timestamp on it.

  - Change the "nova show" code (in python-novaclient) so that it looks for the 
latest update date for the instance *and* the lists included in the output and 
shows the latest one for the "update" field.
  Pros: Existing users of the API's and CLI (using "nova show") who want to 
know when updates happen to metadata don't need to make changes.
  Cons: Changes the behavior of "nova show".  Possibly confusing when debugging 
and trying to figure out what table the "update" field is comes from.

  - Update the "List Metadata" 
(http://docs.openstack.org/api/openstack-compute/2/content/List_Metadata-d1e5089.html)
 API output so that it returns the updated_at timestamp for each metadata 
object in the response and provide a new CLI command (nova meta show?) so that 
CLI users could call the API.
  Pros: Doesn't change behavior of existing CLI commands.
  Cons: Existing users of the CLI (using "nova show") who want to know when 
updates happen to metadata need to start using a new command.  Not as intuitive 
to users as having the date updated in the "nova show" output

  
  I'd appreciate any comments or suggestions.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1237106/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to