示例#1
0
def show_memory(rsd, memory):
    assert isinstance(memory,
            rsd_lib.resources.v2_2.system.memory.Memory)
    utils.print_header("Memory", memory)
    utils.print_body(memory, (
        'capacity_mib',
        'operating_speed_mhz',
        'allowed_speeds_mhz',
        'bus_width_bits',
        'data_width_bits',
        'memory_device_type',
        'manufacturer',
        'device_locator',
        'error_correction',
        'part_number',
        'rank_count',
        'redfish_version',
        'serial_number'))
    utils.print_items(memory, "memory_location")
    print("metrics: %s; health %s; %s'C" % (
        memory.metrics.identity,
        ",".join(memory.metrics.health),
        memory.metrics.temperature_celsius))
    utils.print_body_none(memory, (
        'base_module_type',
        'device_id',
        'firmware_revision',
        'frirmware_api_version',
        'function_classes',
        'max_tdp_milliwatts',
        'memory_media',
        'memory_type',
        'operating_memory_modes',
        'vendor_id'))
    print()
示例#2
0
def show_processor(rsd, processor):
    assert(isinstance(processor,
        rsd_lib.resources.v2_2.system.processor.Processor))
    utils.print_header("Processor", processor)
    utils.print_body(processor, (
        'processor_type',
        'total_cores',
        'total_threads',
        'max_speed_mhz',
        'socket',
        'instruction_set',
        'manufacturer',
        'model'))
    metrics = processor.metrics
    print("metrics: %s; health %s; %sW, %s/%s'C, avg %sMHz" % (
        metrics.identity,
        ",".join(metrics.health),
        metrics.consumed_power_watt,
        metrics.temperature_celsius,
        metrics.throttling_celsius,
        metrics.average_frequency_mhz))
    utils.print_items(processor, "processor_id")
    utils.print_body_none(processor, (
        'processor_architecture',))
    print()
示例#3
0
def show_interface(rsd, interface):
    assert(isinstance(interface,
        sushy.resources.system.ethernet_interface.EthernetInterface))
    utils.print_header("Interface", interface)
    utils.print_body(interface, (
        'mac_address',
        'permanent_mac_address',
        'speed_mbps'))
    print("VLANs: %s" % interface.json["VLANs"]["@odata.id"])
    print()
示例#4
0
def show_fabric(rsd, fabric):
    assert isinstance(fabric, rsd_lib.resources.v2_3.fabric.Fabric)
    utils.print_header("Fabric", fabric)
    utils.print_body(fabric, (
        "fabric_type",
        "max_zones"))
    print("zones:")
    show_zones(rsd, fabric.zones.get_members(), 1)
    print("endpoints:")
    show_endpoints(rsd, fabric.endpoints.get_members(), 1)
    print()
示例#5
0
def show_drive(rsd, drive):
    assert isinstance(drive,
            rsd_lib.resources.v2_3.storage_service.drive.Drive)
    utils.print_header("Drive", drive)
    print("capacity: %s GiB" % _safe_bytes_to_gigs(drive.capacity_bytes))
    print("block size: %s" % drive.json["BlockSizeBytes"])
    utils.print_body(drive, (
        "manufacturer",
        "media_type",
        "model",
        "protocol",
        "serial_number"))
    utils.print_items(drive, "oem")
    print("identifiers:")
    for ident in drive.identifiers:
        print("  %s: %s" % (
            ident.durable_name_format,
            ident.durable_name))
    print("used by:")
    pools = [v["@odata.id"] for v in
             drive.json["Oem"]["Intel_RackScale"]["UsedBy"]]
    pools = [get_pool(rsd, url) for url in pools]
    show_pools(rsd, pools, 1)
    storage = drive.oem.storage
    if storage:
        print("storage: %s" % storage["@odata.id"])
    else:
        print("storage: None")
    print("links:")
    links = drive.links
    assert(3 == len(links.keys()))
    print("  chassis:")
    chassis = drive.links.chassis
    chassis = get_chassis(rsd, chassis)
    show_chassises(rsd, [chassis], 2)
    print("  endpoints:")
    endpoints = [get_endpoint(rsd, ep) for ep in drive.links.endpoints]
    show_endpoints(rsd, endpoints, 2)
    print("  volumes:")
    volumes = drive.links.volumes
    volumes = [get_volume(rsd, url) for url in volumes]
    show_volumes(rsd, volumes, 2)
    utils.print_body_none(drive, (
        "asset_tag", "capable_speed_gbs", "drive_type", "indicator_led",
        "location", "negotiated_speed_gbs", "part_number",
        "predicted_media_life_left_percent", "revision", "rotation_speed_rpm",
        "sku", "status_indicator"))
    print()
