Search code examples
amazon-ec2jclouds

JClouds: How to list EC2 nodes in just one region?


Calling listNodes() on EC2 takes several minutes to run, because it queries each EC2 region in a row. This is a long time, especially if I know where I want to be looking for my nodes.

Any way of making the query more focused or otherwise more efficient?

Ideas:

  1. Somehow customize the ComputeService to work with specific regions
  2. Have all the queries run concurrently

Solution

  • You have several options to improve that.

    • You can limit the regions jclouds will connect to by setting the jclouds.regions property to the comma separated list of the regions you want to use.
    • You can configure filters for the queries that are performed to get the list of images by setting them in the jclouds.ec2.ami-query property.

    You can find the default values for both properties in the AWSEC2ProviderMetadata.