[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]
Commands Reference, Volume 3
mkrsrc Command
Purpose
Defines
a new resource.
Syntax
To define a new resource using data that is entered on the command line:
mkrsrc [-v] [-h] [-TV] resource_class prop=value...
To define a new resource using data that is predefined in an input file:
mkrsrc -f resource_data_input_file [-v] [-h] [-TV] resource_class
To see examples of the mksrc command for a resource class:
mkrsrc -e [-h] [-TV] resource_class
Description
The mkrsrc command requests that the RMC subsystem define a new
resource instance for the class specified by the resource_class parameter.
At least one persistent property name and its value must be specified either as a parameter
or by a resource definition file using the -f flag.
Before you run mkrsrc, you should run the lsrsrcdef command
to determine which properties are designated as "required for define" or "optional for
define". Only properties that are designated as "required for define" or "optional for define"
can be defined using the mkrsrc command. The lsrsrcdef command
also identifies the data type for each property. The value specified for each property must match this data type.
Flags
- -e
- Displays two examples of suitable command line input for this command:
- An example of mkrsrc command line input for required properties only.
- An example of mkrsrc command line input for both required and
optional properties.
- -f resource_data_input_file
- Specifies the name of the file that contains resource property information.
- -v
- Verifies that the input file or the command line is valid. For example,
it will make sure all of the property names specified are defined as persistent properties and are designated as "required
for define" or "optional for define".
- -h
- Writes the command's usage statement to standard output.
- -T
- Writes the command's trace messages to standard error. For your software
service organization's use only.
- -V
- Writes the command's verbose messages to standard output.
Parameters
- resource_class
- Specifies the resource class name of the resource to be defined.
- prop=value...
- Specifies the properties of the resource being defined. When defining a new resource
instance, there are specific required properties for each resource that must be defined. These properties can be specified
as parameters on the command line or defined in an input file by using the -f flag.
- prop
- The name of a persistent property for this resource. This property must be designated as "required for define"
or "optional for define". Use the lsrsrcdef command to check the
designation.
- value
- The value for this persistent property. The data type for this value must match the defined data
type for the value of this property. Use the lsrsrcdef command to verify the data type
for each property.
Security
The user needs write permission for the resource_class specified
in mkrsrc to run mkrsrc. Permissions are specified in the
access control list (ACL) file on the contacted system. See the RSCT Guide and Reference for information about the ACL file and
how to modify it.
Exit Status
- 0
- Command has run successfully.
- 1
- Error occurred with RMC.
- 2
- Error occurred with CLI script.
- 3
- Incorrect flag on command line.
- 4
- Incorrect parameter on command line.
- 5
- Error occurred with RMC that was based on faulty command line input.
Environment Variables
- CT_CONTACT
- When the CT_CONTACT environment variable is set to a host name or IP
address, the command contacts the Resource Monitoring and Control (RMC) daemon
on the specified host. If the environment variable is not set, the command
contacts the RMC daemon on the local system where the command is being run.
The resource class or resources that are displayed or modified by the command
are located on the system to which the connection is established.
- CT_MANAGEMENT_SCOPE
- Determines the management scope that is used for the session with the
RMC daemon to monitor and control the resources and resource classes. The
management scope determines the set of possible target nodes where the resources
and resource classes can be monitored and controlled. The valid values are:
- 0
- Specifies local scope.
- 1
- Specifies local scope.
- 2
- Specifies peer domain scope.
- 3
- Specifies management domain scope.
If this environment variable is not set,
local scope is used.
Standard Output
When the -h flag is specified, this command's usage statement is written to standard
output.
The command output and all verbose messages are written to standard output.
Standard Error
All trace messages are written to standard error.
Examples
- To create a new resource in the IBM.Host class, assuming you
already know which persistent properties are required when defining a resource of this class, enter:
mkrsrc IBM.Host Name=c175n05
- To create a new resource in the IBM.Processor class by first
generating a template to aid in the defining of these resources, enter:
lsrsrcdef -i IBM.Processor > /tmp/IBM.Processor.rdef
Then, edit
the file /tmp/IBM.Processor.rdef and enter values for all of the properties, substituting
the type for an appropriate value, or leaving it blank for the default value.
Finally, enter:
mkrsrc -f /tmp/IBM.Processor.rdef IBM.Processor
- To create two new IBM.Host resources using the information defined in
file /tmp/IBM.Host.rdef, enter:
mkrsrc -f /tmp/IBM.Host.rdef IBM.Host
where the file /tmp/IBM.Host.rdef looks like this:
PersistentResourceAttributes::
resource 1:
Name = c175n04
resource 2:
Name = c175n05
- This example creates a new resource in the IBM.Foo class. In this class, Name and NodeList are required properties. The Binary, SD, StringArray, and
SDArray properties
are optional. This example shows how to enter the more difficult data types
from the command line. The data types for the optional Binary, SD, StringArray,
and SDArray properties are self-explanatory. Enter:
mkrsrc IBM.Foo Name=c175n05 \
NodeList={1} \
Binary="0xaabbccddeeff00" \
SD='[testing123,1,{2,4,6}]' \
StringArray='{"testing 1 2 3",testing123,"testing 1 2 3"}' \
SDArray='{["testing 1 2 3",1,{1,3,5}],[testing,2,{2,4,6}]}'
Note
As discussed in the rmccli general information file, property values for certain data types
(structured data, array of structured data, and arrays containing strings
enclosed in double quotation marks) should be enclosed in single quotation
marks.
Location
- /usr/sbin/rsct/bin/mkrsrc
- Contains the mkrsrc command
Related Information
Commands: lsrsrc, lsrsrcdef, mkrsrc
Files: Resource_Data_Input, rmccli
Books: see the RSCT Guide and Reference for information about RMC operations
[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]