Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

unable to create instance or install libraries

Hi Team,

I am currently using a managed notebook in Vertex AI Workbench, which has been deprecated. While attempting to create a new instance in Vertex AI Workbench, I encountered the following issues:

  1. When selecting an external IP, the instance fails to be created.
  2. Without an external IP, the notebook is created, but I am unable to install any libraries.

Error message encountered:

 

xxx: Constraint constraints/compute.vmExternalIpAccess violated for project xxxxxxx. Add instance projects/xxxxxxzones/us-central1-a/instances/xxxx to the constraint to use external IP with it.: Something went wrong. Sorry about that.
 
Kindly advise how to fix this
Solved Solved
0 1 412
1 ACCEPTED SOLUTION

Hi @Rajavelu,

Welcome to Google Cloud Community!

The error message clearly points to a Google Cloud Organization Policy constraint preventing you from assigning an external IP address to your Vertex AI Workbench instance. This is a security measure often enforced at the organization or folder level to control network access. 

Here's a breakdown of the issue:

  • constraints/compute.vmExternalIpAccess: This is a Google Cloud Organization Policy that dictates whether VMs are allowed to have external IP addresses.
  • violated for project xxxxxxx: This means the policy is being applied to your project (identified as xxxxxxx).
  • Add instance projects/xxxxxxzones/us-central1-a/instances/xxxx to the constraint to use external IP with it.: This is the core of the solution. The error message is telling you that the current policy prohibits all external IPs, and to make an exception, you need to specifically allow the external IP address for this instance (projects/xxxxxx/zones/us-central1-a/instances/xxxx).

Why This Happens & Impact of No External IP

  • Security: Organizations often restrict external IPs to reduce the attack surface and improve security.
  • Without External IP:
    • Limited Internet Access: Your notebook won't have direct internet access, making it impossible to install libraries using pip, conda, etc. because it cannot reach the package repositories.
    • Limited Connectivity: You will not be able to easily connect remotely.
    • Difficulty Accessing External APIs: Connecting to external resources without a proxy becomes a challenge.

Here are the workarounds that you may try:

  1. Requesting an Exception

You'll likely need to contact your organization's Google Cloud administrator or the team responsible for managing organization policies. Request that they modify the constraints/compute.vmExternalIpAccess policy to allow the specific instance you are trying to create: projects/xxxxxx/zones/us-central1-a/instances/xxxx. Provide them the full instance ID from the error message. This ensures they are creating an exception for only your instance and not opening up the entire project to external IPs. Briefly explain why you need an external IP (e.g., "I need to install libraries from the internet and access external resources through a proxy."). 

  1. Use a Cloud NAT Gateway (Alternative to External IP)

A Cloud NAT gateway allows your notebook instance to access the internet for outbound traffic (like installing libraries) without having a publicly facing external IP.

Here’s how to set up:

  • Create a Cloud Router in your VPC network.
  • Create a Cloud NAT Gateway associated with that Cloud Router.
  • Configure the NAT Gateway to route the subnet where your notebook instance is located.
  • When you create your notebook instance, you will not need to request or specify an external IP as the NAT Gateway handles the routing.
  1. Private Google Access

This is a Google Cloud feature that allows internal instances without public IPs to access Google Cloud APIs and services. It can be used to access pypi.org and other public python repositories that reside in Google Cloud.

Here’s how to set up:

  • Enable Private Google Access on your subnet in the VPC network.
  • When you create your notebook instance, you will not need to request or specify an external IP as Private Google Access handles the network routing.

You may follow these steps:

  1. Identify your organization's policy administrator.
  2. Start with workaround#1 (request an exception). It's the most controlled and secure option.
  3. If getting an exception isn't feasible quickly, investigate #2 (Cloud NAT Gateway) or #3 (Private Google Access).

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

View solution in original post

1 REPLY 1