ome_discovery (Resource)

This terraform resource is used to manage Discovery entity on OME.We can Create, Update and Delete OME Discoveries using this resource. We can also do an ‘Import’ an existing ‘Discovery’ from OME .

Example Usage

resource "ome_discovery" "discover1" {
  name     = "discover-lab"
  schedule = "RunNow"
  # timeout to track the discovery job till x number of minutes.
  timeout = 10
  # ignore_partial_failure is used to control the terraform error in case of undiscovered ips after the discovery.
  ignore_partial_failure = true

  # discovery_config_targets is used to provide the server details
  discovery_config_targets = [
    {
      network_address_detail = ["10.0.0.0"]
      device_type            = ["SERVER"]
      wsman = {
        username = "user"
        password = "password"
      }
  }]
}

After the execution of above resource block, discovery would have been created on the OME. For more information, Please check the terraform state file.

Schema

Required

  • discovery_config_targets (Attributes Set) - Provide the list of discovery targets. - Each discovery target is a set of “network_address_detail”, “device_types”, and one or more protocol credentials. (see below for nested schema)
  • name (String) Name of the discovery configuration job
  • schedule (String) Provides the option to schedule the discovery job. If RunLater is selected, then attribute cron must be specified. If RunNow is selected, then attribute timeout must be specified.

Optional

  • cron (String) Provide a cron expression based on Quartz cron format
  • email_recipient (String) - Enter the email address to which notifications are to be sent about the discovery job status. - Configure the SMTP settings to allow sending notifications to an email address.
  • enable_community_strings (Boolean) - Enable the use of SNMP community strings to receive SNMP traps using Application Settings in OpenManage Enterprise. - This option is available only for the discovered iDRAC servers and MX7000 chassis.
  • ignore_partial_failure (Boolean) Provides the option to ignore partial failures. Partial failures occur when there is a combination of both discovered and undiscovered IPs with Schedule is set to RunNow. If partial_failure is set false then partial_failure is not ignored, and module will error out.If partial_failure is set true then partial_failure is ignored, and module will not error out.
  • timeout (Number) Provide a timeout in minute to track the job
  • trap_destination (Boolean) - Enable OpenManage Enterprise to receive the incoming SNMP traps from the discovered devices. - This is effective only for servers discovered by using their iDRAC interface.

Read-Only

  • id (String) ID of the discovery configuration group
  • job_id (Number) Discovery Job ID.
  • job_tracking (Attributes) Discovery Job Tracking Info Captured When Schedule is set to RunNow (see below for nested schema)

Nested Schema for discovery_config_targets

Required:

  • device_type (List of String) - Provide the type of devices to be discovered. - The accepted types are SERVER, CHASSIS, NETWORK SWITCH, and STORAGE. - A combination or all of the above can be provided. - “Supported protocols for each device type are:” - SERVER - “redfish”, “snmp”, and “ssh”. - CHASSIS - “redfish”. - NETWORK SWITCH - “snmp”. - STORAGE - “snmp”.
  • network_address_detail (List of String) - “Provide the list of IP addresses, host names, or the range of IP addresses of the devices to be discoveredor included.” - “Sample Valid IP Range Formats” - " 192.35.0.0" - " 192.36.0.0-10.36.0.255" - " 192.37.0.0/24" - " 2345:f2b1:f083:135::5500/118" - " 2345:f2b1:f083:135::a500-2607:f2b1:f083:135::a600" - " hostname.domain.tld" - " hostname" - " 2345:f2b1:f083:139::22a" - “Sample Invalid IP Range Formats” - " 192.35.0.*" - " 192.36.0.0-255" - " 192.35.0.0/255.255.255.0" - NOTE: The range size for the number of IP addresses is limited to 16,385 (0x4001). - NOTE: Both IPv6 and IPv6 CIDR formats are supported.

Optional:

Nested Schema for discovery_config_targets.redfish

Required:

  • password (String) Provide a password for the protocol.
  • username (String) Provide a username for the protocol.

Optional:

  • ca_check (Boolean) Enable the Certificate Authority (CA) check.
  • cn_check (Boolean) Enable the Common Name (CN) check.
  • port (Number) Enter the port number that the job must use to discover the devices.
  • retries (Number) Enter the number of repeated attempts required to discover a device
  • timeout (Number) Enter the time in seconds after which a job must stop running.

Nested Schema for discovery_config_targets.snmp

Required:

  • community (String) Community string for the SNMP protocol.

Optional:

  • port (Number) Enter the port number that the job must use to discover the devices.
  • retries (Number) Enter the number of repeated attempts required to discover a device.
  • timeout (Number) Enter the time in seconds after which a job must stop running.

Nested Schema for discovery_config_targets.ssh

Required:

  • password (String) Provide a password for the protocol.
  • username (String) Provide a username for the protocol.

Optional:

  • check_known_hosts (Boolean) Verify the known host key.
  • is_sudo_user (Boolean) Use the SUDO option
  • port (Number) Enter the port number that the job must use to discover the devices.
  • retries (Number) Enter the number of repeated attempts required to discover a device.
  • timeout (Number) Enter the time in seconds after which a job must stop running.

Nested Schema for discovery_config_targets.wsman

Required:

  • password (String) Provide a password for the protocol.
  • username (String) Provide a username for the protocol.

Optional:

  • ca_check (Boolean) Enable the Certificate Authority (CA) check.
  • cn_check (Boolean) Enable the Common Name (CN) check.
  • port (Number) Enter the port number that the job must use to discover the devices.
  • retries (Number) Enter the number of repeated attempts required to discover a device
  • timeout (Number) Enter the time in seconds after which a job must stop running.

Nested Schema for job_tracking

Read-Only:

  • discovered_ip (List of String) IPs discovered after tracking the job until it timeout.
  • job_execution_results (List of String) Provides information about job executions discovered after tracking the job until it timeout.
  • undiscovered_ip (List of String) IPs remains undiscovered after tracking the job until it timeout.

Import

Import is supported using the following syntax:

terraform import ome_discovery.code_1 "<discovery-job-id>"