When unshelve instance, the instance object not sync up with nova db.

Bug #1548209 reported by baikai
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Undecided
Unassigned

Bug Description

When unshelve instance, the instance object not sync up with nova db:
1. During unshelving, user(3rd party software) may want store some information in instance system metadata, but after unshelve operation done, those information will be overwrite because conductor code will save original instance object to nova db;
2. When create new instance, the conductor code will refresh instance object; The unshelve operation need do same thing to ensure the instance object keep consistent with nova db.

Reproduce steps:
1. Create instance by nova CLI or horizon dashboard;
2. Shelve instance by nova CLI or horizon dashboard;
3. Unshelve instance by nova CLI or horizon dashboard;
4. During unshelving, store some information by call function 'db.instance_system_metadata_update';
5. After unshelve operation done, check nova db by SQL "use nova;select * from instance_system_metadata where instance_uuid=xxx",
You will see the information you stored in instance_system_metadata table be overwrite.

baikai (baikai)
Changed in nova:
assignee: nobody → baikai (baikai)
status: New → Confirmed
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/283418

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Alex Xu (xuhj) wrote :

@baikai, how can you execute step 4? That sounds like didn't execute from Nova Rest API.

Revision history for this message
baikai (baikai) wrote :

Root cause:
1. Before unshelve operation begin, nova conductor get instance object from nova db that contains old system metadata valve;
2. During unshelving, some 3rd party component may update system metadata by call nova rest api 'db.instance_system_metadata_update', that will update instance system metadata in nova db(but the instance object get by step#1 not update);
3. After unshelve operation done, nova conductor will save instance object get by step#1 to nova db, that will overwrite new system metadata value write by step#2;

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/283418
Reason: This patch is quite old, so I am abandoning it to keep the review queue manageable. Feel free to restore the change if you're still interested in working on it.

Revision history for this message
Sean Dague (sdague) wrote :

There are no currently open reviews on this bug, changing
the status back to the previous state and unassigning. If
there are active reviews related to this bug, please include
links in comments.

Changed in nova:
status: In Progress → Confirmed
assignee: baikai (baikai) → nobody
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.