示例#6
0
def show_endpoint(rsd, endpoint):
    assert isinstance(endpoint,
            rsd_lib.resources.v2_3.fabric.endpoint.Endpoint)

    utils.print_header("Endpoint", endpoint)
    utils.print_body(endpoint, ("protocol",))
    assert(1 == len(endpoint.oem))
    utils.print_items(endpoint, "oem.authentication")

    print("connected entities:")
    for c_ent in endpoint.connected_entities:
        if c_ent.entity_role == "Initiator":
            print("  %s-%s:" % (c_ent.entity_role,
                                c_ent.entity_type))
            system = get_system(rsd, c_ent.entity_link)
            show_systems(rsd, [system], 2)
        elif c_ent.entity_role == "Target":
            print("  %s-%s:" % (c_ent.entity_role,
                                c_ent.entity_type))
            volume = get_volume(rsd, c_ent.entity_link)
            show_volumes(rsd, [volume], 2)
        else:
            print("  %s-%s: %s" % (c_ent.entity_role,
                                   c_ent.entity_type,
                                   c_ent.entity_link))
    print("identifiers:")
    for ident in endpoint.identifiers:
        print("  %s: %s" % (ident.name_format, ident.name))
    print("ip transport:")
    for ip in endpoint.ip_transport_details:
        print("  %s://%s(%s):%s" % (ip.transport_protocol,
                                   ip.ipv4_address,
                                   ip.ipv6_address,
                                   ip.port))
    print("links:")
    links = endpoint.links
    assert(4 == len(links))
    print("  zones:")
    zones = links.zones
    zones = [get_zone(rsd, url) for url in zones]
    show_zones(rsd, zones, 2)
    print("  endpoints: %s" % links.endpoints)
    print("  interface: %s" % links.interface)
    print("  ports: ")
    for port in links.ports:
        print("    %s" % port)
    print()
示例#7
0
def show_volume(rsd, volume):
    assert isinstance(volume,
            rsd_lib.resources.v2_3.storage_service.volume.Volume)

    utils.print_header("Volume", volume)
    print("capacity: %s Gib" % _safe_bytes_to_gigs(volume.capacity_bytes))
    print("allocated: %s Gib" % _safe_bytes_to_gigs(volume.allocated_Bytes))
    print("block size: %s" % volume.json["BlockSizeBytes"])
    utils.print_body(volume, (
        "bootable",
        "erased",
        "erase_on_detach"))
    print("identifiers:")
    for ident in volume.identifiers:
        print("  %s: %s" % (ident.durable_name_format,
            ident.durable_name))
    print("capability sources:")
    for cap in volume.capacity_sources:
        print("  > %s GiB from pools:" %
              _safe_bytes_to_gigs(cap.allocated_Bytes))
        pools = cap.providing_pools
        pools = [get_pool(rsd, pool) for pool in pools]
        show_pools(rsd, pools, 2)
    print("links:")
    assert(2 == len(volume.links.keys()))
    print("  endpoints:")
    endpoints = volume.links.endpoints
    endpoints = [get_endpoint(rsd, ep) for ep in endpoints]
    show_endpoints(rsd, endpoints, 2)
    print("  drives:")
    for d in volume.json["Links"]["Drives"]:
        print("    !! %s" % d)
    if volume.links.metrics:
        print("  metrics:")
        for m in volume.links.metrics:
            print("    !! %s" % m)
    else:
        print("  metrics: None")
    utils.print_body_none(volume, (
        "manufacturer",
        "model",
        "replica_infos",
        "access_capabilities"))
    print()
