saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.15k stars 5.48k forks source link

[BUG] salt-run drac gives multiple warnings #59567

Open Auha opened 3 years ago

Auha commented 3 years ago

Description Running the following commands give the following results:

salt-run drac.version <hostname>

Response:

root@salt:/srv# salt-run drac.poweron drac-storage-node-1.jchen.net
[WARNING ] Oops, unhandled type 3 ('unimplemented')
Exception occurred in runner drac.version: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/salt/client/mixins.py", line 397, in low
    data["return"] = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/salt/runners/drac.py", line 224, in version
    return __version(__connect(hostname, timeout, username, password))
  File "/usr/lib/python3/dist-packages/salt/runners/drac.py", line 90, in __version
    (stdin, stdout, stderr) = client.exec_command("racadm getconfig -g idRacInfo")
  File "/usr/local/lib/python3.8/dist-packages/paramiko/client.py", line 508, in exec_command
    chan = self._transport.open_session(timeout=timeout)
  File "/usr/local/lib/python3.8/dist-packages/paramiko/transport.py", line 875, in open_session
    return self.open_channel(
  File "/usr/local/lib/python3.8/dist-packages/paramiko/transport.py", line 1006, in open_channel
    raise e
paramiko.ssh_exception.SSHException: Unable to open channel

Right now it is using paramiko and ssh into drac server. Could it be possible to use one of the modules dracr to do it?

Setup Installed paramiko pip packages, and the correct drac username and password inside my masters config

Expected behavior Expecting it to turn on the server.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.) ``` Salt Version: Salt: 3002.2 Dependency Versions: cffi: 1.14.5 cherrypy: Not Installed dateutil: 2.7.3 docker-py: Not Installed gitdb: 2.0.6 gitpython: 3.0.7 Jinja2: 2.10.1 libgit2: Not Installed M2Crypto: Not Installed Mako: Not Installed msgpack: 0.6.2 msgpack-pure: Not Installed mysql-python: Not Installed pycparser: 2.20 pycrypto: Not Installed pycryptodome: 3.6.1 pygit2: Not Installed Python: 3.8.5 (default, Jul 28 2020, 12:59:40) python-gnupg: 0.4.5 PyYAML: 5.3.1 PyZMQ: 18.1.1 smmap: 2.0.5 timelib: Not Installed Tornado: 4.5.3 ZMQ: 4.3.2 System Versions: dist: ubuntu 20.04 focal locale: utf-8 machine: x86_64 release: 5.4.0-65-generic system: Linux version: Ubuntu 20.04 focal ```
garethgreenaway commented 2 years ago

@Auha Apologies for the delay on this one. Looking at the code for both the module and the runner, it does look like it would be possible for the runner to utilize the same commands as the module does. Looking at the error about, it appears that the runner is unable to connect via SSH to the drac device in question and the runner may not have the ability to wait for the connection to become available. Unfortunately I don't have access to a drac device to test this or future functionality.