@Matt: The driver calls the serializer according to my debugging. The problem appears to be that the nova rpc client uses the NovaObjectSerializer that can serialize versioned objects with datetime fields properly but simply ignore (and pass through) a datetime object in a dict. And such dict is passed to rpc in nova.compute.rpcapi.ComputeAPI.prep_resize [1] as the ImageMeta object is first converted to primitives.
Btw in RPC we don't use the JsonPayloadSerializer (it is only used for notifications) but we use the NovaObjectSerializer instead.
@Matt: The driver calls the serializer according to my debugging. The problem appears to be that the nova rpc client uses the NovaObjectSeria lizer that can serialize versioned objects with datetime fields properly but simply ignore (and pass through) a datetime object in a dict. And such dict is passed to rpc in nova.compute. rpcapi. ComputeAPI. prep_resize [1] as the ImageMeta object is first converted to primitives.
Btw in RPC we don't use the JsonPayloadSeri alizer (it is only used for notifications) but we use the NovaObjectSeria lizer instead.
[1] https:/ /github. com/openstack/ nova/blob/ af40e3d1a67c854 2683368fd6927ac 9c0363a3b8/ nova/compute/ rpcapi. py#L762