[openstack-dev] [nova] nova-manage cell_v2 map_instances uses invalid UUID as marker in the db

Takashi Natsume natsume.takashi at lab.ntt.co.jp
Thu May 10 05:50:12 UTC 2018


The temporary fix to pass the gate jobs is to mock
the 'warnings.warn' method in the test method.
Then add a TODO note to fix storing non-UUID value
in the 'map_instances' command of the 'CellV2Commands' class.

The fundamental solution is to change the design of
the 'map_instances' command.
In the first place, it is not good to store non-UUID value in the UUID 
field.

In some compute REST APIs, it returns the 'marker' parameter
in their pagination.
Then users can specify the 'marker' parameter in the next request.

So it is one way to change the command to stop storing a 'marker' value
in the InstanceMapping (instance_mappings) DB table
and return (print) a 'marker' value and be able to be specifid
the 'marker' value as the command line argument.

On 2018/05/08 18:49, Balázs Gibizer wrote:
> Hi,
> 
> The oslo UUIDField emits a warning if the string used as a field value 
> does not pass the validation of the uuid.UUID(str(value)) call [3]. All 
> the offending places are fixed in nova except the nova-manage cell_v2 
> map_instances call [1][2]. That call uses markers in the DB that are not 
> valid UUIDs. If we could fix this last offender then we could merge the 
> patch [4] that changes the this warning to an exception in the nova 
> tests to avoid such future rule violations.
> 
> However I'm not sure it is easy to fix. Replacing 
> 'INSTANCE_MIGRATION_MARKER' at [1] to '00000000-0000-0000-0000-00000000' 
> might work but I don't know what to do with instance_uuid.replace(' ', 
> '-') [2] to make it a valid uuid. Also I think that if there is an 
> unfinished mapping in the deployment and then the marker is changed in 
> the code that leads to inconsistencies.
> 
> I'm open to any suggestions.
> 
> Cheers,
> gibi
> 
> 
> [1] 
> https://github.com/openstack/nova/blob/09af976016a83288df22ac6ed1cce1676c2294cc/nova/cmd/manage.py#L1168 
> 
> [2] 
> https://github.com/openstack/nova/blob/09af976016a83288df22ac6ed1cce1676c2294cc/nova/cmd/manage.py#L1180 
> 
> [3] 
> https://github.com/openstack/oslo.versionedobjects/blob/29e643e4a93333866b33965b68fc8dfb8acf30fa/oslo_versionedobjects/fields.py#L359 
> 
> [4] https://review.openstack.org/#/c/540386
> 
> 
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Regards,
Takashi Natsume
NTT Software Innovation Center
E-mail: natsume.takashi at lab.ntt.co.jp




More information about the OpenStack-dev mailing list