return {
'name': name,
'ex_tags': tags,
+ 'ex_customdata': tags['arv-ping-url']
}
def sync_node(self, cloud_node, arvados_node):
def _init_image(self, urn):
return "image", self.get_image(urn)
- def post_create_node(self, cloud_node):
- self.real.ex_run_command(cloud_node,
- """bash -c '
- mkdir -p /var/tmp/arv-node-data/meta-data
- echo "%s" > /var/tmp/arv-node-data/arv-ping-url
- echo "%s" > /var/tmp/arv-node-data/meta-data/instance-id
- echo "%s" > /var/tmp/arv-node-data/meta-data/instance-type
- echo "%s" > /var/tmp/arv-node-data/meta-data/local-ipv4
- '""" % (cloud_node.extra["tags"]["arv-ping-url"],
- cloud_node.id,
- cloud_node.extra["properties"]["hardwareProfile"]["vmSize"],
- cloud_node.private_ips[0]),
- timestamp=int(time.time()))
-
def list_nodes(self):
# Azure only supports filtering node lists by resource group.
# Do our own filtering based on tag.
- return [node for node in
+ nodes = [node for node in
super(ComputeNodeDriver, self).list_nodes()
if node.extra["tags"].get("arvados-class") == self.tags["arvados-class"]]
+ for n in nodes:
+ # Need to populate Node.size
+ if not n.size:
+ n.size = self.sizes[n.extra["properties"]["hardwareProfile"]["vmSize"]]
+ return nodes
def broken(self, cloud_node):
"""Return true if libcloud has indicated the node is in a "broken" state."""
+ # UNKNOWN means the node state is unrecognized, which in practice means some combination
+ # of failure that the Azure libcloud driver doesn't know how to interpret.
return (cloud_node.state in (cloud_types.NodeState.ERROR, cloud_types.NodeState.UNKNOWN))
@classmethod