I'm trying to provision Azure Windows VM using saltstack. The VM is provisioned successfully but when saltstack tries to install salt-minion it tries to connect to Windows VM using port 22 which doesn't work.
The default behavior of salt-cloud is after provisioning VM - it tries to install salt-minion on new VM. But for windows it tries to connect using port 22.
Any idea why and how to fix this?
salt-cloud -p azure-win2012 test6:
(This is the command to deploy a VM named test6
using profile azure-win2012
)
[DEBUG ] Closing IPCMessageClient instance
[DEBUG ] Deploying 20.20.20.20 at 2022-11-03 13:30:03
[DEBUG ] Attempting connection to host 20.20.20.20 on port 22
[DEBUG ] Caught exception in wait_for_port: timed out
[DEBUG ] Retrying connection to host 20.20.20.20 on port 22 (try 1)
[DEBUG ] Caught exception in wait_for_port: timed out
[DEBUG ] Retrying connection to host 20.20.20.20 on port 22 (try 2)
[DEBUG ] Caught exception in wait_for_port: timed out
[DEBUG ] Retrying connection to host 20.20.20.20 on port 22 (try 3)
[DEBUG ] Caught exception in wait_for_port: timed out
[DEBUG ] Retrying connection to host 20.20.20.20 on port 22 (try 4)
[DEBUG ] Caught exception in wait_for_port: timed out
[DEBUG ] Retrying connection to host 20.20.20.20 on port 22 (try 5)
[DEBUG ] Caught exception in wait_for_port: timed out
[DEBUG ] Retrying connection to host 20.20.20.20 on port 22 (try 6)
[DEBUG ] Caught exception in wait_for_port: timed out
[DEBUG ] Retrying connection to host 20.20.20.20 on port 22 (try 7)
[DEBUG ] Caught exception in wait_for_port: timed out
[DEBUG ] Retrying connection to host 20.20.20.20 on port 22 (try 8)
[DEBUG ] Caught exception in wait_for_port: timed out
[DEBUG ] Retrying connection to host 20.20.20.20 on port 22 (try 9)
azure_cloud_profile.conf:
azure-win2012:
provider: my-azure-config
image: MicrosoftWindowsServer|WindowsServer|2012-R2-Datacenter|latest
size: Standard_B1s
location: 'westeurope'
win_username: azureuser
win_password: 'Verybadpass@!#'
allocate_public_ip: True
cloud_provider_conf:
my-azure-config:
driver: azurearm
subscription_id: xxxxxxxxxxxxxxxxxxx
tenant: xxxxxxxxxxxxxxxxxx
client_id: XXXXXXXXXXXXXXXX
secret: 'XXXXXXXXXXXXXXXXXXX'
certificate_path: /etc/salt/azure.pem
resource_group: test-rg
network: test-vnet
subnet: default
username: azureuser
password: 'Verybadpass@!#'
location: 'westeurope'
# Set up the location of the salt master
#
minion:
master: x.x.x.x
# Optional
management_host: management.core.windows.net
Figured it out. I had to specify few more things in the profile like use_winrm and winrm_port etc.,
Here is the working cloud profile.
azure-win2019:
provider: my-azure-config
image: MicrosoftWindowsServer|WindowsServer|2019-datacenter-gensecond|latest
size: Standard_B2ms
location: 'westeurope'
win_username: azureuser
win_password: 'Verybadpass'
use_winrm: True
winrm_verify_ssl: False
winrm_port: 5986
smb_port: 445
win_installer: /srv/salt/win/files/Salt-Minion-3004.2-1-Py3-AMD64-Setup.exe
userdata_file: https://raw.githubusercontent.com/xxxxxxxx/Windows_Firewall.ps1
userdata_template: False
allocate_public_ip: True
security_group: saltstack-nsg