This section describes how to create the definition file and build the cluster application for network takeover.
For network takeover, create the following definition file on all nodes controlling the network devices of Azure.
/usr/opt/reliant/etc/hvazureconfig
Information
When you create the /usr/opt/reliant/etc/hvazureconfig file, you can use the /usr/opt/reliant/etc/hvazureconfig.template file as a template.
# cp -p /usr/opt/reliant/etc/hvazureconfig.template /usr/opt/reliant/etc/hvazureconfig
Note
Create the hvazureconfig file with a root user and change the permission to 600.
To update the routes of the virtual router, the ID information of the device managed by Azure is required.
Check the ID information of Azure described in the definition file (/usr/opt/reliant/etc/hvazureconfig) from the Azure portal.
Information in the definition file
KeyName Mode CFNameX ResourceID RouteTableID TakeoverIPAddress VirtualMachineIPAddress AppID TenantID CertPath
Item | Contents | Remarks |
---|---|---|
KeyName | Describe the ID up to 16 letters and numbers. KeyName is case-sensitive. This key name is defined in each script that is registered when setting the Cmdline resource. Specify the same KeyName for the paired operational system and standby system and define a KeyName for other systems to avoid duplicate names. This key name is specified as an argument to register a script when setting Cmdline resources explained later. | - |
Mode | Specify the string of ROUTE or route. | - |
CFNameX | Specify the CF node name. | - |
ResourceID | Specify the virtual machine ID of Azure on which the cluster host is running. | Check it in the Azure portal |
RouteTableID | Specify the route table ID. | Check it in the Azure portal |
TakeoverIPAddress | Takeover IP address (Specify the IPv4 address in the VNet. The specified IP address should not be automatically allocated for any other use.) | - |
VirtualMachineIPAddress | Virtual machine IP address (Specify by IPv4 address.) | Check it in the Azure portal |
AppID | Specify the application ID of the service principal. | The value recorded in step 3 of "27.3 Presetting" |
TenantID | Specify the tenant ID of the service principal. | The value recorded in step 3 of "27.3 Presetting" |
CertPath | Specify the path of the service principal certificate. | The value recorded in step 3 of "27.3 Presetting" |
Example
On each node, enter information on the operational system and the standby system in the created /usr/opt/reliant/etc/hvazureconfig file.
When each item of node1 and node2 is as follows
KeyName | CFNameX | ResourceID | RouteTableID |
---|---|---|---|
CmdR01 | node1 | /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Compute/virtualMachines/node1 | /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Network/routeTables/routetable1 |
node2 | /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Compute/virtualMachines/node2 |
The following is an example for controlling one takeover IP address (172.30.2.10).
CFNameX | TakeoverIPAddress | VirtualMachineIPAddress | AppID | TenantID | CertPath |
---|---|---|---|---|---|
node1 | 172.30.2.10 | 172.30.0.10 | d5b7dac1-718f-448b-8e11-4a8cca6d9004 | 8ff7ddfd-fbcb-4700-ae52-6d071ac8d1b4 | /root/examplecert.pem |
node2 | 172.30.1.10 |
CmdR01 ROUTE node1 /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Compute/virtualMachines/node1 /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Network/routeTables/routetable1 172.30.2.10 172.30.0.10 d5b7dac1-718f-448b-8e11-4a8cca6d9004 8ff7ddfd-fbcb-4700-ae52-6d071ac8d1b4 /root/examplecert.pem CmdR01 ROUTE node2 /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Compute/virtualMachines/node2 /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Network/routeTables/routetable1 172.30.2.10 172.30.1.10 d5b7dac1-718f-448b-8e11-4a8cca6d9004 8ff7ddfd-fbcb-4700-ae52-6d071ac8d1b4 /root/examplecert.pem
For multiple controls such as mutual standby configuration, separate KeyNames and add the same contents.
When each item for node1 and node2 of each KeyName is as follows
KeyName | CFNameX | ResourceID | RouteTableID |
---|---|---|---|
CmdR01 | node1 | /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Compute/virtualMachines/node1 | /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Network/routeTables/routetable1 |
node2 | /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Compute/virtualMachines/node2 | ||
CmdR02 | node1 | /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Compute/virtualMachines/node1 | |
node2 | /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Compute/virtualMachines/node2 |
The following is an example when both 172.30.2.10 and 172.30.3.10 are controlled as the takeover IP address.
In addition to the example below, it is also possible to configure the IP address of the same subnet to be used with a different KeyName.
KeyName | CFNameX | Takeover | VirtualMachine | AppID | TenantID | CertPath |
---|---|---|---|---|---|---|
CmdR01 | node1 | 172.30.2.10 | 172.30.0.10 | d5b7dac1-718f-448b-8e11-4a8cca6d9004 | 8ff7ddfd-fbcb-4700-ae52-6d071ac8d1b4 | /root/examplecert.pem |
node2 | 172.30.1.10 | |||||
CmdR02 | node1 | 172.30.3.10 | 172.30.0.10 | |||
node2 | 172.30.1.10 |
CmdR01 ROUTE node1 /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Compute/virtualMachines/node1 /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Network/routeTables/routetable1 172.30.2.10 172.30.0.10 d5b7dac1-718f-448b-8e11-4a8cca6d9004 8ff7ddfd-fbcb-4700-ae52-6d071ac8d1b4 /root/examplecert.pem CmdR01 ROUTE node2 /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Compute/virtualMachines/node2 /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Network/routeTables/routetable1 172.30.2.10 172.30.1.10 d5b7dac1-718f-448b-8e11-4a8cca6d9004 8ff7ddfd-fbcb-4700-ae52-6d071ac8d1b4 /root/examplecert.pem CmdR02 ROUTE node1 /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Compute/virtualMachines/node1 /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Network/routeTables/routetable1 172.30.3.10 172.30.0.10 d5b7dac1-718f-448b-8e11-4a8cca6d9004 8ff7ddfd-fbcb-4700-ae52-6d071ac8d1b4 /root/examplecert.pem CmdR02 ROUTE node2 /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Compute/virtualMachines/node2 /subscriptions/1e234d12-39b8-49db-881a-35aa03b402b9/resourceGroups/pcl/providers/Microsoft.Network/routeTables/routetable1 172.30.3.10 172.30.1.10 d5b7dac1-718f-448b-8e11-4a8cca6d9004 8ff7ddfd-fbcb-4700-ae52-6d071ac8d1b4 /root/examplecert.pem
Note
Use one line per node, separated by a space.
For ResourceID, enter each ID information of the operational system and the standby system.
Specify TakeoverIPAddress and VirtualMachineIPAddress with IPv4 addresses, not host names.
If the settings are not correct, the routing information cannot be updated correctly, resulting in a resource failure.
Execute the following command on all nodes and make sure that the information described in the definition file (/usr/opt/reliant/etc/hvazureconfig) is correctly described to control the device of Azure.
# /opt/SMAW/bin/hvazurechkconf
If there are no problems with the contents of the definition file, the display is as follows.
Example) The definition file is hvazureconfig
# /opt/SMAW/bin/hvazurechkconf
NOTICE: Check completed successfully. file=/usr/opt/reliant/etc/hvazureconfig
If there is a problem with the contents of the definition file, the setting value that must be checked is output. Follow the displayed message to take an action.
For details on the hvawschkconf (8) command messages, refer to "PRIMECLUSTER Messages."
This section describes how to register the network takeover to the cluster application.
The resources to be registered and their uses are as follows.
Registered resource | Usage |
---|---|
Cmdline resources | In the operational system, the routes of the virtual router are updated. |
Takeover network resources | In the operational system, the takeover IP address is activated. |
For details on how to set Cmdline resources, refer to the procedure for setting up Cmdline resources described in "6.7.3 Setting Up Resources" in "PRIMECLUSTER Installation and Administration Guide", and set the setting values described in "Table 27.1 Creating the Cmdline resources and setting the Online/Offline/Check scripts."
Parameter name | Setting value |
---|---|
StartCommands[0] | Set the following. /opt/SMAW/bin/hvazureipalias -c KeyName
|
StopCommands[0] | Set the following. /opt/SMAW/bin/hvazureipalias -u KeyName
|
CheckCommands[0] | Set the following. /opt/SMAW/bin/hvazureipalias -m KeyName
|
CheckCommandTimeouts[0] | Specify the amount of time it takes until PRIMECLUSTER diagnoses an error when the command specified in CheckCommands[0] has hung up. Set the value of SCRIPTTIMEOUT (default value is 300 seconds). |
Flags[0] | Settings of the AUTORECOVER attribute (Initial value is valid) and the TIMEOUT attribute are optional. All other attributes should be the default settings. Setting example: Flags[0]=XAT300 (AutoRecover valid) Flags[0]=XT300 (AutoRecover invalid) |
To set up the takeover network resources, refer to "6.7.3.6 Setting Up Takeover Network Resources" in "PRIMECLUSTER Installation and Administration Guide."
For the definition of the monitoring destination host in the presetting of this setting and the definition of the cluster configuration file, do as follows.
Defining the monitoring destination host
In an Azure environment, the virtual network gateway does not respond to Ping.
For this reason, network monitoring using ICMP cannot be used.
Defining the cluster configuration file
The cluster configuration file /usr/opt/reliant/etc/hvipalias must be described by the following rules.
CFName takeover interface netmask
CFName : CF node name of the node which uses the takeover IP address
takeover : Host name of the takeover IP address
interface : Network interface name on which the takeover IP address will be activated
netmask : Netmask for the takeover IP address(0xffffffff)
Note
The following steps are required to set up the takeover network resources.
If the client is outside the VNet, the IP address to be taken over should belong to a network within the CIDR range of the VNet.
For the netmask described in the cluster configuration file, make sure to specify 0xffffffff.
Set VIRTUAL (default value) for the BASE attribute and the VIRTUAL attribute of the takeover network resources.
Set the primary IP address of the network interface that activates the takeover IP address as the static IPv4 address.
For how to change the IP address of the Azure network interface, refer to the official Azure documentation.
Example
When the CIDR range of VNet is 172.30.0.0/17
/etc/hosts
172.30.2.10 takeoverip # takeoverIP
/usr/opt/reliant/etc/hvipalias
node1 takeoverip eth1 0xffffffff node2 takeoverip eth1 0xffffffff