Update Data Access Nodes in bulk

1 minute read

A few moons ago we had to update the data access nodes for thousands of NFS Share Subclients. Specifically, this was set at the client group level. Not wanting to do this manually I automated it. The XML is located here.

Also, for those that don’t already know, the data access nodes are the server with Commvault software installed to manage the backup of network filers via NAS method (not NDMP). For NFS this will be a Linux server or groups of servers.

The specific XML added to the template to make it work is below.

<backupConfiguration>
    <backupDataAccessNodes>
        <clientGroupName></clientGroupName>
    </backupDataAccessNodes>
</backupConfiguration>

To obtain this extra XML in the CommCell Console you can utilize Save as script functionality on the Subclient properties with data access nodes to get the XML. You can copy the XML to the template XML available in Commvault Books Online. It just needs to be in the right section. In this case it just needs to be within the <fsSubClientProp> section.

To automate one can loop through the qoperation command that executes the XML via a feeder file with one Subclient per line. See PowerShell code below.

#Usage ./ConfigureNFSDataAccessNodes.ps1 -filername MyFiler -subclientList H:\listOfSubclientToModify.txt -dan ClientGroupWithAccessNodes
#This script reassigns access nodes to the list of Subclients provided. This is for NAS NFS Subclients.

param ([String] $filerName, [String] $subclientList, [String] $dan)

$Subclients = Get-Content $subclientList

Foreach ($sc in $subclients) {
    $newdan = "`'$dan`'"
    qoperation execute -af C:\scripts\update_subclient_template.xml -clientName $filerName -backupsetName 'defaultBackupSet' -subclientName $sc -clientgroupname $newdan
}