9.9 mondevice (changes shared resources while the active server is running)
Format
- Adding a shared resource:
-
mondevice server-alias-name -a device-type resource-name
- Deleting a shared resource:
-
mondevice server-alias-name -d device-type resource-name
- Changing a shared resource:
-
mondevice server-alias-name -c device-type resource-name change-type attribute
- Executing the command interactively:
-
mondevice -Q
Users who can execute the command
Superuser
Description
The mondevice command adds and deletes shared resources while the active server is running. It also changes the attributes of shared resources. This command can also be used to change server environment definitions automatically.
Options
- Adding a shared resource:
-
-
server-alias-name
Specifies the alias name of the server for which a shared resource is to be added.
-
-a
Specifies that a shared resource is to be added.
-
device-type
Specifies the type of the shared resource that is to be added.
-
disk: Adds a shared disk.
-
resource-name
Specifies the name of the shared resource on the local host that is to be added.
-
- Deleting a shared resource:
-
-
server-alias-name
Specifies the alias name of the server for which a shared resources is to be deleted.
-
-d
Specifies that a shared resource is to be deleted.
-
device-type
Specifies the type of the shared resource that is to be deleted.
-
disk: Deletes a shared disk.
-
resource-name
Specifies the name of the shared resource on the local host that is to be deleted.
-
- Changing a shared resource:
-
-
server-alias-name
Specifies the alias name of the server for which a shared resource is to be changed.
-
-c
Specifies that an attribute of a shared resource is to be changed.
-
device-type
Specifies the type of the shared resource that is to be changed.
-
disk: Changes a shared disk.
-
resource-name
Specifies the name of that shared resource on the local host that is to be changed.
-
change-type
Specifies the type of change, as listed below, that is to be made to the shared resource on the local host. This option is applicable only when the -c option is specified. When you specify this option, you must specify the new attribute option following this option.
-
vg_neck
Changes the setting of whether server startup processing is to be cancelled when placement of a volume group online has failed. This option corresponds to the vg_neck operand in the server environment definition.
-
vg_on_opt
Changes the command run-time option for placing a volume group online. This option corresponds to the vg_on_opt operand in the server environment definition.
-
attribute
Specifies the new attribute for the shared resource on the local host that is to be changed. You specify this option only when you have specified the -c option.
If the change-type option is vg_neck:
use: Cancels server startup processing when placement online of a disk resource has failed.
nouse: Continues processing without canceling the server startup processing when placement online of a disk resource has failed.
If the change-type option is vg_on_opt:
Specifies the new command run-time options that will be applied when a disk resource is placed online. To change the existing option(s) to no option, specify two consecutive double quotation marks ("") as the attribute. To change the existing option(s) to the default, specify a comma (,). To specify multiple options, enclose the entire attribute in double quotation marks (").
-
- Executing the command interactively:
-
-
-Q
Executes the mondevice command interactively.
-
Return codes
Value |
Meaning |
---|---|
0 |
Normal termination (the shared resource has been changed while the active server was running) |
Other than 0 |
Abnormal termination |
Notes
-
You can execute the mondevice command after the active and standby servers have both completed their startup processing or after only the active server has completed its startup processing. If you execute the command after only the active server has completed its startup processing (before the standby server completes its startup processing), the server environment definition on the standby server will not be changed automatically. In this case, you must terminate the standby server, change its environment definition so that it matches that of the active server, and then restart the standby server.
-
The original (pre-change) server environment definition is saved in the servers.bac file.
-
If the server environment definition is invalid during command execution, the definition file will not be updated. In this case, you must use a program such as a text editor to edit the file.
-
The mondevice command cannot be used to add or delete LANs. To add and delete LANs:
-
Adding a LAN
Connect the desired LAN in the active system to the network, and then add information about the connected LAN to the LAN status settings files on both hosts.
-
Deleting a LAN
Disconnect the desired LAN in the active system from the network, and then delete the information about the disconnected LAN from the LAN status settings files on both hosts.
-
-
The return code is also set to 0 when any of the following messages is issued while type2 is specified in the exitcode operand in the HA Monitor environment settings:
KAMN320-E, KAMN322-E, KAMN451-E, KAMN452-E, KAMN453-E, KAMN454-E, KAMN455-E, KAMN456-E, KAMN460-E, KAMN465-E
Examples
- Adding a shared resource:
-
In the server environment definition, a shared resource is added by applying the xxx_add operand, where xxx indicates the device type of the added resource.
The following example shows the contents of the server environment definition when mondevice server1 -a disk /dev/vg01 has been executed:
/* server environment definition */ server name /users/server1, alias server1, : : : : disk_add /dev/vg01;
- Deleting a shared resource:
-
In the server environment definition, a shared resource is deleted by applying the xxx_del operand, where xxx indicates the device type of the deleted resource.
The following example shows the contents of the server environment definition when mondevice server1 -d disk /dev/vg01 has been executed:
/* server environment definition */ server name /users/server1, alias server1, : : : : disk_del /dev/vg01;
- Adding and deleting shared resources:
-
Shared resources added by applying the xxx_add operand and deleted by applying the xxx_del operand are added and deleted automatically the next time the server is started. However, the user must correct the server environment definition when needed.
The following shows an example of the server environment definition when one disk has been deleted and another disk has been added:
- Before change:
-
disk /dev/vg:/dev/vg2, disk_add /dev/vg3, disk_del /dev/vg2;
- After change:
-
disk /dev/vg:/dev/vg3;
- Changing a shared resource:
-
In the server environment definition, an attribute of a shared resource is changed by applying the xxx_chg operand, where xxx indicates the device type of the resource whose attribute is being changed.
The following example shows the contents of the server environment definition when mondevice server1 -c disk /dev/vg01 vg_neck use has been executed:
/* server environment definition */ server name /users/server1, alias server1, : : : : disk /dev/vg01, disk_chg /dev/vg01:vg_neck:use;
- Adding, changing, and deleting shared resources:
-
Shared resources added by applying the xxx_add operand, deleted by applying the xxx_del operand, and whose attribute values were changed by applying the xxx_chg operand are added, deleted, and changed automatically the next time the server is started. However, the user must correct the server environment definition when needed.
The following example shows the contents of the server environment definition when /dev/vg04 is added to the disk operand, the vg_neck operand value for /dev/vg03 is changed to use, and /dev/vg01 is deleted:
- Before change:
-
disk /dev/vg01:/dev/vg02:/dev/vg03, vg_neck use:nouse:nouse, disk_add /dev/vg04, disk_chg /dev/vg03:vg_neck:use, disk_del /dev/vg01;
- After change:
-
disk /dev/vg02:/dev/vg03:/dev/vg04, vg_neck nouse:use:nouse;
If you change the disk operand value, you must also change the operand value specified in change-type at the same time.
- Executing the command interactively:
-
You can execute the command interactively by specifying the -Q option. If you want to cancel execution of the command for a reason such as a specification error, press the C key while holding down the Ctrl key (CTRL+C). The following example adds disk for the server whose server alias name is server1:
> mondevice -Q This command changes a resource. If processing is stopped, Input the [CTRL]+[C]. Q. Input alias that is processed. > [alias]: > server1 Q. Select the processing that is executed by number. (1)Addition of a device (2)Deletion of a device (3)Change attribute of a device > [Addition(1) /Deletion(2) /Change(3) ]: > 1 Q. Select the kind of a device by number: (1) disk (Shared disk unit) > [Device kind]: > 1 Q. Input the device is added, is deleted or is changed. > [Device name]: > /dev/vg01 Edited command is.: mondevice server1 -a disk /dev/vg01 Q. Is a command executed ? If a command is executed, input the [ENTER]. > A command is executed.
- Legend:
-
>: Indicates a user operation.