Repository navigation
networkInterfaces resource upon createVM completion #1085
Copy link
Copy link
Closed
Labels
api: computeIssues related to the Compute Engine API.Issues related to the Compute Engine API.
Description
Activity
I think the issue is the
metadatain the context ofoperation.onCompleteis the operation's properties. What you need to do is make another call onvmto refresh the metadata:zone.createVM(name, config, function(err, vm, operation, apiResponse){ operation.on('complete', function(){ vm.getMetadata(function(err, metadata){ // metadata.networkInterfaces[0].accessConfigs[0].natIP }); }); })
Here's an example of doing that in gcloud-deploy: https://github.com/stephenplusplus/gcloud-deploy/blob/25233819ece801bc556957153e64d78a09993615/index.js#L221
Let me know if you run into any issues!
- addedapi: computeIssues related to the Compute Engine API.Issues related to the Compute Engine API.
on Jan 25, 2016 Thanks for the quick and swift feedback. It worked!
- added a commit that references this issue
on Jan 17, 2023 - added 2 commits that reference this issue
on Jul 23, 2025 - added a commit that references this issue
on Aug 7, 2025 - added a commit that references this issue
on Aug 8, 2025 25 remaining items
- added a commit that references this issue
on Mar 11, 2026 - added a commit that references this issue
on Mar 12, 2026 - added 4 commits that reference this issue
on Mar 23, 2026
Metadata
Metadata
Assignees
Labels
api: computeIssues related to the Compute Engine API.Issues related to the Compute Engine API.
The createVM api exposes four variables on call back, along with a callback variable. As far as I could see, the networkInterfaces resource for that given VM is not accessible anywhere. In other words, it is not possible to get the external IP for the VM should one have been assigned, a part from getting all VMs after the creation of a particular one.
Am I missing something, or is this feature not yet implemented? And if not, I like to request it as an enhancement. Thanks!