示例#8
0
def show_chassis(rsd, chassis):
    assert isinstance(chassis, rsd_lib.resources.v2_1.chassis.Chassis)
    utils.print_header("Chassis", chassis)
    utils.print_body(chassis, (
        "chassis_type",
        "oem"))

    print("links:")
    links = chassis.json["Links"]
    assert(11 == len(links))

    print("  systems:")
    systems = (get_system(rsd, val["@odata.id"]) for val in
    links["ComputerSystems"])
    show_systems(rsd, systems, 2)

    print("  ContainedBy:")
    contained = links["ContainedBy"]
    if contained:
        contained = contained.get("@odata.id")
        contained = get_chassis(rsd, contained)
        show_chassises(rsd, [contained], 2)

    print("  Contains:")
    contains = (get_chassis(rsd, c["@odata.id"]) for c in links["Contains"])
    show_chassises(rsd, contains, 2)

    print("  CooledBy:")
    for c in links["CooledBy"]:
        print("    %s" % c)

    print("  Drives:")
    drives = [val["@odata.id"] for val in links["Drives"]]
    drives = [get_drive(rsd, drv) for drv in drives]
    show_drives(rsd, drives, 2)

    print("  ManagedBy:")
    managers = (val["@odata.id"] for val in links["ManagedBy"])
    for m in managers:
        #TODO
        print("    %s" % m)

    print("  ManagersInChassis:")
    managers = (val["@odata.id"] for val in
            links["ManagersInChassis"])
    for m in managers:
        print("    %s" % m)

    print("  Oem switches:")
    for s in links["Oem"]["Intel_RackScale"]["Switches"]:
        print("    %s" % s)

    print("  PoweredBy:")
    for p in links["PoweredBy"]:
        print("    %s" % p)

    print("  Storage:")
    storages = (val["@odata.id"] for val in links["Storage"])
    for s in storages:
        #TODO /redfish/v1/Systems/3-s-2/Storage/3-s-2-sr-1
        print("    %s" % s)

    utils.print_body_none(chassis, (
        "asset_tag",
        "part_number",
        "serial_number",
        "sku"))
    print()
示例#9
0
def show_node(rsd, node):
    assert isinstance(node, rsd_lib.resources.v2_3.node.Node)
    utils.print_header("Node", node)
    utils.print_body(node, (
        "uuid",
        "power_state",
        "composed_node_state"))
    print("allowed boot sources: %s" %
        ", ".join(node.get_allowed_node_boot_source_values()))
    print("allowed reset vals: %s" %
        ", ".join(node.get_allowed_reset_node_values()))
    print("allowed detach endp:")
    vols = []
    eps = []
    others = []
    for url in node.get_allowed_detach_endpoints():
        if "Endpoints" in url:
            eps.append(url)
        elif "Volumes" in url:
            vols.append(url)
        else:
            others.append(url)
    vols = (get_volume(rsd, url) for url in vols)
    show_volumes(rsd, vols, 1)
    eps = (get_endpoint(rsd, url) for url in eps)
    show_endpoints(rsd, eps, 1)
    for o in others:
        print("  !! %s" % o)
    print("allowed attach endp:")
    volumes = [url for url in node.get_allowed_attach_endpoints()]
    for vol in volumes:
        print("  %s" % vol)
    # volumes = [get_volume(rsd, url) for url in volumes]
    # show_volumes(rsd, volumes, 1)
    print("links:")
    links = node.links
    assert 6 == len(links.keys())
    print("  system: %s" % links.system)
    print("  processors: %s" % len(links.processors))
    print("  memories: %s" % len(links.memory))
    print("  interfaces: %s" % len(links.ethernet_interfaces))
    print("  local drives: %s" % len(links.local_drives))
    print("  remote drives: %s" % len(links.remote_drives))
    #NOTE: JSON
    links = node.json["Links"]
    assert(7 == len(links))
    print("  oem: %s" % links["Oem"])
    print("  managers:")
    for v in links["ManagedBy"]:
        #TODO
        print("    %s" % v["@odata.id"])
    print("  storages:")
    vols = []
    dvs = []
    others = []
    for url in links["Storage"]:
        url = url["@odata.id"]
        if "Drives" in url:
            dvs.append(url)
        elif "Volumes" in url:
            vols.append(url)
        else:
            others.append(url)
    vols = (get_volume(rsd, url) for url in vols)
    show_volumes(rsd, vols, 2)
    dvs = (get_drive(rsd, url) for url in dvs)
    show_drives(rsd, dvs, 2)
    for o in others:
        print("    !! %s" % o)
    utils.print_body_none(node, (
        "memory_summary",
        "processor_summary"))
    if node.system:
        system = get_system(rsd, node.system.path)
        show_system(rsd, system)
