This section describes a configuration setup example in which communications for administration, public use, and backup are established on different networks for the virtual machine function.
1) Setting up virtual networks on the host OS
1-1) Define virtual bridges (xenbr0, xenbr1, xenbr2, xenbr3, xenbr4, xenbr5). For details, see the RHEL manuals.
Contents of /etc/xen/scripts/network-bridge-gls
#!/bin/sh
#
# Sample of Create/Delete virtual bridge
#
# $1 start : Create virtual bridge
# stop : Delete virtual bridge
# status: Display virtual bridge information
# Exit if anything goes wrong
#set -e
command=$1
xenscript=/etc/xen/scripts/network-bridge
glsxenscript=/opt/FJSVhanet/local/sbin/hanetxen
# op_start:subscript for start operation #
op_start () { $xenscript $command vifnum=0 netdev=eth0 $xenscript $command vifnum=1 netdev=eth1 $xenscript $command vifnum=2 netdev=eth2 $xenscript $command vifnum=3 netdev=eth3 $xenscript $command vifnum=4 netdev=eth4 $xenscript $command vifnum=5 netdev=eth5 } # op_stop:subscript for stop operation # op_stop () { # same operation as start op_start } case "$command" in start) # Create your virtual bridge $glsxenscript stop op_start $glsxenscript start ;; stop) # Delete virtual bridge $glsxenscript stop op_stop ;; *) echo "Unknown command: $command" >&2 echo 'Valid commands are: start, stop, status' >&2 exit 1 esac |
Note
In the line of "$xenscript $command vifnum=X netdev=ethX", specify the same value for the number (X) specified by vifnum and the number (X) of the device name (ethX) specified by netdev.
1-2) Save the script in "/etc/xen/scripts".
# cp network-bridge-gls /etc/xen/scripts # cd /etc/xen/scripts # chmod +x network-bridge-gls |
1-3) Register with the xend service.
Contents of /etc/xen/xend-config.sxp
# Your default ethernet device is used as the outgoing interface, by default.
# To use a different one (e.g. eth1) use
#
(omitted)
#
(network-script network-bridge-gls) |
1-4) Edit the domain configuration file
The network interface for the guest OS should be connected to the primary virtual bridge (xenbr0) that you set in "3-1)". The following shows an example of the domain configuration file. Set the virtual bridge name in the "vif" parameter. For details on the domain configuration file, see the RHEL manuals.
Contents of /etc/xen/domain name (domain configuration file)
vif=["mac=XX:XX:XX:XX:XX:XX,bridge=xenbr0","mac=YY:YY:YY:YY:YY:YY,bridge=xenbr2", "mac=ZZ:ZZ:ZZ:ZZ:ZZ:ZZ,bridge=xenbr4"] |
Note
If you create five virtual bridges or more, add the following setting in /etc/modprobe.conf. For details, see the RHEL manuals. The following is an example for creating six virtual bridges.
# options netloop nloopbacks=6 |
2) Setting up the network on the host OS
2-1) Define the IP addresses and host names you use in the /etc/hosts file.
192.168.70.1 hosta # virtual IP address of the host OS 192.168.71.1 hostb # physical IP address of the host OS 192.168.72.1 hostc # virtual IP address of the host OS 192.168.70.100 swhub1 # IP address of the primary monitoring destination's HUB 192.168.70.101 swhub2 # IP address of the secondary monitoring destination's HUB 192.168.71.100 swhub3 # IP address of the primary monitoring destination's HUB 192.168.71.101 swhub4 # IP address of the secondary monitoring destination's HUB 192.168.72.100 swhub5 # IP address of the primary monitoring destination's HUB 192.168.72.101 swhub6 # IP address of the secondary monitoring destination's HUB |
2-2) Type IP addresses in the /etc/sysconfig/network-scripts/ifcfg-ethX(X = 0,1,2,3,4,5) file.
Contents of /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 BOOTPROTO=static HWADDR=XX:XX:XX:XX:XX:XX HOTPLUG=no BROADCAST=192.168.70.255 IPADDR=192.168.70.1 NETMASK=255.255.255.0 NETWORK=192.168.70.0 ONBOOT=yes TYPE=Ethernet |
Contents of /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1 BOOTPROTO=static HWADDR=XX:XX:XX:XX:XX:XX HOTPLUG=no ONBOOT=yes TYPE=Ethernet |
Contents of /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2 BOOTPROTO=static HWADDR=XX:XX:XX:XX:XX:XX HOTPLUG=no BROADCAST=192.168.71.255 IPADDR=192.168.71.1 NETMASK=255.255.255.0 NETWORK=192.168.71.0 ONBOOT=yes TYPE=Ethernet |
Contents of /etc/sysconfig/network-scripts/ifcfg-eth3
DEVICE=eth3 BOOTPROTO=static HWADDR=XX:XX:XX:XX:XX:XX HOTPLUG=no ONBOOT=yes TYPE=Ethernet |
Contents of /etc/sysconfig/network-scripts/ifcfg-eth4
DEVICE=eth4 BOOTPROTO=static HWADDR=XX:XX:XX:XX:XX:XX HOTPLUG=no BROADCAST=192.168.72.255 IPADDR=192.168.72.1 NETMASK=255.255.255.0 NETWORK=192.168.72.0 ONBOOT=yes TYPE=Ethernet |
Contents of /etc/sysconfig/network-scripts/ifcfg-eth5
DEVICE=eth5 BOOTPROTO=static HWADDR=XX:XX:XX:XX:XX:XX HOTPLUG=no ONBOOT=yes TYPE=Ethernet |
2-3) Configure the /etc/sysconfig/network file to enable the network setting.
NETWORKING=yes NETWORKING_IPV6=no |
2-4) Reboot
To enable the network setting for Domain-0, 1 and 2, execute the following command and reboot the system. After rebooting the system, use the ifconfig command to check that eth0 is activated.
/sbin/shutdown -r now
3) Having GLS recognize the virtual network configuration
3-1) Set these values in the configuration file for the virtual networks.
Contents of /etc/opt/FJSVhanet/script/conf/eth0_eth1.conf
PRI_BR=xenbr0 SEC_BR=xenbr1 PRI_OUT_IF=peth0 SEC_OUT_IF=peth1 |
Contents of /etc/opt/FJSVhanet/script/conf/eth2_eth3.conf
PRI_BR=xenbr2 SEC_BR=xenbr3 PRI_OUT_IF=peth2 SEC_OUT_IF=peth3 |
Contents of /etc/opt/FJSVhanet/script/conf/eth4_eth5.conf
PRI_BR=xenbr4 SEC_BR=xenbr5 PRI_OUT_IF=peth4 SEC_OUT_IF=peth5 |
Note
Set the values in the configuration file for the virtual network for each redundant physical interface. When you name the configuration file of a virtual network, put an underscore between the names of the redundant physical interfaces, and".conf" at the end. Other forms of names are invalid. In addition, only alphanumeric characters and periods can be used in the string after the "="for each setting. If you use characters other than the above, the setting will be invalid.
3-2) Create the script to associate the virtual machine function with GLS to enable the redundant line control function.
cd /etc/opt/FJSVhanet/script/xen cp -p eth_eth.xen.sam eth0_eth1 cp -p eth_eth.xen.sam eth2_eth3 cp -p eth_eth.xen.sam eth4_eth5
Note
Create the script to associate the virtual machine function with GLS for each redundant physical interface. When you name the script file for associating the virtual machine function with GLS, put an underscore between the names of the redundant physical interfaces, and".conf" at the end. Other forms of names are invalid.
4) Setting the redundant line switching mode
4-1) Setting subnet masks
/opt/FJSVhanet/usr/sbin/hanetmask create -i 192.168.70.0 -m 255.255.255.0 /opt/FJSVhanet/usr/sbin/hanetmask create -i 192.168.71.0 -m 255.255.255.0 /opt/FJSVhanet/usr/sbin/hanetmask create -i 192.168.72.0 -m 255.255.255.0
4-2) Setting virtual interfaces
/opt/FJSVhanet/usr/sbin/hanetconfig create -n sha0 -m e -i 192.168.70.1 -t eth0,eth1 /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha2 -m e -i 192.168.71.1 -t eth2,eth3 /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha4 -m e -i 192.168.72.1 -t eth4,eth5
Note
Make sure to set the same physical IP address set in /etc/sysconfig/network-scripts/ifcfg-ethX for the physical IP address to be specified with the '-i' option.
4-3) Setting HUB monitoring function
/opt/FJSVhanet/usr/sbin/hanetpoll create -n sha0 -p 192.168.70.100,192.168.70.101 -b off /opt/FJSVhanet/usr/sbin/hanetpoll create -n sha2 -p 192.168.71.100,192.168.71.101 -b off /opt/FJSVhanet/usr/sbin/hanetpoll create -n sha4 -p 192.168.72.100,192.168.72.101 -b off
4-4) Setting the standby patrol
/opt/FJSVhanet/usr/sbin/hanetconfig create -n sha1 -m p -t sha0 /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha3 -m p -t sha2 /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha5 -m p -t sha4
4-5) Activating virtual interfaces
/opt/FJSVhanet/usr/sbin/strhanet
4-6) Starting HUB monitoring
/opt/FJSVhanet/usr/sbin/hanetpoll on
5) Setting up the guest OS
Set up an IP address. Edit the "/etc/sysconfig/network-scripts/ifcfg-ethX" file as you would for the host OS.