Setting up the virtual IP address (Tivoli System Automation for Multiplatforms example)

Define the virtual IP address. Then, configure IBM® Tivoli® System Automation for Multiplatforms so that the network adapters on the servers are appropriate and equivalent for the virtual IP address.

About this task

In the following examples, a file named myserviceip.cfg is created that defines a virtual IP address named haip. The IPAddress value is the network alias IP address, which can be an IPv4 address or an IPv6 address. In the following examples, you can express the IPv4 address 192.0.2.10 as the IPv6 address ::ffff:192.0.2.10.

Procedure

  1. Create a configuration file in the /opt/IBM/hascripts directory that defines the virtual IP address and specifies the names of the servers to associate with the address.
    The NetMask value is the network mask of this IP address:
    PersistentResourceAttributes::
         NodeNameList={"myprimary", "mysecondary"}
         Name="haip"
         NetMask=255.255.255.128
         IPAddress=192.0.2.10
         ResourceType=1
  2. Run the mkrsrc command to create the virtual IP resource:
    mkrsrc -f /opt/IBM/hascripts/myserviceip.cfg IBM.ServiceIP
  3. Run the lsrsrc command to verify that the resource was created correctly:
    lsrsrc -l IBM.ServiceIP
    The command displays the virtual IP resource configuration. For example:
    Resource Persistent Attributes for IBM.ServiceIP
    resource 1:
            Name              = "haip"
            ResourceType      = 0
            AggregateResource = "0x2029 0xffff 0x8657b47c 0x9cbcbccb 0x918205be 0xc296f798"
            IPAddress         = "192.0.2.10"
            NetMask           = "255.255.255.128"
            ProtectionMode    = 1
            NetPrefix         = 0
            ActivePeerDomain  = "ha_domain"
            NodeNameList      = {"mysecondary"}
    resource 2:
            Name              = "haip"
            ResourceType      = 0
            AggregateResource = "0x2029 0xffff 0x8657b47c 0x9cbcbccb 0x918205be 0xc296f798"
            IPAddress         = "192.0.2.10"
            NetMask           = "255.255.255.128"
            ProtectionMode    = 1
            NetPrefix         = 0
            ActivePeerDomain  = "ha_domain"
            NodeNameList      = {"myprimary.example.com"}
    resource 3:
            Name              = "haip"
            ResourceType      = 1
            AggregateResource = "0x3fff 0xffff 0x00000000 0x00000000 0x00000000 0x00000000"
            IPAddress         = "192.0.2.10"
            NetMask           = "255.255.255.128"
            ProtectionMode    = 1
            NetPrefix         = 0
            ActivePeerDomain  = "ha_domain"
            NodeNameList      = {"myprimary.example.com","mysecondary"}
  4. Run the mkequ command to create an equivalency definition that specifies the network adapters that are to carry the virtual IP address.
    For example, the following command creates a static equivalency that is named ha_nieq:
    mkequ ha_nieq IBM.NetworkInterface:eth0:myprimary,eth0:mysecondary
  5. Run the lsequ command to verify the equivalency definition:
    lsequ -e ha_nieq
    The command displays the equivalency definition configuration. For example:
    Displaying Equivalency information:
    For Equivalency "ha_nieq".
    
    Equivalency 1:
            Name                      = ha_nieq
            MemberClass               = IBM.NetworkInterface
            Resource:Node[Membership] = {eth0:myprimary.example.com,eth0:mysecondary}
            SelectString              = ""
            SelectFromPolicy          = ANY
            MinimumNecessary          = 1
            Subscription              = {}
            Color                     = 0
            ActivePeerDomain          = ha_domain
            ConfigValidity            =
  6. On both servers, in the /etc/hosts file, add the mapping for the virtual host name to the virtual IP address.
    For example:
    192.0.2.10    harg  harg.example.com