Performance improvements for the 'Google Cloud Platform (GCP) - Virtual Server' discovery pattern for discovery of specific regions (LDCs)DescriptionThe Google Cloud Platform (GCP) - Virtual Server pulls all VMs from Google, then performs several operations on the retrieved data, and then it filters the results to only subset of LDCs if the schedule has LDCs defined in it. This approach doesn't scale and it will fail in huge environments because customers may host few thousand VMs in each data canters.Steps to Reproduce Run GCP API discovery and check: Pattern: Google Cloud (GCP) - Virtual MachineShared Library: Google GCP - Get InstancesStep: Get Virtual Machines data Get Virtual Machine retrieves all VM¬s for the selected service account and it doesn't respect the data center selection in the cloud discovery schedule.https://compute.googleapis.com/compute/v1/projects/[PROJECT]/aggregated/instancesWorkaroundHow does ServiceNow Retrieve VMs from Google Cloud Platform in Huge Environments? Google Cloud (GCP) - Virtual Machine Pattern ServiceNow provide selected data centers to patterns by using pre-sensor scripts. The pre sensor script retrieves selected data centers in the Cloud Discovery schedule, and it populates $cmdb_ci_google_datacenter variable. $cmdb_ci_google_datacenter is an array which means there are 3 possible cases. RECOMMENDATION: Select only one datacenter when you create a new cloud schedule! Use Case 1: Empty $cmdb_ci_google_datacenter provided The discovery pattern will retrieve all VMs for the selected account. No filtering. Use Case 2: Only one $cmdb_ci_google_datacenter provided The pattern filters VMs just in case there is only one record in the $cmdb_ci_google_datacenter. To enable VM filtering you have to create a cloud discovery schedule which selects exactly one datacenter. Use Case 3: More than one $cmdb_ci_google_datacenter provided The discovery pattern will retrieve all VMs for the selected account. No filtering. Support will implement the "Use Case 2" change. "Use Case 1" and "Use Case 2" are beyond the support scope and they will have to be suggested at the Idea portal. When they get suffcient attention they will be reviewed by the product management. How to create GCP discovery schedules for big environments? Create multiple discovery schedules and select only one datacenter. Example You plan discovering 3000 VMs in us-central1, us-east1 and us-west1. You will create following cloud discovery schedules:• mycloud_us-central1• mycloud_us-east1• mycloud_us-west1 GCP API Filtering curl \'https://compute.googleapis.com/compute/v1/projects/[PROJECT]/aggregated/instances?filter=zone%20eq%20.*[LDC]-.*&key=[YOUR_API_KEY]' \ --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \ --header 'Accept: application/json' \--compressed References https://cloud.google.com/compute/docs/reference/rest/v1/instances/aggregatedListhttps://pkg.go.dev/google.golang.org/api/compute/v1#InstancesListCallRelated Problem: PRB1606355