4.10. Configuring the virtual IP management resource agent


The gcp-vpc-move-vip resource agent attaches a secondary IP address (alias IP) to a running instance. You can assign this floating IP address between different nodes in the cluster.

# pcs resource describe gcp-vpc-move-vip

You can configure the resource agent to use a primary subnet address range or a secondary subnet address range.

4.10.1. Configuring the primary subnet address range

If you need to automate or manage the assigned IP addresses allocation for VM or other resources within a subnet, you can use the primary subnet address range. It ensures that the primary address range is correctly set and configure to use as stable IP addresses for the primary virtual private network (VPC) subnet.

Procedure

  1. Create the aliasip resource by including an unused internal IP address and the CIDR block:

    # pcs resource create aliasip gcp-vpc-move-vip alias_ip=UnusedIPaddress/CIDRblock

    Example:

    [root@rhel81-node-01 ~]# pcs resource create aliasip gcp-vpc-move-vip alias_ip=10.10.10.200/32
  2. Create an IPaddr2 resource for managing the IP on the node:

    # pcs resource create vip IPaddr2 nic=interface ip=AliasIPaddress cidr_netmask=32

    Example:

    [root@rhel81-node-01 ~]# pcs resource create vip IPaddr2 nic=eth0 ip=10.10.10.200 cidr_netmask=32
  3. Group the network resources under vipgrp:

    # pcs resource group add vipgrp aliasip vip

Verification

  1. Verify the active resources and under the vipgrp group:

    # pcs status
  2. Verify the movable resources across the nodes:

    # pcs resource move vip Node

    Example:

    [root@rhel81-node-01 ~]# pcs resource move vip rhel81-node-03
  3. Verify if the vip successfully started on a different node:

    # pcs status

4.10.2. Configuring the secondary subnet address range

You can use the secondary subnet address range if you need to assign IP addresses from additional and predefined range within the same subnet, without creating a new subnet. It is useful for specific purposes such as custom routing. With secondary subnet address range, you can manage network traffic in a single subnet with multiple IP address ranges.

Prerequisites

Procedure

  1. Create a secondary subnet address range:

    # gcloud compute networks subnets update SubnetName --region RegionName --add-secondary-ranges SecondarySubnetName=SecondarySubnetRange

    Example:

    # gcloud compute networks subnets update range0 --region us-west1 --add-secondary-ranges range1=10.10.20.0/24
  2. Create the aliasip resource with an unused internal IP address in the secondary subnet address range and the CIDR block:

    # pcs resource create aliasip gcp-vpc-move-vip alias_ip=UnusedIPaddress/CIDRblock

    Example:

    [root@rhel81-node-01 ~]# pcs resource create aliasip gcp-vpc-move-vip alias_ip=10.10.20.200/32
  3. Create an IPaddr2 resource for managing the IP on the node:

    # pcs resource create vip IPaddr2 nic=interface ip=AliasIPaddress cidr_netmask=32

    Example:

    [root@rhel81-node-01 ~]# pcs resource create vip IPaddr2 nic=eth0 ip=10.10.20.200 cidr_netmask=32
  4. Group the network resources under vipgrp:

    # pcs resource group add vipgrp aliasip vip

Verification

  1. Verify that the active resources are under the vipgrp group:

    # pcs status
  2. Verify that the movable resources across different nodes:

    # pcs resource move vip Node

    Example:

    [root@rhel81-node-01 ~]# pcs resource move vip rhel81-node-03
  3. Verify that the vip successfully started on a different node:

    # pcs status
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部