Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Set up intermediary services using scripting
Update firmware versions for DataPower appliances using scripting
Use wsadmin.sh to update firmware for appliances within a managed set. Firmware version files from the manufacturer are specific to device types, model types, and libraries for features.
Before you begin, set up the DataPower appliance manager by adding and configuring appliances and managed sets.
This topic provides an example for updating the firmware for multiple appliances that the DataPower appliance manager administers within a managed set. The appliances of interest are members of the testSet managed set. When updating the firmware on a managed set that manages multiple appliances, the system deploys the firmware version to the master appliance and then sequentially to each appliance in the managed set.
To view additional information and examples for the commands in this topic, refer to the documentation for the dpManagerCommands command group .
Procedure
- Start wsadmin.sh.
- Determine the IDs of the managed sets.
Use the dpGetAllManagedSetIDs command to display the IDs of each managed set in the DataPower appliance manager configuration, as the following command demonstrates:
AdminTask.dpGetAllManagedSetIds()You can optionally use the dpGetManagedSet command to display attributes for a given specific managed set ID:
AdminTask.dpGetManagedSet('-managedSetId testSet')- Determine the firmware version to deploy to each managed set.
We can use the DataPower appliance manager to deploy a new firmware version in the configuration or to revert to a previous firmware version that exist in the configuration.
- To deploy a new firmware versions in the configuration, download the desired firmware versions from the DataPower website. You do not need to download new firmware versions if you are reverting to a previous firmware version that exists in the configuration. After downloading the new firmware versions, use the dpAddFirmwareVersion command to add the local firmware version to the DataPower appliance manager. The firmware version is associated with a specific firmware, which acts as a container for each firmware version that has the same appliance type, model type, and compatible features. The following command example adds a firmware version to the DataPower appliance manager:
addFirmwareTask=AdminTask.dpAddFirmwareVersion('[-file "C:\temp\dptestFW\dev-xs-143863-3_6_0_16.scrypt2" -userComment "my new firmware for test"]')The command submits the tasks to the DataPower appliance manager and sets the task IDs to the corresponding variables. Use the following example commands to monitor the status of the tasks:
param = '-taskId '+addFirmwareTask print AdminTask.dpGetTask(param)The command returns the task information and the firmware version ID as the value of the result attribute, as shown in the following sample output:[ [currentStep 0] [totalSteps 0] [taskDescription [Add new firmware version to the DataPower appliance manager]] [currentStepTimestamp [Jan 18, 2008 2:32:25 PM]] [creationDate [Jan 18, 2008 2:32:23 PM]] [taskStatus 2] [taskId 1] [hasError false] [createdByUser defaultWIMFileBasedRealm/admin] [isComplete true] [result [XS40:9002::DataGlue;JAXP-API;PKCS7-SMIME;HSM;:3.6.0.15]] ]You can use the dpGetAllFirmwareIds command to display the ID of each available firmware. Then, use the dpGetAllFirmwareVersionIDs command to get the IDs of each available firmware version of the firmware of interest. When you find the ID of the firmware version to use, set the value of the result attribute to a variable to use in the command that deploys the firmware version to the managed set:
testFirmwareVersionID = 'XS40:9002::DataGlue;JAXP-API;PKCS7-SMIME;HSM;:3.6.0.15'
- To deploy an existing firmware version to the managed set, use the following commands to determine the firmware versions of interest:
- Use the dpGetAllFirmwareVersionIds command to display the version IDs for each firmware version of a specific firmware, as the following example demonstrates:
AdminTask.dpGetAllFirmwareVersionIds('-firmwareId "XS40:9002::DataGlue;JAXP-API;PKCS7-SMIME;HSM;"')- For this example, the following two firmware versions exist:
XS40:9002::DataGlue;JAXP-API;PKCS7-SMIME;HSM;:3.6.0.15 XS40:9002::DataGlue;JAXP-API;PKCS7-SMIME;HSM;:3.6.0.16- We can optionally use the dpGetFirmware command to display the appliance type, model type, strict features, and non-strict features for the firmware, as the following example demonstrates:
AdminTask.dpGetFirmware('-firmwareId "XS40:9002::DataGlue;JAXP-API;PKCS7-SMIME;HSM;"')
- If you are unsure of which firmware to use, you can use the dpGetBestFirmware command to query for the firmware that matches your appliance type, model type, and appliance features. The command does not recommend a specific firmware. The command determines the firmware that matches the configuration. In the following example, the command queries for a firmware that contains the 3.6.0.4 firmware version:
AdminTask.dpGetBestFirmware('-applianceType "XS40" -modelType "9002" -applianceFeatures "JAXP-API" -level "3.6.0.4"')
- Verify that the system added the new firmware version to the DataPower appliance manager.
Use the getTask command to determine if the task is complete:
AdminTask.dpGetTask('-taskId '+addFirmwareTask)The command returns information about the asynchronous task of interest. The isComplete attribute displays a value of true if the task is complete. If it is not complete, note the value for the taskStatus attribute. If the returned value is 0, then the task is in a queue and the system has not started the task. If the returned value is 1, then the task is in progress. If the returned value is 2, then the task completed successfully. If the returned value is 3, then the task experienced an exception.
- Deploy the firmware version
After the system adds the firmware version to the DataPower appliance manager, use the dpSetManagedSet command to assign the firmware version to the managed set. The following example assigns the newly downloaded firmware version to the test environment managed set:
FVTask=AdminTask.dpSetManagedSet('-managedSetId testSet -desiredFirmwareVersionId '+testFirmwareVersionID)The command submits the tasks to the DataPower appliance manager and assigns the task identifiers to the corresponding variables. Deploying a firmware can take several minutes and will result in the appliance being restarted to run the new firmware version.
- Verify that the system successfully assigned the new firmware versions to the managed sets.
Use the getTask command to determine if the task is complete:
AdminTask.dpGetTask('-taskId '+FVTask)The command returns information about the asynchronous task of interest. The isComplete attribute displays a value of true if the task is complete. If it is not complete, note the value for the taskStatus attribute. If the returned value is 0, then the task is in a queue and the system has not started the task. If the returned value is 1, then the task is in progress. If the returned value is 2, then the task completed successfully. If the returned value is 3, then the task experienced an exception.
- Optional: Remove the firmware version that the system replaced from the DataPower appliance manager.
If you do not want to keep a copy of the previous firmware version on the DataPower appliance manager, remove the firmware version from the configuration. You might want to keep the previous two firmware versions in case revert to the previous version.
Use the dpRemoveFirmwareVersion command to remove the firmware version that the managed set no longer uses. We can not remove firmware versions that are assigned to managed sets. The following example removes the firmware version from the DataPower appliance manager:
AdminTask.dpRemoveFirmwareVersion('-firmwareVersionId "XS40:9002::DataGlue;JAXP-API;PKCS7-SMIME;HSM;:3.6.0.13"')
Results
The managed set uses the new firmware version.
What to do next
We can use wsadmin.sh to manage appliances, firmware, domains, managed sets, and appliance-specific settings. Additionally, the system creates versions of domains, firmware, and appliance-specific settings. We can use wsadmin.sh to modify the current version, or to revert to previous versions of domains, firmware, and appliance-specific settings.
WebSphere DataPower appliance manager overview
Administer managed domains, firmware, and settings versions using scripting
Set up the DataPower appliance manager using scripting
Copy DataPower appliance domains between managed sets using scripting
Add new firmware versions to the DataPower appliance manager
Related
dpManagerCommands command group