• Constantinos Venetsanopoulos's avatar
    Fix computation of disk sizes in _ComputeDiskSize · 6a3166cb
    Constantinos Venetsanopoulos authored
    
    
    Currently, hail fails with FailDisk when trying to add an instance
    of type: 'file', 'sharedfile' and 'rbd'.
    
    This is due to a "0" or None value in the corresponding dict inside
    _ComputeDiskSize, which results in a "O" or non Int value of the
    exported 'disk_space_total' parameter. This in turn makes hail fail,
    when trying to process the value:
    
     - with "Unable to read Int" if value is None (file)
     - with FailDisk if value is 0 (sharedfile, rbd)
    
    The latter happens because the 0 value doesn't match the instance's
    IPolicy, since it is lower than the minimum disk size.
    
    The second problem still exists when using adoption with 'plain'
    and 'blockdev' template and will be addressed in another commit.
    Signed-off-by: default avatarConstantinos Venetsanopoulos <cven@grnet.gr>
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarIustin Pop <iustin@google.com>
    6a3166cb
cmdlib.py 545 KB