Hitachi

For Linux(R) (x86) Systems HA Monitor Cluster Software


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

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.