A tool to discover and analyze compute and storage resources in Google Cloud Platform (GCP) projects. This tool provides rudimentary insights into virtual machines, persistent disks, snapshots, and generates cost estimates and potential savings projections.
-
VM Discovery: Collects information about all VM instances including:
- vCPU count and memory allocation
- Machine type and family (e2, n1, n2, etc.)
- Network configuration (IPs, NICs, network tier)
- Operating system detection
- Disk configuration (boot vs data disks)
- Preemptible status
-
Disk Analysis: Detailed persistent disk information including:
- Disk type (pd-balanced, pd-ssd, pd-standard)
- Size and attachment status
- Boot disk identification
- Provisioned IOPS and throughput
-
Snapshot Tracking: Complete snapshot inventory with size and source information
-
Cost Analysis:
- Current monthly/annual cost estimates based on GCP pricing
- Projected savings with compression optimization
-
Multiple Export Formats:
- Console output with formatted summary
- CSV files for detailed analysis and reporting
- Go 1.19 or later installed on your system
- GCP Project with compute resources
- Authentication: Run
gcloud auth application-default loginto authenticate - Required GCP APIs: Compute Engine API must be enabled
- Permissions: Read-only access to:
compute.instances.listcompute.disks.listcompute.snapshots.listcompute.machineTypes.get
git clone <repository-url>
cd probe
go build -o gcp_discovery gcp_discovery.gogo run gcp_discovery.go <project-id>./gcp_discovery <project-id>Or run directly:
go run gcp_discovery.go <project-id>./gcp_discovery my-gcp-project-123🔍 Discovering infrastructure for project: t-strata-475113-r6
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Collecting VM instances...
Found 1 VMs
💾 Collecting persistent disks...
Found 1 disks
📸 Collecting snapshots...
Found 0 snapshots
📈 INFRASTRUCTURE SUMMARY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🖥️ Virtual Machines:
Total VMs: 1
Production: 0
Staging: 0
Development: 0
Other: 1
Preemptible: 0
Total vCPUs: 2
Total Memory: 1 GB
💾 Persistent Disks:
Total Disks: 1
Total Capacity: 10 GB (0.01 TB)
Boot Disks: 10 GB (0.01 TB)
Data Disks: 0 GB (0.00 TB)
By Disk Type:
pd-balanced: 10 GB (0.01 TB)
pd-ssd: 0 GB (0.00 TB)
pd-standard: 0 GB (0.00 TB)
📸 Snapshots:
Total Snapshots: 0
Total Size: 0 GB (0.00 TB)
💰 ESTIMATED MONTHLY COSTS (GCP Pricing):
pd-balanced: $1.00
pd-ssd: $0.00
pd-standard: $0.00
Snapshots: $0.00
─────────────────────────
TOTAL: $1.00/month
ANNUAL: $12.00/year
🎯 PROJECTED STRATA SAVINGS (2.5x compression):
Compressed Size: 0.00 TB (from 0.01 TB)
New Monthly Cost: $0.40
Monthly Savings: $0.60
Annual Savings: $7.20
Reduction: 60.0%
💡 ADDITIONAL STRATA OPTIMIZATIONS:
📊 Over-Provisioning Waste:
Estimated buffer: 30% (industry typical)
Avg utilization: 70%
Wasted capacity: 0.90 GB (0.00 TB)
Monthly waste cost: $0.09
Annual waste: $1.08
→ Strata eliminates over-provisioning via online expansion
👨💻 DevOps Operational Efficiency:
Current weekly hours:
- Snapshot management: 0.1 hours (1 disks × 3 min)
- Env provisioning: 4.0 hours
- Storage expansions: 1.0 hours
Total weekly hours: 5.0 hours
At $50/hour: $252.50/week = $1093.33/month
With Strata (90% automation):
New weekly hours: 0.5 hours
Monthly savings: $983.99
Annual savings: $11807.91
→ Single pane management for 1 disks
✅ Discovery complete! Check the generated CSV files:
- csv/infrastructure_summary.csv
- csv/vms_detail.csv
- csv/disks_detail.csv
- csv/snapshots_detail.csv
High-level metrics including total VMs, vCPUs, memory, disk capacity, and costs.
Detailed VM information with columns:
- Zone
- VM Name
- Machine Type
- Machine Family
- Status
- vCPUs
- Memory (GB)
- Boot Disk (GB)
- Data Disks (GB)
- Total Disk Size (GB)
- NIC Count
- Internal IP
- External IP
- Network Tier
- OS
- Preemptible
- Environment
Comprehensive disk information:
- Zone
- Disk Name
- Size (GB)
- Type
- Status
- Attached To VM
- Boot Disk (Yes/No)
- Provisioned IOPS
- Provisioned Throughput (MB/s)
- Created At
Snapshot inventory:
- Snapshot Name
- Source Disk
- Size (GB)
- Storage Bytes
- Created At
The tool automatically classifies VMs into environments based on:
- GCP labels (
environmentorenv) - Naming conventions (containing "prod", "staging", "dev", etc.)
Cost calculations are based on standard GCP pricing (as of 2025):
- pd-balanced: $0.10/GB/month
- pd-ssd: $0.17/GB/month
- pd-standard: $0.04/GB/month
- Snapshots: $0.026/GB/month
Note: Actual costs may vary based on region, committed use discounts, and current GCP pricing.
The tool supports automatic CPU/Memory detection for common machine families:
- E2 series (e2-micro, e2-small, e2-medium, e2-standard-, e2-highmem-, e2-highcpu-*)
- N1 series (n1-standard-, n1-highmem-, n1-highcpu-*)
- N2 series (n2-standard-, n2-highmem-, n2-highcpu-*)
For custom machine types or unlisted configurations, the tool fetches specifications directly from the GCP API.
# Re-authenticate with GCP
gcloud auth application-default loginEnsure your account has at least roles/compute.viewer or equivalent read permissions.
# Enable Compute Engine API
gcloud services enable compute.googleapis.com --project=<project-id>Licensed under the Apache License, Version 2.0. See LICENSE for details.
Contributions are welcome! Please feel free to submit issues or pull requests.
For questions or issues, please open an issue in the repository.