def _get_disk_free_size_mb(disk, pending_delete):
    """Return the size of free space on the disk in MB.

    :param disk: a PhysicalDisk object.
    :param pending_delete: Whether there is a pending deletion of all virtual
        disks.
    """
    return disk.size_mb if pending_delete else disk.free_size_mb