logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

ocf_heartbeat_gcp-vpc-move-route - Move IP within a GCP VPC

Author

ClusterLabscontributors(seetheresourceagentsourceforinformationaboutindividualauthors)

resource-agents 4.16.0-3ubuntu                     06/25/2025                             OCF_HEARTBEAT_GCP-V(7)

Description

       Resource Agent that can move a floating IP addresse within a GCP VPC by changing an entry in the routing
       table. This agent also configures the floating IP locally on the instance OS. Requirements :

       - IP forwarding must be enabled on all instances in order to be able to terminate the route

       - The floating IP address must be chosen so that it is outside all existing subnets in the VPC network

       - IAM permissions (see https://cloud.google.com/compute/docs/access/iam-permissions) : 1)
       compute.routes.delete, compute.routes.get and compute.routes.update on the route 2)
       compute.networks.updatePolicy on the network (to add a new route) 3) compute.networks.get on the network
       (to check the VPC network existence) 4) compute.routes.list on the project (to check conflicting routes)

Example Crm Shell

       The following is an example configuration for a gcp-vpc-move-route resource using the crm(8) shell:

           primitive p_gcp-vpc-move-route ocf:heartbeat:gcp-vpc-move-route \
             params \
               ip=string \
             op monitor depth="0" timeout="30s" interval="60s"

Example Pcs

       The following is an example configuration for a gcp-vpc-move-route resource using pcs(8)

           pcs resource create p_gcp-vpc-move-route ocf:heartbeat:gcp-vpc-move-route \
             ip=string \
             op monitor OCF_CHECK_LEVEL="0" timeout="30s" interval="60s"

Name

       ocf_heartbeat_gcp-vpc-move-route - Move IP within a GCP VPC

See Also

Supported Actions

       This resource agent supports the following actions (operations):

       start
           Starts the resource. Suggested minimum timeout: 180s.

       stop
           Stops the resource. Suggested minimum timeout: 180s.

       monitor
           Performs a detailed status check. Suggested minimum timeout: 30s. Suggested interval: 60s.

       validate-all
           Performs a validation of the resource configuration. Suggested minimum timeout: 5s.

       meta-data
           Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5s.

Supported Parameters

ip
           Floating IP address. Note that this IP must be chosen outside of all existing subnet ranges

           (unique, required, string, no default)

       vpc_network
           Name of the VPC network

           (optional, string, default "default")

       project
           Project ID of the instance. It can be useful to set this attribute if the instance is in a shared
           service project. Otherwise, the agent should be able to determine the project ID automatically.

           (optional, string, default "default")

       interface
           Name of the network interface

           (optional, string, default "eth0")

       route_name
           Route name

           (unique, optional, string, default "ra-gcp-vpc-move-route")

       serviceaccount
           Path to Service account JSON file

           (optional, string, no default)

       stackdriver_logging
           If enabled (set to true), IP failover logs will be posted to stackdriver logging

           (optional, boolean, default false)

Synopsis

gcp-vpc-move-route [start | stop | monitor | meta-data | validate-all]

See Also