Repository navigation
No external ip for created VM #953
Copy link
Copy link
Closed
Description
Activity
So the IP is not ephemeral by default, and we don't know how to set it to be ephemeral when we create the instance.
Turns out I didn't have an accessConfig set, which prompted the instance to not be created with an ephemeral IP. Here's the functioning code;
var zone = gce.zone('europe-west1-b'); var name = 'testing'; var BUILDER_MACHINE_CONFIG = { machineType: "n1-standard-1", disks: [{ autoDelete: true, boot: true, initializeParams: { sourceImage: 'https://www.googleapis.com/compute/v1/projects/PROJECT/global/images/custom-img' } }], networkInterfaces: [{ network: 'global/networks/default', accessConfigs: [ { kind: 'compute#accessConfig' }] }] }; zone.createVM(name, BUILDER_MACHINE_CONFIG, function(err, vm, operation, apiResponse) { console.log(err); operation.on('complete', function(metadata) { console.log('completed'); }); });
Hope this helps someone else in the same situation!
thanks, this helped me out.
- added a commit that references this issue
on Nov 11, 2022 - added a commit that references this issue
on Jul 23, 2025 - added a commit that references this issue
on Jan 28, 2026 - added a commit that references this issue
on Feb 17, 2026 - added a commit that references this issue
on Feb 24, 2026 - added 2 commits that reference this issue
on Mar 23, 2026 - added a commit that references this issue
on Mar 27, 2026 - added a commit that references this issue
on May 5, 2026
Metadata
Metadata
Assignees
Labels
No labels
Hello,
We don't get an external IP assigned for our newly created VM. We create a VM with the following script;
And it does create an instance successfully, but no IP is assigned and there is no option to SSH into it. Anyone able to shed some light on this?