Salt-minion deployment failed on VM with ERROR: 'Unable to execute command'
search cancel

Salt-minion deployment failed on VM with ERROR: 'Unable to execute command'

book

Article ID: 415517

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite) VMware Salt

Issue/Introduction

  • Deploying the salt-minion on a Windows VM using the command salt-cloud -p <profile> <VM-Name> -l debug returns the following error:
    Traceback (most recent call last):
    File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/cloud.py", line 1032, in wait_for_psexecsvc
    stdout, stderr, ret_code = run_psexec_command(
    File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/cloud.py", line 989, in run_psexec_command
    with Client(
    File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/cloud.py", line 898, in _init
    self. client = Pstxecclient(server, username, password, port, encrypt)
    NameError: name 'PsExecClient' is not defined
    [DEBUG] Retrying psexec connection to host ##.##.#.## on port 445 (try 1)
    [ERROR] Unable to execute command
  • The command salt-pip show pypsexec returns the following message:
    WARNING: Package(s) not found: pypsexec

Environment

Aria Automation Config 8.x

Cause

This issue occurs by the missing PsExecClient module, a required prerequisite for minion installation.

Resolution

To resolve this issue, follow these steps on the Salt master server as the root user:

  1. Install the smbprotocol and pypsexec packages using the following commands:
    salt-pip install smbprotocol
    salt-pip install pypsexec
  2. Confirm the package installation using the following command:
    salt-pip list | egrep -i "smbprotocol|pypsexec"
  3. Re-initiate the salt-minion deployment.
    Note: Running this command requires having installed salt-cloud from the Salt repository.
    salt-cloud -p <profile> <VM-Name> -l debug

Additional Information

Add the SaltStack Config resource to the cloud template

The master plugin includes a "vendored" version of the saltify driver from salt-cloud. If you install salt-cloud on your Salt master, you can then re-run any failed minion deployment if the VM still exists using a command like salt-cloud -p /etc/salt/cloud.profiles.d/.<MINION_DEPLOYMENT_ID> .conf -l debug. You can confirm the information is accurate before proceding and confirm the "deploy" option is set to "True". 

More information about salt-cloud and the Saltify driver are available here: Saltify Driver for Salt-Cloud command