salt.states.dellchassis

Manage chassis via Salt Proxies.

New in version 2015.8.2.

Below is an example state that sets basic parameters:

my-dell-chassis:
  dellchassis.chassis:
    - chassis_name: my-dell-chassis
    - datacenter: dc-1-us
    - location: my-location
    - mode: 2
    - idrac_launch: 1
    - slot_names:
      - server-1: my-slot-name
      - server-2: my-other-slot-name
    - blade_power_states:
      - server-1: on
      - server-2: off
      - server-3: powercycle

However, it is possible to place the entire set of chassis configuration data in pillar. Here's an example pillar structure:

proxy:
  host: 10.27.20.18
  admin_username: root
  fallback_admin_username: root
  passwords:
    - super-secret
    - old-secret
  proxytype: fx2

  chassis:
    name: fx2-1
    username: root
    password: saltstack1
    datacenter: london
    location: rack-1-shelf-3
    management_mode: 2
    idrac_launch: 0
    slot_names:
      - 'server-1': blade1
      - 'server-2': blade2

    blades:
      blade1:
        idrac_password: saltstack1
        ipmi_over_lan: True
        ip: 172.17.17.1
        subnet: 255.255.0.0
        netmask: 172.17.255.255
      blade2:
        idrac_password: saltstack1
        ipmi_over_lan: True
        ip: 172.17.17.2
        subnet: 255.255.0.0
        netmask: 172.17.255.255
      blade3:
        idrac_password: saltstack1
        ipmi_over_lan: True
        ip: 172.17.17.2
        subnet: 255.255.0.0
        netmask: 172.17.255.255
      blade4:
        idrac_password: saltstack1
        ipmi_over_lan: True
        ip: 172.17.17.2
        subnet: 255.255.0.0
        netmask: 172.17.255.255

    switches:
      switch-1:
        ip: 192.168.1.2
        netmask: 255.255.255.0
        broadcast: 192.168.1.255
        snmp: nonpublic
        password: saltstack1
      switch-2:
        ip: 192.168.1.3
        netmask: 255.255.255.0
        broadcast: 192.168.1.255
        snmp: nonpublic
        password: saltstack1

And to go with it, here's an example state that pulls the data from the pillar stated above:

{% set details = pillar.get('proxy:chassis', {}) %}
standup-step1:
  dellchassis.chassis:
    - name: {{ details['name'] }}
    - location: {{ details['location'] }}
    - mode: {{ details['management_mode'] }}
    - idrac_launch: {{ details['idrac_launch'] }}
    - slot_names:
      {% for k, v in details['slot_names'].iteritems() %}
      - {{ k }}: {{ v }}
      {% endfor %}

blade_powercycle:
  dellchassis.chassis:
    - blade_power_states:
      - server-1: powercycle
      - server-2: powercycle
      - server-3: powercycle
      - server-4: powercycle

# Set idrac_passwords for blades
{% for k, v in details['blades'].iteritems() %}
{{ k }}:
  dellchassis.blade_idrac:
    - idrac_password: {{ password }}
{% endfor %}

Note

This state module relies on the dracr.py execution module, which runs racadm commands on the chassis, blades, etc. The racadm command runs very slowly and, depending on your state, the proxy minion return might timeout before the racadm commands have completed. If you are repeatedly seeing minions timeout after state calls, please use the -t CLI argument to increase the timeout variable.

For example:

salt '*' state.sls my-dell-chasis-state-name -t 60
salt.states.dellchassis.blade_idrac(name, idrac_password=None, idrac_ipmi=None, idrac_ip=None, idrac_netmask=None, idrac_gateway=None, idrac_dnsname=None, drac_dhcp=None)

Set parameters for iDRAC in a blade.

Parameters:
  • idrac_password -- Password to establish for the iDRAC interface
  • idrac_ipmi -- Enable/Disable IPMI over LAN
  • idrac_ip -- Set IP address for iDRAC
  • idrac_netmask -- Set netmask for iDRAC
  • idrac_gateway -- Set gateway for iDRAC
  • drac_dhcp -- Turn on DHCP for iDRAC (True turns on, False does nothing becaause setting a static IP will disable DHCP).
Returns:

A standard Salt changes dictionary

salt.states.dellchassis.chassis(name, chassis_name=None, password=None, datacenter=None, location=None, mode=None, idrac_launch=None, slot_names=None, blade_power_states=None)

Manage a Dell Chassis.

chassis_name
The name of the chassis.
datacenter
The datacenter in which the chassis is located
location
The location of the chassis.
password
Password for the chassis. Note: If this password is set for the chassis, the current implementation of this state will set this password both on the chassis and the iDrac passwords on any configured blades. If the password for the blades should be distinct, they should be set separately with the blade_idrac function.
mode

The management mode of the chassis. Viable options are:

  • 0: None
  • 1: Monitor
  • 2: Manage and Monitor
idrac_launch

The iDRAC launch method of the chassis. Viable options are:

  • 0: Disabled (launch iDRAC using IP address)
  • 1: Enabled (launch iDRAC using DNS name)
slot_names
The names of the slots, provided as a list identified by their slot numbers.
blade_power_states

The power states of a blade server, provided as a list and identified by their server numbers. Viable options are:

  • on: Ensure the blade server is powered on.
  • off: Ensure the blade server is powered off.
  • powercycle: Power cycle the blade server.

Example:

my-dell-chassis:
  dellchassis.chassis:
    - name: my-dell-chassis
    - location: my-location
    - datacenter: london
    - mode: 2
    - idrac_launch: 1
    - slot_names:
      - 1: my-slot-name
      - 2: my-other-slot-name
    - blade_power_states:
      - server-1: on
      - server-2: off
      - server-3: powercycle
salt.states.dellchassis.switch(name, ip=None, netmask=None, gateway=None, dhcp=None, password=None, snmp=None)

Manage switches in a Dell Chassis.

name
The switch designation (e.g. switch-1, switch-2)
ip
The Static IP Address of the switch
netmask
The netmask for the static IP
gateway
The gateway for the static IP
dhcp
True: Enable DHCP False: Do not change DHCP setup (disabling DHCP is automatic when a static IP is set)
password
The access (root) password for the switch
snmp
The SNMP community string for the switch

Example:

my-dell-chassis:
  dellchassis.switch:
    - switch: switch-1
    - ip: 192.168.1.1
    - netmask: 255.255.255.0
    - gateway: 192.168.1.254
    - dhcp: True
    - password: secret
    - snmp: public