I just added some PowerShell code that upgrades VMstores in parallel to our GitHub site. A JSON configuration file is used to configure the VMstores. For example:
The only required attribute is the VmstoreDnsName. All the other attributes are optional and can be from the command line. Here is a JSON configuration with only the VMstore names:
The following code can uses the above file.
Import-Module -Name .\VmstoreUpgrade.psm1
Import-Module -Name .\Parallel-Upgrade.psm1
# Set the user, VMstore configuration file, and upgrade file.
$user = "admin"
$vmstore_list_file = ".\vmstore_upgrade_list.json"
$upgradeFile = "C:\tmp\txos-184.108.40.206-8520.45801.20652.x86_64.rpm"
# Do the parallel upgrade.
Write-Host "Parallel updating VMstores with $upgradeFile"
# Get credentials that will work for all VMstores.
$cred = Get-Credential -Username $Username -Message "Enter valid password for all servers"
$pass = $cred.GetNetworkCredential().Password
# Start the parallel upgrade using a JSON file containing the VMstores, and
# the same username and password for all VMstores.
Parallel-Upgrade -Verbose -UserName $user -UseSameUserName -Password $pass -UseSamePassword -UpgradeFile $upgradeFile -UseSameUpgradeFile -UseJsonFile $vmstore_list_file
Write-Host "Done Updating"
The above code gets a credential that is valid for all VMstores in the configuration file. Then the command line specifies the user name, password, and two options,
Parallel-Upgrade logs to a dated log file: YYYY-MM-dd-HH-mm-ss_parallel_upgrade.log. The Verbose option will produce extra verbiage to follow along in the process and assist in debugging problems. Unfortunately, you have to read the Parallel-Upgrade.psm1 module for help.
Until next time,
– Rick –