def get_local_gb(system_obj):
    """Gets the largest volume or the largest disk

    :param system_obj: The HPESystem object.
    :returns the size in GB
    """
    local_max_bytes = 0
    logical_max_mib = 0
    volume_max_bytes = 0
    physical_max_mib = 0
    drives_max_bytes = 0
    simple_max_bytes = 0

    # Gets the resources and properties
    # its quite possible for a system to lack the resource, hence its
    # URI may also be lacking.

    # Check if smart_storage resource exist at the system
    smart_resource = _get_attribute_value_of(system_obj, 'smart_storage')
    # Check if storage resource exist at the system
    storage_resource = _get_attribute_value_of(system_obj, 'storages')

    if smart_resource is not None:
        logical_max_mib = _get_attribute_value_of(
            smart_resource, 'logical_drives_maximum_size_mib', default=0)
    if storage_resource is not None:
        volume_max_bytes = _get_attribute_value_of(
            storage_resource, 'volumes_maximum_size_bytes', default=0)

    # Get the largest volume from the system.
    local_max_bytes = utils.max_safe([(logical_max_mib * 1024 * 1024),
                                     volume_max_bytes])
    # if volume is not found, then traverse through the possible disk drives
    # and get the biggest disk.
    if local_max_bytes == 0:
        if smart_resource is not None:
            physical_max_mib = _get_attribute_value_of(
                smart_resource, 'physical_drives_maximum_size_mib', default=0)

        if storage_resource is not None:
            drives_max_bytes = _get_attribute_value_of(
                storage_resource, 'drives_maximum_size_bytes', default=0)

        # Check if the SimpleStorage resource exist at the system.
        simple_resource = _get_attribute_value_of(system_obj,
                                                  'simple_storages')
        if simple_resource is not None:
            simple_max_bytes = _get_attribute_value_of(
                simple_resource, 'maximum_size_bytes', default=0)

        local_max_bytes = utils.max_safe([(physical_max_mib * 1024 * 1024),
                                         drives_max_bytes, simple_max_bytes])
    # Convert the received size to GB and reduce the value by 1 Gb as
    # ironic requires the local_gb to be returned 1 less than actual size.
    local_gb = 0
    if local_max_bytes > 0:
        local_gb = int(local_max_bytes / (1024 * 1024 * 1024)) - 1
    else:
        msg = ('The maximum size for the hard disk or logical '
               'volume could not be determined.')
        LOG.debug(msg)
    return local_gb
Gets the largest volume or the largest disk

    :param system_obj: The HPESystem object.
    :returns the size in GB