Skip to main content

Retrieving information about a specific server

Uses this definition to retrieve information about a specific server that is managed by Lenovo XClarity Orchestrator.

Usage

resource "lxco_server" "server" {
resource_id = string
}
output "server" {
value = data.lxco_server.server
}

Example

The following example retrieves information about a specific server.
terraform {
required_providers {
lxco = {
version = "0.1"
source = "lenovo.com/xclarity/lxco"
}
}
}

provider "lxco" {
host = "192.0.2.0"
# username = ""
# password = ""
}

# Fetch details for a specific server
resource "lxco_server" "server" {
resource_uuid = "00632D78DE644E23B712E200FE449787-7AF5D198CECF431AAEC674C7CA5A29B5"
}

# Return details for the server
output "server" {
value = data.lxco_server.server
}

Inputs

NameRequired / OptionalTypeDescription
resource_uuidRequiredStringServer ID

The device ID includes the UUID of the device and the UUID of the resource manager that manages the device, separated by a dash (deviceUUID–managerUUID).

Outputs

NameTypeDescription
serversArray of objectsInformation about the managed server
 domain_nameStringDomain name
 group_namesArray of stringsList of names of the groups to which the device belongs
 health_statusStringHealth state of the device (translated). This can be one of the following values.
  • Normal
  • Warning
  • Critical
  • Unknown
 hostnameStringHostname
 idStringDevice ID
 ipv4_addressesArray of stringsList of IPv4 addresses
 ipv6_addressesArray of stringsList of IPv6 addresses
 locationStringLocation description
 location_lowest_rack_unitStringLowest rack unit
 location_rackStringRack name
 location_roomStringRoom name
 machine_typeStringDevice machine type
 manager_domain_nameStringFully qualified domain name
 manager_hostnameStringHost name
 manager_ipv4_addressesArray of stringsIPv4 addresses
 manager_ipv6_addressesArray of stringsIPv6 addresses
 modelStringDevice model
 power_statusStringPower status (translated). This can be one of the following values.
  • Off
  • On
  • Standby
  • Unknown
 product_nameStringDevice product name
 serial_numberStringDevice serial number
 user_defined_nameStringUser-defined name for the device
 uuidStringDevice UUID
The following example is returned if the request is successful.
{
"servers":[{
"domain_name": "labs.lenovo.com",
"group_names": [],
"health_status": "Warning",
"hostname": "IMM2-3440b5e913f8",
"id": "FAAC1AC51EE411E3A8503440B5EAC7F0-23C87F0A2CB6491097489193447A655C",
"ipv4_addresses": ["10.243.10.193","169.254.95.118"],
"ipv6_addresses": ["2000:1013:0:0:0:0:217:105","fd55:faaf:e1ab:2021:3640:b5ff:fee9:13f8",
"fe80:0:0:0:3640:b5ff:fee9:13f8"],
"location": "Morrisville",
"location_lowest_rack_unit": 0,
"location_rack": "",
"location_room": "",
"machine_type": "7916",
"manager_domain_name": "labs.lenovo.com",
"manager_hostname": "xhmc194",
"manager_ipv4_addresses": ["10.243.2.107"],
"manager_ipv6_addresses": ["fd55:faaf:e1ab:2021:5054:ff:fec4:df97","fe80:0:0:0:5054:ff:fec4:df97"],
"model": "AC1",
"power_status": "On",
"product_name": "IBM Flex System x222 Lower Compute Node with embedded 10Gb Virtual Fabric",
"serial_number": "SLOT002",
"user_defined_name": "*node02_1",
"uuid": "FAAC1AC51EE411E3A8503440B5EAC7F0"
}]
}