jclouds- how to uniquely identify one node within a group of compute instances

90 views
Skip to first unread message

Arvind

unread,
Dec 24, 2012, 6:45:29 AM12/24/12
to jcl...@googlegroups.com
Hello,

In a java app, I have started a group of virtual machines with a specific group name.

Now, I wish to identify each of the virtual machines in that group, uniquely. The code to identify a virtual machine (which is part of that group of machines) will be run within that machine itself directly. What parameter/attribute do I use to uniquely identify such a machine? As I understand "NodeMetadata" identifies each node...But which attribute from "NodeMetadata" class do I use for the purpose as described above? In such a way that, this attribute can be obtained by code running on the node that I wish to terminate?

Thanks,
Arvind.

Adrian Cole

unread,
Dec 24, 2012, 7:12:20 AM12/24/12
to jcl...@googlegroups.com
node.id is your best bet.  Also, don't be shy about creating groups of size one.  Groups intend to represent machines with identical configuration.

-A


--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jclouds/-/ECpkyugqRQQJ.
To post to this group, send email to jcl...@googlegroups.com.
To unsubscribe from this group, send email to jclouds+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jclouds?hl=en.

Arvind

unread,
Dec 24, 2012, 8:54:53 AM12/24/12
to jcl...@googlegroups.com
Hi

OK, suppose i create a group of 5 machines--> will the id field have values 1,2,3,4,5? Also, can I obtain the public IP address of a node from the node metadata?

Thanks,
Arvind.

Adrian Cole

unread,
Dec 24, 2012, 12:57:58 PM12/24/12
to jcl...@googlegroups.com

Hi, arvind

Don't plan to parse the id.  Sometimes it is a number sometimes it is an href.  You can get the public ip from the public addresses accessor. 

Hth

--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jclouds/-/kia1tDmsj2YJ.
Reply all
Reply to author
Forward
0 new messages