modifyappgroupviafile

Use the modifyappgroupviafile command to modify an existing application by using an input file. You can add and remove members by specifying the member type and identifiers or by using a member type with a -tagkey and -tagvalue pair.

You can specify -tagkey and -tagvalue pairs, for a given resource type, in the following ways:
  • To select resources that match all of the specified tags, the -tagkey and -tagvalue parameters must be specified in this format:
    -tagkey udp1 udp2 -tagvalue value1 value2
    For example, to select the resources that have udp1 set to US and udp2 set to West specify:
    -tagkey udp1 udp2 -tagvalue US West
  • To select resources that match at least one of the specified tags, the -tagkey and -tagvalue parameters must be specified in this format:
    -tagkey udp1 -tagvalue value1 -tagkey udp2 -tagvalue value2
    For example, to select resources that have udp1 set to US or udp2 set to West specify:
    -tagkey udp1 -tagvalue US -tagkey udp2 -tagvalue West

Syntax

Read syntax diagramSkip visual syntax diagramtpctoolmodifyappgroupviafile-user user_name -pwd password -url url -inputfileinputfilename

Parameters and arguments

-user user_name
Specifies an IBM Spectrum Control user ID.
-pwd password
Specifies the password for the IBM Spectrum Control user ID.
-url url
Specifies the Device server. The format of the URL is system:port_number, where system represents either the host name or IP address, and port_number represents the IBM Spectrum Control Device server port.
-inputfile inputfilename
Indicates the name of the input file, which contains information about the members that need to be added to or removed from applications.
All the other parameters are specified directly in the input file. The input file specifies the application where the members are added or removed by using the -add or -remove parameters:
-id <ApplicationGroupID> -add 
-id <ApplicationGroupID> -remove 
Then, the input file specifies the type and identifiers of the members for the application.
The -memberid parameter can be separated by spaces or commas. For example:
-memberid /Application/5044 /Application/5045
-memberid /Application/5044,/Application/5045
If a -name parameter contains spaces or commas, it must be marked in quotations by using the double quotation character. For example:
-name "datastore1 (5)"
-id ApplicationGroupID
Indicates the unique ID of the application where the member is added or removed. Use the lsappgroup command, to view a list of the applications.
-type appgroup
Specifies that the entities are applications. The -memberid parameter specifies the unique IDs of the applications to be added or removed from the application, which is specified by the -id parameter. For example:
-type appgroup -memberid <appgroupname1>, <appgroupname2>,<appgroupname3>....
When you are using the -tagkey and -tagvalue member pair:
-type appgroup -tagkey <tag_key> -tagvalue <tag_value>
-type server
Specifies that the entities are servers or hypervisors. The -name parameter specifies the host names of the servers or hypervisors. For example:
-type server -name <hostname1>, <hostname2> ....
-type datastore
Specifies that the entities are data stores. The -servername parameter specifies the name of the hypervisor the data store belongs to and the -name parameter specifies the names of the data stores. For example:
-type datastore -servername <hostname> -name <datastore1>  <datastore2> ....
-type export
Specifies that the entities are exports. The identifiers of the entities have different formats, which depend on whether the export members belong to servers or to IBM® Storwize® V7000 Unified cluster or IBM Storage Scale cluster. For example:
-type export -servername <hostname> -name <export1>, <export2> ..
-type export -devicename <displaynameofdevice> -clustername <hostnameofcluster>
-name <export1>, <export2> 
-type filesystem
Specifies that the entities are file systems. The -servername parameter specifies the name of the server that the file system belongs to and the -name parameter specifies the names of the file system. For example:
-type filesystem -servername <hostname> -name <filesystem1>, <filesystem2> ..
When you are using the -tagkey and -tagvalue member pair:
-type filesystem -tagkey <tag_key> -tagvalue <tag_value>
-type fileset
Specifies that the entities are filesets of the file systems. The -devicename parameter specifies the IBM Storwize V7000 Unified or IBM Storage Scale storage system that the fileset belongs to. The -clustername parameter specifies the IBM Storwize V7000 Unified or IBM Storage Scale cluster the fileset belongs to. The -filesystemname parameter specifies the IBM Storwize V7000 Unified or IBM Storage Scale file system the fileset belongs to. For example:
-type fileset -devicename <displaynameofdevice>
-clustername <hostnameofcluster> -filesystemname <filesystem1> 
-name <fileset1>, <fileset2>
-type vm
Specifies that the entities are virtual machines that were discovered by the hypervisor probe. The -servername parameter specifies the host name of the hypervisor that the virtual machine belongs to and the -name parameter specifies the names of the virtual machine. For example:
-type vm -servername <hostname> -name <vm1>, <vm2>,..
-type volume
Specifies that the entities are storage volumes. The entities identifiers specify the display name of the storage system by using the -devicename parameter, and the display names of the storage volumes by using the-name parameter. For example:
-type volume -devicename <displaynameofdevice> -name <vol1>, <vol2>,..
-type volumegroup
Specifies that the entities are the volume groups of the server. The entities identifiers specify the host name of the server and the names of the volume groups. For example:
-type volumegroup -servername <hostname> -name <vg1>, <vg2>,...
-tagkey udp1 or udp2 or udp3
Specifies the tagkey that is used to create application members with an input file.
Only the following -type parameters can be defined with tags:
  • server
  • filesystem
  • appgroup