示例#10
0
def show_system(rsd, system):
    assert isinstance(system,
            rsd_lib.resources.v2_2.system.system.System)
    utils.print_header("System", system)
    utils.print_body(system, (
        'uuid',
        'system_type',
        'power_state',
        'bios_version',
        'manufacturer',
        'serial_number',
        'part_number',
        'sku'))
    print("allowed reset vals: %s" %
            ",".join(system.get_allowed_reset_system_values()))
    print("allowed boot vals: %s" %
            ",".join(system.get_allowed_system_boot_source_values()))
    metrics = system.metrics
    print("metrics: health %s, io %sGbps, mem/cpu %s/%s%%, "
            "mem/cpu %s/%sW, mem throttle %s%%" % (
            ",".join(metrics.health),
            metrics.io_bandwidth_gbps,
            metrics.memory_bandwidth_percent,
            metrics.processor_bandwidth_percent,
            metrics.memory_power_watt,
            metrics.processor_power_watt,
            metrics.memory_throttled_cycles_percent))
    ps = system.json["ProcessorSummary"]
    print("processor_summary: %s; %s; %s" % (
        ps["Count"], ps["Status"]["State"], ps["Model"]))
    print("processors:")
    show_processors(rsd, system.processors.get_members(), 1)
    utils.print_items(system, "memory_summary")
    print("memories:")
    show_memories(rsd, system.memory.get_members(), 1)
    print("interfaces:")
    show_interfaces(rsd, system.ethernet_interfaces.get_members(), 1)
    print("oem: %s" % ", ".join(system.json["Oem"].keys()))
    print("PCIeDevices: %s" % len(system.json["PCIeDevices"]))
    print("PCIeFunctions: %s" % len(system.json["PCIeFunctions"]))
    print("SimpleStorage: %s" % system.json["SimpleStorage"]["@odata.id"])
    print("Storage: %s" % system.json["Storage"]["@odata.id"])
    print("links:")
    links = system.json["Links"]
    assert(5 == len(links))
    print("  Chassises:")
    chassises = [v["@odata.id"] for v in links["Chassis"]]
    chassises = [get_chassis(rsd, url) for url in chassises]
    show_chassises(rsd, chassises, 2)
    print("  Endpoints:")
    endpoints = [v["@odata.id"] for v in links["Endpoints"]]
    endpoints = [get_endpoint(rsd, url) for url in endpoints]
    show_endpoints(rsd, endpoints, 2)
    print("  Managers:")
    for v in links["ManagedBy"]:
        # TODO
        print("    %s" % v["@odata.id"])
    print("  Oem: %s" % links["Oem"])
    utils.print_body_none(system, (
        'asset_tag',
        'hostname',
        'indicator_led'))
    print()