salt.modules.cimc

Module to provide Cisco UCS compatibility to Salt

codeauthor:

Spencer Ervin <spencer_ervin@hotmail.com>

maturity:

new

depends:

none

platform:

unix

Configuration

This module accepts connection configuration details either as parameters, or as configuration settings in pillar as a Salt proxy. Options passed into opts will be ignored if options are passed into pillar.

About

This execution module was designed to handle connections to a Cisco UCS server. This module adds support to send connections directly to the device through the rest API.

salt.modules.cimc.activate_backup_image(reset=False)

Activates the firmware backup image.

CLI Example:

Parameters:

reset (bool) -- Reset the CIMC device on activate.

salt '*' cimc.activate_backup_image
salt '*' cimc.activate_backup_image reset=True
salt.modules.cimc.create_user(uid=None, username=None, password=None, priv=None)

Create a CIMC user with username and password.

Parameters:
  • uid (int) -- The user ID slot to create the user account in.

  • username (str) -- The name of the user.

  • password (str) -- The clear text password of the user.

  • priv (str) -- The privilege level of the user.

CLI Example:

salt '*' cimc.create_user 11 username=admin password=foobar priv=admin
salt.modules.cimc.get_bios_defaults()

Get the default values of BIOS tokens.

CLI Example:

salt '*' cimc.get_bios_defaults
salt.modules.cimc.get_bios_settings()

Get the C240 server BIOS token values.

CLI Example:

salt '*' cimc.get_bios_settings
salt.modules.cimc.get_boot_order()

Retrieves the configured boot order table.

CLI Example:

salt '*' cimc.get_boot_order
salt.modules.cimc.get_cpu_details()

Get the CPU product ID details.

CLI Example:

salt '*' cimc.get_cpu_details
salt.modules.cimc.get_disks()

Get the HDD product ID details.

CLI Example:

salt '*' cimc.get_disks
salt.modules.cimc.get_ethernet_interfaces()

Get the adapter Ethernet interface details.

CLI Example:

salt '*' cimc.get_ethernet_interfaces
salt.modules.cimc.get_fibre_channel_interfaces()

Get the adapter fibre channel interface details.

CLI Example:

salt '*' cimc.get_fibre_channel_interfaces
salt.modules.cimc.get_firmware()

Retrieves the current running firmware versions of server components.

CLI Example:

salt '*' cimc.get_firmware
salt.modules.cimc.get_hostname()

Retrieves the hostname from the device.

New in version 2019.2.0.

CLI Example:

salt '*' cimc.get_hostname
salt.modules.cimc.get_ldap()

Retrieves LDAP server details.

CLI Example:

salt '*' cimc.get_ldap
salt.modules.cimc.get_management_interface()

Retrieve the management interface details.

CLI Example:

salt '*' cimc.get_management_interface
salt.modules.cimc.get_memory_token()

Get the memory RAS BIOS token.

CLI Example:

salt '*' cimc.get_memory_token
salt.modules.cimc.get_memory_unit()

Get the IMM/Memory unit product ID details.

CLI Example:

salt '*' cimc.get_memory_unit
salt.modules.cimc.get_network_adapters()

Get the list of network adapters and configuration details.

CLI Example:

salt '*' cimc.get_network_adapters
salt.modules.cimc.get_ntp()

Retrieves the current running NTP configuration.

CLI Example:

salt '*' cimc.get_ntp
salt.modules.cimc.get_pci_adapters()

Get the PCI adapter product ID details.

CLI Example:

salt '*' cimc.get_disks
salt.modules.cimc.get_power_configuration()

Get the configuration of the power settings from the device. This is only available on some C-Series servers.

New in version 2019.2.0.

CLI Example:

salt '*' cimc.get_power_configuration
salt.modules.cimc.get_power_supplies()

Retrieves the power supply unit details.

CLI Example:

salt '*' cimc.get_power_supplies
salt.modules.cimc.get_snmp_config()

Get the snmp configuration details.

CLI Example:

salt '*' cimc.get_snmp_config
salt.modules.cimc.get_syslog()

Get the Syslog client-server details.

CLI Example:

salt '*' cimc.get_syslog
salt.modules.cimc.get_syslog_settings()

Get the Syslog configuration settings from the system.

New in version 2019.2.0.

CLI Example:

salt '*' cimc.get_syslog_settings
salt.modules.cimc.get_system_info()

Get the system information.

CLI Example:

salt '*' cimc.get_system_info
salt.modules.cimc.get_users()

Get the CIMC users.

CLI Example:

salt '*' cimc.get_users
salt.modules.cimc.get_vic_adapters()

Get the VIC adapter general profile details.

CLI Example:

salt '*' cimc.get_vic_adapters

Get the VIC adapter uplink port details.

CLI Example:

salt '*' cimc.get_vic_uplinks
salt.modules.cimc.mount_share(name=None, remote_share=None, remote_file=None, mount_type='nfs', username=None, password=None)

Mounts a remote file through a remote share. Currently, this feature is supported in version 1.5 or greater. The remote share can be either NFS, CIFS, or WWW.

Some of the advantages of CIMC Mounted vMedia include:

Communication between mounted media and target stays local (inside datacenter) Media mounts can be scripted/automated No vKVM requirements for media connection Multiple share types supported Connections supported through all CIMC interfaces

