'Serialize object to match the db model.
We store copies of embedded objects rather than
references to these objects because we want a snapshot of the request
at this point.  If the references changed or were deleted we would
not be able to reschedule this instance under the same conditions as
it was originally scheduled with.'

def _get_update_primitives(self):

    updates = self.obj_get_changes()
    if updates:
        db_updates = {'spec': jsonutils.dumps(self.obj_to_primitive())}
        if ('instance_uuid' in updates):
            db_updates['instance_uuid'] = updates['instance_uuid']
    return db_updates
