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 amongfilter_expression
,ids
anddevice_service_tags
can be configured. (see below for nested schema)inventory_types
(List of String) The types of inventory types to fetch. Accepted values areserverDeviceCards
,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
devices
(Attributes List) Devices fetched. (see below for nested schema)id
(Number) Dummy ID of the datasource.
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:
capabilities
(Attributes List) Device Capabilities (see below for nested schema)cpus
(Attributes List) CPU related Information. (see below for nested schema)disks
(Attributes List) Disk related Information. (see below for nested schema)fcis
(Attributes List) FCI related Information. (see below for nested schema)frus
(Attributes List) Device FRUs (see below for nested schema)licenses
(Attributes List) Device Licenses (see below for nested schema)locations
(Attributes List) Device Locations (see below for nested schema)management_info
(Attributes List) Device Management (see below for nested schema)memory
(Attributes List) Memory Information. (see below for nested schema)nics
(Attributes List) NIC related Information. (see below for nested schema)os
(Attributes List) OS related Information. (see below for nested schema)power_state
(Attributes List) Server Power States (see below for nested schema)power_supply
(Attributes List) Power Supply related Information. (see below for nested schema)raid_controllers
(Attributes List) RAIDController Information. (see below for nested schema)server_device_cards
(Attributes List) Server Device Cards. (see below for nested schema)softwares
(Attributes List) Device Softwares (see below for nested schema)storage_enclosures
(Attributes List) Storage Enclosure Information. (see below for nested schema)subsytem_rollup_status
(Attributes List) Sub System Rollup Status (see below for nested schema)
Nested Schema for devices.detailed_inventory.capabilities
Read-Only:
capability_type
(Attributes) Capability Type (see below for nested schema)id
(Number) ID
Nested Schema for devices.detailed_inventory.capabilities.capability_type
Read-Only:
capability_id
(Number) Capability IDdescription
(String) Descriptionid_owner
(Number) IDOwnername
(String) Name
Nested Schema for devices.detailed_inventory.cpus
Read-Only:
brand_name
(String) Brand Namecurrent_speed
(Number) Current Speedfamily
(String) Familyid
(Number) IDinstance_id
(String) Instance IDmax_speed
(Number) Max Speedmodel_name
(String) Model Namenumber_of_cores
(Number) Number Of Coresnumber_of_enabled_cores
(Number) Number Of Enabled Coresslot_number
(String) Slot Numberstatus
(Number) Statusvoltage
(String) Voltage
Nested Schema for devices.detailed_inventory.disks
Read-Only:
bus_type
(String) Bus Typechannel
(Number) Channeldisk_number
(String) Disk Numberenclosure_id
(String) Enclosure IDencryption_ability
(Boolean) Encryption Abilityform_factor
(String) Form Factorfree_space
(String) Free Spaceid
(Number) IDmanufactured_day
(Number) Manufactured Daymanufactured_week
(Number) Manufactured Weekmanufactured_year
(Number) Manufactured Yearmedia_type
(String) Media Typemodel_number
(String) Model Numberpart_number
(String) Part Numberpredictive_failure_state
(String) Predictive Failure Stateraid_status
(String) Raid Statusremaining_read_write_endurance
(String) Remaining Read Write Endurancerevision
(String) Revisionsas_address
(String) Sas Addresssecurity_state
(String) Security Stateserial_number
(String) Serial Numbersize
(String) Sizeslot_number
(Number) Slot Numberstatus
(Number) Statusstatus_string
(String) Status Stringused_space
(String) Used Spacevendor_name
(String) Vendor Name
Nested Schema for devices.detailed_inventory.fcis
Read-Only:
device_description
(String) Device Descriptiondevice_name
(String) Device Namefirst_fctarget_lun
(String) First Fctarget Lunfirst_fctarget_wwpn
(String) First Fctarget Wwpnfqdd
(String) Fqddid
(Number) IDlink_status
(String) Link Statusport_number
(Number) Port Numberport_speed
(String) Port Speedsecond_fctarget_lun
(String) Second Fctarget Lunsecond_fctarget_wwpn
(String) Second Fctarget Wwpnvendor_name
(String) Vendor Namevirtual_wwn
(String) Virtual Wwnvirtual_wwpn
(String) Virtual Wwpnwwn
(String) Wwnwwpn
(String) Wwpn
Nested Schema for devices.detailed_inventory.frus
Read-Only:
id
(Number) IDmanufacturer
(String) Manufacturername
(String) Namepart_number
(String) Part Numberrevision
(String) Revisionserial_number
(String) Serial Number
Nested Schema for devices.detailed_inventory.licenses
Read-Only:
assigned_devices
(String) Assigned Devicesentitlement_id
(String) Entitlement Ideval_time_remaining
(Number) Eval Time Remaininglicense_bound
(Number) License Boundlicense_description
(String) License Descriptionlicense_status
(Number) License Statuslicense_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 Idname
(String) Name
Nested Schema for devices.detailed_inventory.locations
Read-Only:
aisle
(String) Aisledatacenter
(String) Datacenterid
(Number) IDmanagement_system_unit
(Number) Management System Unitrack
(String) Rackrackslot
(String) Rackslotroom
(String) Room
Nested Schema for devices.detailed_inventory.management_info
Read-Only:
dns_name
(String) DNSNameend_point_agents
(Attributes List) End Point Agents (see below for nested schema)instrumentation_name
(String) Instrumentation Nameip_address
(String) IPAddressmac_address
(String) MACAddressmanagement_id
(Number) Management IDmanagement_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 Namehas_creds
(Number) Has Credsmanagement_profile_id
(Number) Management Profile IDmanagement_url
(String) Management URLprofile_id
(String) Profile IDstatus
(Number) Statusstatus_date_time
(String) Status Date Timeversion
(String) Version
Nested Schema for devices.detailed_inventory.management_info.management_type
Read-Only:
description
(String) Descriptionmanagement_type
(Number) Management Typename
(String) Name
Nested Schema for devices.detailed_inventory.memory
Read-Only:
bank_name
(String) Bank Namecurrent_operating_speed
(Number) Current Operating Speeddevice_description
(String) Device Descriptionid
(Number) IDinstance_id
(String) Instance IDmanufacturer
(String) Manufacturermanufacturer_date
(String) Manufacturer Datename
(String) Namepart_number
(String) Part Numberrank
(String) Rankserial_number
(String) Serial Numbersize
(Number) Sizespeed
(Number) Speedstatus
(Number) Statustype_details
(String) Type Details
Nested Schema for devices.detailed_inventory.nics
Read-Only:
nic_id
(String) Nic IDports
(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 Speedlink_status
(String) Link Statuspartitions
(Attributes List) Partitions (see below for nested schema)port_id
(String) Port IDproduct_name
(String) Product Name
Nested Schema for devices.detailed_inventory.nics.ports.partitions
Read-Only:
current_mac_address
(String) Current Mac Addressfcoe_mode
(String) Fcoe Modefqdd
(String) Fqddiscsi_mode
(String) Iscsi Modemax_bandwidth
(Number) Max Bandwidthmin_bandwidth
(Number) Min Bandwidthnic_mode
(String) Nic Modepermanent_fcoe_mac_address
(String) Permanent Fcoe Mac Addresspermanent_iscsi_mac_address
(String) Permanent Iscsi Mac Addresspermanent_mac_address
(String) Permanent Mac Addressvirtual_mac_address
(String) Virtual Mac Addressvirtual_wwn
(String) Virtual Wwnvirtual_wwpn
(String) Virtual Wwpnwwn
(String) Wwnwwpn
(String) Wwpn
Nested Schema for devices.detailed_inventory.os
Read-Only:
hostname
(String) Hostnameid
(Number) IDos_name
(String) Os Nameos_version
(String) Os Version
Nested Schema for devices.detailed_inventory.power_state
Read-Only:
id
(Number) IDpower_state
(Number) Power State
Nested Schema for devices.detailed_inventory.power_supply
Read-Only:
ac_input
(Boolean) Ac Inputac_output
(Boolean) Ac Outputactive_input_voltage
(String) Active Input Voltagefirmware_version
(String) Firmware Versionid
(Number) IDinput_power_units
(String) Input Power Unitsinput_voltage
(Number) Input Voltagelocation
(String) Locationmanufacturer
(String) Manufacturermodel
(String) Modelname
(String) Nameoperational_status
(String) Operational Statusoutput_watts
(Number) Output Wattspower_supply_type
(Number) Power Supply Typerange1_max_input_power_watts
(Number) Range1Max Input Power Wattsrange1_max_input_voltage_high_milli_volts
(Number) Range1Max Input Voltage High Milli Voltsrated_max_output_power
(Number) Rated Max Output Powerredundancy_state
(String) Redundancy Staterequested_state
(Number) Requested Stateserial_number
(String) Serial Numberstate
(String) Statestatus
(Number) Statusswitching_supply
(Boolean) Switching Supply
Nested Schema for devices.detailed_inventory.raid_controllers
Read-Only:
cache_size_in_mb
(Number) Cache Size In Mbdevice_description
(String) Device Descriptiondriver_version
(String) Driver Versionfirmware_version
(String) Firmware Versionfqdd
(String) Fqddid
(Number) IDname
(String) Namepci_slot
(String) Pci Slotrollup_status
(Number) Rollup Statusrollup_status_string
(String) Rollup Status Stringserver_virtual_disks
(Attributes List) Server Virtual Disks (see below for nested schema)status
(Number) Statusstatus_type
(String) Status Typestorage_assignment_allowed
(String) Storage Assignment Allowed
Nested Schema for devices.detailed_inventory.raid_controllers.server_virtual_disks
Read-Only:
cache_policy
(String) Cache Policydevice_id
(Number) Device IDfqdd
(String) Fqddid
(Number) IDlayout
(String) Layoutlock_status
(String) Lock Statusmedia_type
(String) Media Typename
(String) Nameraid_controller_id
(Number) Raid Controller IDread_policy
(String) Read Policyrollup_status
(Number) Rollup Statussize
(String) Sizestate
(String) Statestatus
(Number) Statusstripe_size
(String) Stripe Sizetarget_id
(Number) Target IDwrite_policy
(String) Write Policy
Nested Schema for devices.detailed_inventory.server_device_cards
Read-Only:
databus_width
(String) Databus Widthdescription
(String) Descriptionid
(Number) IDmanufacturer
(String) Manufacturerslot_length
(String) Slot Lengthslot_number
(String) Slot Numberslot_type
(String) Slot Type
Nested Schema for devices.detailed_inventory.softwares
Read-Only:
component_id
(String) Component IDdevice_description
(String) Device Descriptioninstallation_date
(String) Installation Dateinstance_id
(String) Instance IDpci_device_id
(String) Pci Device IDsoftware_type
(String) Software Typestatus
(String) Statussub_device_id
(String) Sub Device IDsub_vendor_id
(String) Sub Vendor IDvendor_id
(String) Vendor IDversion
(String) Version
Nested Schema for devices.detailed_inventory.storage_enclosures
Read-Only:
backplane_part_num
(String) Backplane Part Numchannel_number
(String) Channel Numberid
(Number) IDname
(String) Namenumber_of_fan_packs
(Number) Number Of Fan Packsrollup_status
(Number) Rollup Statusslot_count
(Number) Slot Countstatus
(Number) Statusstatus_type
(String) Status Type Stringversion
(String) Version
Nested Schema for devices.detailed_inventory.subsytem_rollup_status
Read-Only:
id
(Number) IDstatus
(Number) Statussubsystem_name
(String) Subsystem Name
Nested Schema for devices.device_management
Read-Only:
dns_name
(String) DNSNameinstrumentation_name
(String) Instrumentation Namemac_address
(String) Mac Addressmanagement_id
(Number) Management IDmanagement_profile
(Attributes Set) Management Profile (see below for nested schema)management_type
(Number) Management Typenetwork_address
(String) Network Address
Nested Schema for devices.device_management.management_profile
Read-Only:
agent_name
(String) Agent Namehas_creds
(Number) Has Credsmanagement_id
(Number) Management IDmanagement_profile_id
(Number) Management Profile IDmanagement_url
(String) Management URLprofile_id
(String) Profile IDstatus
(Number) Statusstatus_date_time
(String) Status Date Timeversion
(String) Version
Nested Schema for devices.discovery_configuration_job_information
Read-Only:
created_by
(String) Created Bydiscovery_job_name
(String) Discovery Job Namegroup_id
(String) Group ID
Nested Schema for devices.slot_configuration
Read-Only:
chassis_name
(String) Chassis Name