Note: CIMC Mounted vMedia is enabled through BIOS configuration.

Parameters:
  • name (str) -- The name of the volume on the CIMC device.

  • remote_share (str) -- The file share link that will be used to mount the share. This can be NFS, CIFS, or WWW. This

  • file. (must be the directory path and not the full path to the remote) --

  • remote_file (str) -- The name of the remote file to mount. It must reside within remote_share.

  • mount_type (str) -- The type of share to mount. Valid options are nfs, cifs, and www.

  • username (str) -- An optional requirement to pass credentials to the remote share. If not provided, an

  • made. (unauthenticated connection attempt will be) --

  • password (str) -- An optional requirement to pass a password to the remote share. If not provided, an

  • made. --

CLI Example:

salt '*' cimc.mount_share name=WIN7 remote_share=10.xxx.27.xxx:/nfs remote_file=sl1huu.iso

salt '*' cimc.mount_share name=WIN7 remote_share=10.xxx.27.xxx:/nfs remote_file=sl1huu.iso username=bob password=badpassword
salt.modules.cimc.reboot()

Power cycling the server.

CLI Example:

salt '*' cimc.reboot
salt.modules.cimc.set_hostname(hostname=None)

Sets the hostname on the server.

New in version 2019.2.0.

Parameters:

hostname (str) -- The new hostname to set.

CLI Example:

salt '*' cimc.set_hostname foobar
salt.modules.cimc.set_logging_levels(remote=None, local=None)

Sets the logging levels of the CIMC devices. The logging levels must match the following options: emergency, alert, critical, error, warning, notice, informational, debug.

New in version 2019.2.0.

Parameters:
  • remote (str) -- The logging level for SYSLOG logs.

  • local (str) -- The logging level for the local device.

CLI Example:

salt '*' cimc.set_logging_levels remote=error local=notice
salt.modules.cimc.set_ntp_server(server1='', server2='', server3='', server4='')

Sets the NTP servers configuration. This will also enable the client NTP service.

Parameters:
  • server1 (str) -- The first IP address or FQDN of the NTP servers.

  • server2 (str) -- The second IP address or FQDN of the NTP servers.

  • server3 (str) -- The third IP address or FQDN of the NTP servers.

  • server4 (str) -- The fourth IP address or FQDN of the NTP servers.

CLI Example:

salt '*' cimc.set_ntp_server 10.10.10.1

salt '*' cimc.set_ntp_server 10.10.10.1 foo.bar.com
salt.modules.cimc.set_power_configuration(policy=None, delayType=None, delayValue=None)

Sets the power configuration on the device. This is only available for some C-Series servers.

New in version 2019.2.0.

Parameters:
  • policy (str) -- The action to be taken when chassis power is restored after

  • following (delayed with this option. This can be one of the) --

    reset: The server is allowed to boot up normally when power is restored. The server can restart immediately or, optionally, after a fixed or random delay.

    stay-off: The server remains off until it is manually restarted.

    last-state: The server restarts and the system attempts to restore any processes that were running before power was lost.

  • delayType (str) -- If the selected policy is reset, the restart can be

  • following --

    fixed: The server restarts after a fixed delay.

    random: The server restarts after a random delay.

  • delayValue (int) -- If a fixed delay is selected, once chassis power is

  • rebooting (restored and the Cisco IMC has finished) --

  • for (the system waits) --

  • an (the specified number of seconds before restarting the server. Enter) --

  • 240. (integer between 0 and) --

CLI Example:

salt '*' cimc.set_power_configuration stay-off

salt '*' cimc.set_power_configuration reset fixed 0
salt.modules.cimc.set_syslog_server(server=None, type='primary')

Set the SYSLOG server on the host.

Parameters:
  • server (str) -- The hostname or IP address of the SYSLOG server.

  • type (str) -- Specifies the type of SYSLOG server. This can either be primary (default) or secondary.

CLI Example:

salt '*' cimc.set_syslog_server foo.bar.com

salt '*' cimc.set_syslog_server foo.bar.com primary

salt '*' cimc.set_syslog_server foo.bar.com secondary
salt.modules.cimc.set_user(uid=None, username=None, password=None, priv=None, status=None)

Sets a CIMC user with specified configurations.

New in version 2019.2.0.

Parameters:
  • uid (int) -- The user ID slot to create the user account in.

  • username (str) -- The name of the user.

  • password (str) -- The clear text password of the user.

  • priv (str) -- The privilege level of the user.

  • status (str) -- The account status of the user.

CLI Example:

salt '*' cimc.set_user 11 username=admin password=foobar priv=admin active
salt.modules.cimc.tftp_update_bios(server=None, path=None)

Update the BIOS firmware through TFTP.

Parameters:
  • server (str) -- The IP address or hostname of the TFTP server.

  • path (str) -- The TFTP path and filename for the BIOS image.

CLI Example:

salt '*' cimc.tftp_update_bios foo.bar.com HP-SL2.cap
salt.modules.cimc.tftp_update_cimc(server=None, path=None)

Update the CIMC firmware through TFTP.

Parameters:
  • server (str) -- The IP address or hostname of the TFTP server.

  • path (str) -- The TFTP path and filename for the CIMC image.

CLI Example:

salt '*' cimc.tftp_update_cimc foo.bar.com HP-SL2.bin