{
  "id": "policy/gcp-org-policy-restrict-vm-external-ip",
  "signature": "Operation failed: Access denied due to organization policy: constraint/compute.vmExternalIpAccess violated for project <project-id>",
  "signature_zh": "操作失败：由于组织策略，访问被拒绝：constraint/compute.vmExternalIpAccess 违反了项目 <project-id>",
  "regex": "constraint/compute\\.vmExternalIpAccess violated for project",
  "domain": "policy",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "GCP organization policy 'compute.vmExternalIpAccess' blocks creating VMs with external IPs; the constraint is enforced at the organization, folder, or project level.",
  "root_cause_type": "generic",
  "root_cause_zh": "GCP 组织策略 'compute.vmExternalIpAccess' 阻止创建具有外部 IP 的 VM；该约束在组织、文件夹或项目级别强制执行。",
  "versions": [
    {
      "version": "Google Cloud SDK 450.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Compute Engine API v1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Organization Policy Service",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Setting VM to use an ephemeral external IP manually in gcloud still fails because the policy blocks all external IP assignment.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Removing the VM and recreating without specifying --no-address still triggers the policy if the default network has external IP.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Creating a VM in a different project without checking its policy may still fail if the organization policy applies across projects.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Create the VM without an external IP: gcloud compute instances create <instance-name> --no-address --zone=<zone>. Then use Cloud NAT or a bastion host for outbound connectivity.",
      "success_rate": 0.9,
      "how": "Create the VM without an external IP: gcloud compute instances create <instance-name> --no-address --zone=<zone>. Then use Cloud NAT or a bastion host for outbound connectivity.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Request an exception to the organization policy from your GCP admin: have them add your project to the allowed list via the Organization Policies console.",
      "success_rate": 0.7,
      "how": "Request an exception to the organization policy from your GCP admin: have them add your project to the allowed list via the Organization Policies console.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a Shared VPC with a proxy subnet that has external IP allowed, then launch the VM in that subnet without direct external IP.",
      "success_rate": 0.75,
      "how": "Use a Shared VPC with a proxy subnet that has external IP allowed, then launch the VM in that subnet without direct external IP.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "创建没有外部 IP 的 VM：gcloud compute instances create <instance-name> --no-address --zone=<zone>。然后使用 Cloud NAT 或堡垒主机进行出站连接。",
    "向 GCP 管理员请求组织策略的例外：让他们通过组织策略控制台将你的项目添加到允许列表。",
    "使用具有允许外部 IP 的代理子网的共享 VPC，然后在该子网中启动 VM，不直接分配外部 IP。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cloud.google.com/compute/docs/ip-addresses/reserve-static-external-ip-address#organization_policy",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-11-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}