does instance id change on instance reboot?

48 views
Skip to first unread message

Sameer Gavade

unread,
Dec 30, 2014, 11:33:41 AM12/30/14
to appfog...@googlegroups.com
Hi,

Does the instance id in the VCAP_APPLICATION change on instance reboot? Please let me know.

Regards,
Sameer

Peter Olivo

unread,
Dec 31, 2014, 3:42:22 PM12/31/14
to appfog...@googlegroups.com
Yes, on restart or when interacting with a different instance you will see a different instance ID.

Sameer Gavade

unread,
Jan 1, 2015, 8:47:02 AM1/1/15
to appfog...@googlegroups.com
Thanks. So is there any way to uniquely identify an instance at all times? I can create a random id but can I persist it for that instance?

Regards,
Sameer

Peter Olivo

unread,
Jan 5, 2015, 2:09:00 PM1/5/15
to appfog...@googlegroups.com
You can parse the VCAP_APPLICATION environment variable to get the instance id that corresponds to the current instance of the application.
Please see this document for more information about parsing the variable in your language of choice.
https://support.appfog.com/hc/en-us/articles/202315666-Working-with-VCAP-SERVICES-Environment-Variables
The guide is written for the VCAP_SERVICES variable but the same principle applies to VCAP_APPLICATION, the instance id is within the returned array.
Reply all
Reply to author
Forward
0 new messages