google-compute-engine"/>
  • 4
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

Today lots of peoples/developers are using VM's in google cloud, so keeping in this mind there are lots of VM's were getting created and deleted every day.

Also, Google compute engine allocates an ID (auto-generated) to each instance in the cloud at the time of VM creation.

So, Is there any chance that this ID gets reused(repeated) considering this same ID was assigned to an instance but now that instance got deleted?

Thanks

As per the documentation states, the instance ID is a unique numerical identifier generated by Google Compute Engine.

You can check the documentation here: https://cloud.google.com/compute/docs/storing-retrieving-metadata

In a technical context a unique identifier is defined as a numeric or alphanumeric string associated with a single entity within a given system. The aim of using unique IDs is to univocally identify entities by their ID's.

However, you are asking if it's possible that this ID could be repeated, understanding by "repeated" being used in two different instances in the same moment in time, I don't think the ID can be used by 2 instances at the same time, since the documentation clearly states that the ID it's unique.

But I don't see any inconvenience on reusing the ID of an instance that was created but has been deleted and does not exist anymore (it will still be unique).

Can you specify a little bit more your use case or describe what you're trying to achieve with the instance ID?


EDITED: adding here a comment from below this answer for better reading:

To ensure the unicity of a GCE instance, for software licensing you can use an instance identity token https://cloud.google.com/compute/docs/instances/verifying-instance-identity

  1. A GCE instance requests a signed token from the metadata API. This token identifies the instance and is signed by Google.
  2. The GCE instance provides this signed token to a verification server.
  3. The verification server checks the signature from Google in the token, confirming the instance is who it says it is.
  4. The verification server authenticates the instance and provides whatever is needed to it.
  • 1
Reply Report
    • Not sure if you wanted to add more info after "here is my use case:" or you meant that your use case is software licensing. You can think of Google Compute Engine instance id's as unique identifiers, because even if they get reused, in practice, there will never be an instance id linked to 2 instances in the same moment in time. Hoping this covers your question.
      • 1
    • Sorry for incomplete reply, If the customer has purchased a bundle of hundred licenses and he starts using the key from this bundle to activate application then the licenses count will decrease. We are planning to keep track of VM instance ID on which license key was used, so, If customer upgrade it's VM instance to fresh higher version of OS (e.g ubuntu 14 to 16) and again use a license key for the activation on the same instance then this time license count will not decrease, as the machine is not changed. IF ID is getting reused then above model will fail and user will get more activations
      • 1
    • To ensure the unicity of a GCE instance, for software licensing you can use an instance identity token cloud.google.com/compute/docs/instances/… 1. A GCE instance requests a signed token from the metadata API. This token identifies the instance and is signed by Google. 2. The GCE instance provides this signed token to a verification server. 3. The verification server checks the signature from Google in the token, confirming the instance is who it says it is. 4. The verification server authenticates the instance and provides whatever is needed to it.

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags