How to correctly upgrade Windows minions from 3005.1 to 3007.1

34 views
Skip to first unread message

P Khare

unread,
Jun 11, 2024, 5:17:31 PMJun 11
to Salt-users

Hi all,

We are running this command to upgrade a Windows minion from 3005.1 to 3007.1

# salt xyz.abc.com pkg.install salt-minion-py3 version=3007.1

xyz.abc.com:
    ----------
    salt-minion-py3:
        ----------
        install status:
            task started

After the task finishes, pkg.version shows the new version 3007.1 as expected
# salt xyz.abc.com pkg.version salt-minion-py3
xyz.abc.com:
    3007.1

But test.version shows the old version - 3005.1
# salt xyz.abc.com test.version
xyz.abc.com:
    3005.1

What is the best way to upgrade a Windows minion from 3005.1 to 3007.1?

Thanks,

Khare

James Pearson

unread,
Jun 12, 2024, 6:42:48 AMJun 12
to salt-...@googlegroups.com
I don't use Salt on Windows, but maybe you need to also restart the
salt-minion service to pick up the new version?

i.e:

# salt xyz.abc.com service.restart salt-minion

Running that command will probably error out (as the salt-minion
service disappears before it can return the result ...) - but should
restart the service ?

James Pearson

Rodrigo Moutinho (rcmoutinho)

unread,
Jun 13, 2024, 7:16:26 AMJun 13
to Salt-users
Hello!

My understanding is that the pkg module on Windows would default to Windows Package Manager (https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.pkg.html). So you would need to make sure this name is available on the versions you need.

When handling salt upgrades, I always rely on their bootstrap project: https://github.com/saltstack/salt-bootstrap
A section explains a PS1 approach (search for Install on Windows).

---
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls12'
Invoke-WebRequest -Uri https://winbootstrap.saltproject.io -OutFile "$env:TEMP\bootstrap-salt.ps1"
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
& "$env:TEMP\bootstrap-salt.ps1"
---

As mentioned there, you can get extra details about all the script parameters:
---
Get-Help $env:TEMP\bootstrap-salt.ps1 -Detailed
---

You can also use the EXE or MSI directly which will override the same way as PS1 the current version with the one you want.

And if you want an approach that will do the work for non-existing targets or update existing nodes, you can look deeper into the salt-cloud saltify approach: https://docs.saltproject.io/en/latest/topics/cloud/saltify.html
This last one will help you to configure the target from the master only based on the credentials you have (profiles).

Hope all this info helps you on the update journey.
Cheers!

PS: I don't know if you started with version 3005 or if it's a previous upgrade. Regardless of the case, please make sure you know about the differences between classic and onedir (considering that 3005 was still available on both classic and onedir packages). Check their upgrade for more info, https://docs.saltproject.io/salt/install-guide/en/latest/topics/upgrade-to-onedir.html

P Khare

unread,
Jun 18, 2024, 5:33:03 PM (11 days ago) Jun 18
to Salt-users
Thank you both. The 3005.1 version is the version VMware Tools has. So we initially install that version using VMware Tools. Then we upgrade to 3007.1. I have restarted the minion many times.

I will look into what rcm mentioned. We want to install the minion without having to enter admin credentials, which is what VMware Tools allows us to do.

BTW, on the minion, "salt-call test.version" returns 3007.1, but test.version from the master returns 3005.1.

Thanks,
Khare
Reply all
Reply to author
Forward
0 new messages