"updated" field from nova show output doesn't reflect updates to metadata
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Opinion
|
Wishlist
|
Unassigned | ||
python-novaclient |
Won't Fix
|
Undecided
|
Unassigned |
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]
- 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://
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.
Changed in nova: | |
assignee: | nobody → Brad Pokorny (bpokorny) |
Changed in nova: | |
status: | New → In Progress |
Changed in nova: | |
status: | In Progress → Opinion |
assignee: | Brad Pokorny (bpokorny) → nobody |
importance: | Undecided → Wishlist |
I proposed a fix in this review: /review. openstack. org/#/c/ 53680/
https:/
But there were concerns about changing the current behavior. See the discussion in the review for further info.