-tagvalue tagvalue
Specifies the tagvalue that is used to create application members with an input file.

Example: Modifying members by using an input file

You can modify the members according to the contents of the input file with the following command:
tpctool
tpctool> modifyappgroupviafile -inputfile testModifyAppGroup04.txt
tpctool>

If the command successfully completes, no message is displayed.

If some members are not found in the IBM Spectrum Control database, a warning message is displayed:

tpctool> modifyappgroupviafile -inputfile testModifyAppGroup05.txt
HWNDA0048W The following entities were not found: System1.storage.abc.ibm.com:
vm01,vm02,..
tpctool>

In this example, the vm01 and vm02 virtual machines of the System1.storage.abc.ibm.com hypervisor were not found in IBM Spectrum Control database.

Example: Adding and removing members from an application by using an input file

If you want to add and remove members from the application, /Application/7599105, specify two -id stanzas, one with the -add parameter and the other with the -remove parameter, followed by any other parameters. For example:

-id /Application/7599105 -add
		-type appgroup -memberid  /Application/7605938
                -type export -servername server1 -name export1, export2, export3
                -type export -servername server2 -name export1, export2, export3
                -type export -servername server3 -name export1, export2, export3
                -type volumegroup -servername server2 -name vg1, vg2
 -id /Application/7599105 -remove
		-type appgroup -memberid  /Application/7605939
                -type export -servername server1 -name export4, export5, export6
                -type volumegroup -servername server2 -name vg3

Example: Adding and removing members from multiple applications by using an input file

To include more than one application, use multiple -id stanzas followed by other parameters. The same parameter can be used again for each -id stanza. For example:

-id /Application/7599105 -add
	       -type appgroup -memberid  /Application/7605938
               -type export -servername server1 -name export1, export2, export3
               -type volumegroup -servername server2 -name vg1, vg2
-id /Application/7599105 -remove
               -type export -servername server1 -name export4, export5, export6
               -type volumegroup -servername server2 -name vg3
-id /Application/7599106 -add
               -type vm -servername server1 -name vm1, vm2, vm3
               -type server -name server1, server2, server3

Example: Adding and removing members from an application by using an input file with tags

The following example adds application members that are specified by the -tagkey and -tagvalue parameter pairs. For example:
-id /Application/7599105 -add
	-type appgroup -tagkey udp1 -tagvalue TPCAppGroup
	-type server -tagkey udp1 -tagvalue Department1Servers
	-type filesystem -tagkey udp1 -tagvalue JFS