Debuging minion deployment by Aria Automation using salt-cloud
search cancel

Debuging minion deployment by Aria Automation using salt-cloud

book

Article ID: 380897

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

When deploying a template with cloud.saltstack component fails on deploy minion task. In VRA UI you might see the error similar to this one 

Resource [/resources/compute/2a315e4e-26ab-44c2-855c-8f8efbd7b5fc]:: SaltStack resource with job id [56eee591-e27c-41bd-995a-eeaebbd29c56] failed. Error:: 2024-10-29T10:31:04.538008: Minion deployment started. JID - 20241029103104507238 | 2024-10-29T10:35:49.473648: Minion deployment failed. JID - 20241029103104507238 | 2024-10-29T10:35:49.474096: Minion deployment and/or state file run failed. 

 

Environment

Aria Automation 8.X

Aria Automation Config Appliance 8.X

 

Resolution

When deploy.minion job fails on Aria Config and the minion machine is still available (up and reachable via network)  you can debug the minion deployment process using salt-cloud 

Steps for debuging deploy.minion job

1. Find the cloud.profile config for minion

SSH to the raas and find the "_profile" file in the /etc/salt/cloud.profiles.d/ directory 

example: ssc_gss-0611_profile.conf

ssc_gss-0613_profile:
  deploy: true
  minion:
    master:
    - raas817.vcloud.local
  password: Password1!
  priv_key: ''
  provider: ssc_saltify_provider
  pub_key: ''
  script_args: ' -x python3 stable 3005.5 '
  ssh_host: 192.168.110.101
  ssh_username: gss

 

2. Edit the profile file and set deploy to "true":

deploy: true 

3. Run command to deploy minion 

salt-cloud -p <profile-name> <minionID> -l debug 

where

profile-name - is the name of the profile file in  /etc/salt/cloud.profiles.d/ without ".conf" 

minionID - can be anything unique

Example run of salt-cloud: 

salt-cloud -p ssc_gss-0611_profile testA -l debug 

4. When you run this in console, you should see why the deployment fails.

Example of the log,  when salt-master cannot reach salt-mionion on port 22 (for linux) 

[DEBUG   ] Deploying 192.168.110.101 at 2024-10-30 11:49:28
[DEBUG   ] Attempting connection to host 192.168.110.101 on port 22
[DEBUG   ] Caught exception in wait_for_port: [Errno 113] No route to host

Example log when we salt-master can connect to the minion machine 

[DEBUG   ] SSH port 22 on 192.168.110.101 is available
[DEBUG   ] Using password authentication
[DEBUG   ] Attempting to authenticate as gss (try 1 of 15)
[DEBUG   ] SSH command: 'ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oControlPath=none -oConnectTimeout=15  -p 22 [email protected] date'
[DEBUG   ] Child Forked! PID: 17931  STDOUT_FD: 4  STDERR_FD: 6
[DEBUG   ] Terminal Command: s s h   - o S t r i c t H o s t K e y C h e c k i n g = n o   - o U s e r K n o w n H o s t s F i l e = / d e v / n u l l   - o C o n t r o l P a t h = n o n e   - o C o n n e c t T i m e o u t = 1 5     - p   2 2   g s s @ 1 9 2 . 1 6 8 . 1 1 0 . 1 0 1   d a t e
Warning: Permanently added '192.168.110.101' (ECDSA) to the list of known hosts.
[DEBUG   ] Warning: Permanently added '192.168.110.101' (ECDSA) to the list of known hosts.
[email protected]'s password: [DEBUG   ] [email protected]'s password:

Example error when minion fails to download the installtion files 

[DEBUG   ] Connection to 192.168.110.101 closed.
 * ERROR: https://repo.saltproject.io/py3/redhat/9/x86_64/archive/3005.5/SALTSTACK-GPG-KEY2.pub failed to download to /tmp/salt-gpg-aYm8DwCg.pub
 * ERROR: Failed to run install_centos_stable_deps()!!!
[DEBUG   ]  * ERROR: https://repo.saltproject.io/py3/redhat/9/x86_64/archive/3005.5/SALTSTACK-GPG-KEY2.pub failed to download to /tmp/salt-gpg-aYm8DwCg.pub
 * ERROR: Failed to run install_centos_stable_deps()!!!
Error: There was a profile error: Command 'ssh -t -t -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oControlPath=none -oConnectTimeout=15  -p 22 [email protected] 'sudo /tmp/.saltcloud-b9262717-6b3d-49b3-806c-9a6808b3f334/deploy.sh -c '"'"'/tmp/.saltcloud-b9262717-6b3d-49b3-806c-9a6808b3f334'"'"'  -x python3 stable 3005.5 '' failed. Exit code: 1
root@raas817 [ /etc/salt/cloud.profiles.d ]