Skip to content
  • Georgios D. Tsoukalas's avatar
    Fix UUID bug breaking image list and VM creation · 2e4ad3b1
    Georgios D. Tsoukalas authored
    latest_uuid(uuid) returned the latest version with the given uuid.
    This is called from pithos backend method get_uuid(),
    which is called from plankton backend method get_image().
    
    For the use in get_image() the uuid alone is not enough,
    since we need the latest version that is accessible,
    i.e. not deleted or trashed (in pithos parlance, in CLUSTER_NORMAL)
    
    The problematic scenario is cause by a MOVEing (renaming)
    a plankton image to a different name.
    Internally, pithos handles a 'move src dest' as a
    'copy src dest' + 'delete src'.
    Both copy and delete create a new version of the source,
    with the same UUID.
    We need the 'copy' version but because the delete is executed
    after the copy, the 'deleted' version becomes the latest,
    thus the one latest_uuid() would return.
    
    This has been fixed by adding a mandatory cluster argument:
    latest_uid(uuid, cluster), to which get_uuid() now specifies
    CLUSTER_NORMAL.
    The previous cluster-unaware behavior can be obtained by
    specifying cluster as None.
    
    Refs #3391
    2e4ad3b1