ome_device (Data Source)

This Terraform DataSource is used to query devices from OME. The information fetched from this data source can be used for getting the details / for further processing in resource block.

Example Usage

/*
Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved.
Licensed under the Mozilla Public License Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
    http://mozilla.org/MPL/2.0/
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

# get device by ids
data "ome_device" "devi" {
  filters = {
    ids = [1001, 1002, 1003]
  }
}

# get device by their network
data "ome_device" "devn" {
  filters = {
    ip_expressions = [
      "10.10.10.10",
      "10.36.0.0-192.36.0.255",
      "fe80::ffff:ffff:ffff:ffff",
      "fe80::ffff:192.0.2.0/125",
      "fe80::ffff:ffff:ffff:1111-fe80::ffff:ffff:ffff:ffff"
    ]
  }
}

# get device by service tags
data "ome_device" "devs" {
  filters = {
    device_service_tags = ["CZNF1T2", "CZMC1T2"]
  }
}

# get device by valid OME OData filter query
data "ome_device" "devf" {
  filters = {
    filter_expression = "Model eq 'PowerEdge MX840c'"
  }
}

# get all devices in the CIDR "10.10.10.10/26" with model PowerEdge MX840c

data "ome_device" "devs" {
  filters = {
    ip_expressions    = ["10.10.10.10/26"]
    filter_expression = "Model eq 'PowerEdge MX840c'"
  }
}

# get device with inventory
# to get inventory of a device, query only one device per datasource

data "ome_device" "dev_invent_full" {
  filters = {
    ip_expressions = ["10.10.10.10"]
  }
}

data "ome_device" "dev_invent" {
  filters = {
    ip_expressions = ["10.10.10.10"]
  }
  inventory_types = ["serverNetworkInterfaces", "serverArrayDisks"]
}

output "dev_inv_out" {
  value = {
    full                    = data.ome_device.dev_invent_full.devices.detailed_inventory
    serverNetworkInterfaces = data.ome_device.dev_invent.devices.detailed_inventory.nics
    serverArrayDisks        = data.ome_device.dev_invent.devices.detailed_inventory.disks
  }
}

After the successful execution of above said block, We can see the output value by executing terraform output command. Also, we can use the fetched information by the variable data.ome_device.devi

Schema

Optional

  • filters (Attributes) Filters to apply while fetching devices. Only one among filter_expression, ids and device_service_tags can be configured. (see below for nested schema)
  • inventory_types (List of String) The types of inventory types to fetch. Accepted values are serverDeviceCards, serverProcessors, serverDellVideos, serverNetworkInterfaces, serverFcCards, serverOperatingSystems, serverVirtualFlashes, serverPowerSupplies, serverArrayDisks, serverRaidControllers, serverMemoryDevices, serverStorageEnclosures, serverSupportedPowerStates, deviceLicense, deviceCapabilities, deviceFru, deviceManagement, deviceSoftware, subsystemRollupStatus, deviceInventory. If not configured, all inventory types are fetched.

Read-Only

Nested Schema for filters

Optional:

  • device_service_tags (List of String) Service tags of the devices to fetch.
  • filter_expression (String) OData $filter compatible expression to be used for querying devices.
  • ids (List of Number) IDs of the devices to fetch.
  • ip_expressions (List of String) IP expressions of the devices to fetch. Supported expressions are IPv4, IPv6, CIDRs and IP ranges.

Nested Schema for devices

Read-Only:

  • asset_tag (String) Asset Tag of the device.
  • chassis_ip (String) Chassis IP of the device.
  • chassis_service_tag (String) Chassis Service Tag of the device.
  • connection_state (Boolean) Connection State of the device.
  • connection_state_reason (Number) Connection State Reason of the device.
  • detailed_inventory (Attributes) Detailed inventory of the device. Detailed inventory is only fetched if only a single device is fetched by this datasource. (see below for nested schema)
  • device_capabilities (List of Number) Device Capabilities of the device.
  • device_management (Attributes List) Device Management of the device. (see below for nested schema)
  • device_name (String) Device Name of the device.
  • device_service_tag (String) Device Service Tag of the device.
  • device_subscription (String) Device Subscription of the device.
  • discovery_configuration_job_information (Attributes List) Discovery Configuration Job Info of the device. (see below for nested schema)
  • enabled (Boolean) Whether the device is enabled or not.
  • id (Number) ID of the device.
  • identifier (String) Identifier of the device.
  • last_inventory_time (String) Last Inventory Time of the device.
  • last_status_time (String) Last Status Time of the device.
  • managed_state (Number) Managed State of the device.
  • model (String) Model of the device.
  • power_state (Number) Power State of the device.
  • slot_configuration (Attributes) Slot Configuration of the device. (see below for nested schema)
  • status (Number) Status of the device.
  • system_id (Number) System ID of the device.
  • type (Number) Type of the device.

Nested Schema for devices.detailed_inventory

Read-Only:

Nested Schema for devices.detailed_inventory.capabilities

Read-Only:

Nested Schema for devices.detailed_inventory.capabilities.capability_type

Read-Only:

  • capability_id (Number) Capability ID
  • description (String) Description
  • id_owner (Number) IDOwner
  • name (String) Name

Nested Schema for devices.detailed_inventory.cpus

Read-Only:

  • brand_name (String) Brand Name
  • current_speed (Number) Current Speed
  • family (String) Family
  • id (Number) ID
  • instance_id (String) Instance ID
  • max_speed (Number) Max Speed
  • model_name (String) Model Name
  • number_of_cores (Number) Number Of Cores
  • number_of_enabled_cores (Number) Number Of Enabled Cores
  • slot_number (String) Slot Number
  • status (Number) Status
  • voltage (String) Voltage

Nested Schema for devices.detailed_inventory.disks

Read-Only:

  • bus_type (String) Bus Type
  • channel (Number) Channel
  • disk_number (String) Disk Number
  • enclosure_id (String) Enclosure ID
  • encryption_ability (Boolean) Encryption Ability
  • form_factor (String) Form Factor
  • free_space (String) Free Space
  • id (Number) ID
  • manufactured_day (Number) Manufactured Day
  • manufactured_week (Number) Manufactured Week
  • manufactured_year (Number) Manufactured Year
  • media_type (String) Media Type
  • model_number (String) Model Number
  • part_number (String) Part Number
  • predictive_failure_state (String) Predictive Failure State
  • raid_status (String) Raid Status
  • remaining_read_write_endurance (String) Remaining Read Write Endurance
  • revision (String) Revision
  • sas_address (String) Sas Address
  • security_state (String) Security State
  • serial_number (String) Serial Number
  • size (String) Size
  • slot_number (Number) Slot Number
  • status (Number) Status
  • status_string (String) Status String
  • used_space (String) Used Space
  • vendor_name (String) Vendor Name

Nested Schema for devices.detailed_inventory.fcis

Read-Only:

  • device_description (String) Device Description
  • device_name (String) Device Name
  • first_fctarget_lun (String) First Fctarget Lun
  • first_fctarget_wwpn (String) First Fctarget Wwpn
  • fqdd (String) Fqdd
  • id (Number) ID
  • link_status (String) Link Status
  • port_number (Number) Port Number
  • port_speed (String) Port Speed
  • second_fctarget_lun (String) Second Fctarget Lun
  • second_fctarget_wwpn (String) Second Fctarget Wwpn
  • vendor_name (String) Vendor Name
  • virtual_wwn (String) Virtual Wwn
  • virtual_wwpn (String) Virtual Wwpn
  • wwn (String) Wwn
  • wwpn (String) Wwpn

Nested Schema for devices.detailed_inventory.frus

Read-Only:

  • id (Number) ID
  • manufacturer (String) Manufacturer
  • name (String) Name
  • part_number (String) Part Number
  • revision (String) Revision
  • serial_number (String) Serial Number

Nested Schema for devices.detailed_inventory.licenses

Read-Only:

  • assigned_devices (String) Assigned Devices
  • entitlement_id (String) Entitlement Id
  • eval_time_remaining (Number) Eval Time Remaining
  • license_bound (Number) License Bound
  • license_description (String) License Description
  • license_status (Number) License Status
  • license_type (Attributes) License Type (see below for nested schema)
  • sold_date (String) Sold Date

Nested Schema for devices.detailed_inventory.licenses.license_type

Read-Only:

  • license_id (Number) License Id
  • name (String) Name

Nested Schema for devices.detailed_inventory.locations

Read-Only:

  • aisle (String) Aisle
  • datacenter (String) Datacenter
  • id (Number) ID
  • management_system_unit (Number) Management System Unit
  • rack (String) Rack
  • rackslot (String) Rackslot
  • room (String) Room

Nested Schema for devices.detailed_inventory.management_info

Read-Only:

  • dns_name (String) DNSName
  • end_point_agents (Attributes List) End Point Agents (see below for nested schema)
  • instrumentation_name (String) Instrumentation Name
  • ip_address (String) IPAddress
  • mac_address (String) MACAddress
  • management_id (Number) Management ID
  • management_type (Attributes) Management Type (see below for nested schema)

Nested Schema for devices.detailed_inventory.management_info.end_point_agents

Read-Only:

  • agent_name (String) Agent Name
  • has_creds (Number) Has Creds
  • management_profile_id (Number) Management Profile ID
  • management_url (String) Management URL
  • profile_id (String) Profile ID
  • status (Number) Status
  • status_date_time (String) Status Date Time
  • version (String) Version

Nested Schema for devices.detailed_inventory.management_info.management_type

Read-Only:

  • description (String) Description
  • management_type (Number) Management Type
  • name (String) Name

Nested Schema for devices.detailed_inventory.memory

Read-Only:

  • bank_name (String) Bank Name
  • current_operating_speed (Number) Current Operating Speed
  • device_description (String) Device Description
  • id (Number) ID
  • instance_id (String) Instance ID
  • manufacturer (String) Manufacturer
  • manufacturer_date (String) Manufacturer Date
  • name (String) Name
  • part_number (String) Part Number
  • rank (String) Rank
  • serial_number (String) Serial Number
  • size (Number) Size
  • speed (Number) Speed
  • status (Number) Status
  • type_details (String) Type Details

Nested Schema for devices.detailed_inventory.nics

Read-Only:

  • nic_id (String) Nic ID
  • ports (Attributes List) Ports (see below for nested schema)
  • vendor_name (String) Vendor Name

Nested Schema for devices.detailed_inventory.nics.ports

Read-Only:

  • link_speed (Number) Link Speed
  • link_status (String) Link Status
  • partitions (Attributes List) Partitions (see below for nested schema)
  • port_id (String) Port ID
  • product_name (String) Product Name

Nested Schema for devices.detailed_inventory.nics.ports.partitions

Read-Only:

  • current_mac_address (String) Current Mac Address
  • fcoe_mode (String) Fcoe Mode
  • fqdd (String) Fqdd
  • iscsi_mode (String) Iscsi Mode
  • max_bandwidth (Number) Max Bandwidth
  • min_bandwidth (Number) Min Bandwidth
  • nic_mode (String) Nic Mode
  • permanent_fcoe_mac_address (String) Permanent Fcoe Mac Address
  • permanent_iscsi_mac_address (String) Permanent Iscsi Mac Address
  • permanent_mac_address (String) Permanent Mac Address
  • virtual_mac_address (String) Virtual Mac Address
  • virtual_wwn (String) Virtual Wwn
  • virtual_wwpn (String) Virtual Wwpn
  • wwn (String) Wwn
  • wwpn (String) Wwpn

Nested Schema for devices.detailed_inventory.os

Read-Only:

  • hostname (String) Hostname
  • id (Number) ID
  • os_name (String) Os Name
  • os_version (String) Os Version

Nested Schema for devices.detailed_inventory.power_state

Read-Only:

  • id (Number) ID
  • power_state (Number) Power State

Nested Schema for devices.detailed_inventory.power_supply

Read-Only:

  • ac_input (Boolean) Ac Input
  • ac_output (Boolean) Ac Output
  • active_input_voltage (String) Active Input Voltage
  • firmware_version (String) Firmware Version
  • id (Number) ID
  • input_power_units (String) Input Power Units
  • input_voltage (Number) Input Voltage
  • location (String) Location
  • manufacturer (String) Manufacturer
  • model (String) Model
  • name (String) Name
  • operational_status (String) Operational Status
  • output_watts (Number) Output Watts
  • power_supply_type (Number) Power Supply Type
  • range1_max_input_power_watts (Number) Range1Max Input Power Watts
  • range1_max_input_voltage_high_milli_volts (Number) Range1Max Input Voltage High Milli Volts
  • rated_max_output_power (Number) Rated Max Output Power
  • redundancy_state (String) Redundancy State
  • requested_state (Number) Requested State
  • serial_number (String) Serial Number
  • state (String) State
  • status (Number) Status
  • switching_supply (Boolean) Switching Supply

Nested Schema for devices.detailed_inventory.raid_controllers

Read-Only:

  • cache_size_in_mb (Number) Cache Size In Mb
  • device_description (String) Device Description
  • driver_version (String) Driver Version
  • firmware_version (String) Firmware Version
  • fqdd (String) Fqdd
  • id (Number) ID
  • name (String) Name
  • pci_slot (String) Pci Slot
  • rollup_status (Number) Rollup Status
  • rollup_status_string (String) Rollup Status String
  • server_virtual_disks (Attributes List) Server Virtual Disks (see below for nested schema)
  • status (Number) Status
  • status_type (String) Status Type
  • storage_assignment_allowed (String) Storage Assignment Allowed

Nested Schema for devices.detailed_inventory.raid_controllers.server_virtual_disks

Read-Only:

  • cache_policy (String) Cache Policy
  • device_id (Number) Device ID
  • fqdd (String) Fqdd
  • id (Number) ID
  • layout (String) Layout
  • lock_status (String) Lock Status
  • media_type (String) Media Type
  • name (String) Name
  • raid_controller_id (Number) Raid Controller ID
  • read_policy (String) Read Policy
  • rollup_status (Number) Rollup Status
  • size (String) Size
  • state (String) State
  • status (Number) Status
  • stripe_size (String) Stripe Size
  • target_id (Number) Target ID
  • write_policy (String) Write Policy

Nested Schema for devices.detailed_inventory.server_device_cards

Read-Only:

  • databus_width (String) Databus Width
  • description (String) Description
  • id (Number) ID
  • manufacturer (String) Manufacturer
  • slot_length (String) Slot Length
  • slot_number (String) Slot Number
  • slot_type (String) Slot Type

Nested Schema for devices.detailed_inventory.softwares

Read-Only:

  • component_id (String) Component ID
  • device_description (String) Device Description
  • installation_date (String) Installation Date
  • instance_id (String) Instance ID
  • pci_device_id (String) Pci Device ID
  • software_type (String) Software Type
  • status (String) Status
  • sub_device_id (String) Sub Device ID
  • sub_vendor_id (String) Sub Vendor ID
  • vendor_id (String) Vendor ID
  • version (String) Version

Nested Schema for devices.detailed_inventory.storage_enclosures

Read-Only:

  • backplane_part_num (String) Backplane Part Num
  • channel_number (String) Channel Number
  • id (Number) ID
  • name (String) Name
  • number_of_fan_packs (Number) Number Of Fan Packs
  • rollup_status (Number) Rollup Status
  • slot_count (Number) Slot Count
  • status (Number) Status
  • status_type (String) Status Type String
  • version (String) Version

Nested Schema for devices.detailed_inventory.subsytem_rollup_status

Read-Only:

  • id (Number) ID
  • status (Number) Status
  • subsystem_name (String) Subsystem Name

Nested Schema for devices.device_management

Read-Only:

  • dns_name (String) DNSName
  • instrumentation_name (String) Instrumentation Name
  • mac_address (String) Mac Address
  • management_id (Number) Management ID
  • management_profile (Attributes Set) Management Profile (see below for nested schema)
  • management_type (Number) Management Type
  • network_address (String) Network Address

Nested Schema for devices.device_management.management_profile

Read-Only:

  • agent_name (String) Agent Name
  • has_creds (Number) Has Creds
  • management_id (Number) Management ID
  • management_profile_id (Number) Management Profile ID
  • management_url (String) Management URL
  • profile_id (String) Profile ID
  • status (Number) Status
  • status_date_time (String) Status Date Time
  • version (String) Version

Nested Schema for devices.discovery_configuration_job_information

Read-Only:

  • created_by (String) Created By
  • discovery_job_name (String) Discovery Job Name
  • group_id (String) Group ID

Nested Schema for devices.slot_configuration

Read-Only:

  • chassis_name (String) Chassis Name