AWS API with OpenNebula?

Hello All,

i have a question to you about OpenNebula and the Amazon AWS Interfaces.

is it possible to use any Amazon EC2 interface(Java, Bash…) to control OpenNebula?
i don´t mean to use the econe tools or the OpenNebula Java Api.

thank you!

Hi,

Yes, you can use any Amazon EC2 client, as long as it allows you to define a custom endpoint. Some clients try to contact aws.amazon… and do not allow you to change it.

In the following link you can find the EC2 API calls supported by OpenNebula:
http://docs.opennebula.org/4.14/advanced_administration/public_cloud/ec2qug.html

Cheers

thank you for information!

i want to us AWS SDK to manage OpenNebula.
Anyway, if a try to login i get some strange behavior.

my CODE:

 AmazonEC2 ec2 = new AmazonEC2Client( new BasicAWSCredentials(
	        	    // provide access key and secret key
	        	    "access_key_id",
	        	    "secret_access_key"
	        	  ) );        
	        ec2.setEndpoint("http://localhost:4567");
	        
	        DescribeImagesRequest ec2Request = new DescribeImagesRequest();

access_key_id is my “oneadmin” and secret_access_key could be the Auth Token or the hashed password of oneadmin from the oneuser show command.

but it`s result is the following:

Nov 03, 2015 11:04:50 AM com.amazonaws.http.AmazonHttpClient parseClockSkewOffset
WARNUNG: Unable to parse clock skew offset from errmsg: The username or password is not correct (Service: AmazonEC2; Status Code: 401; Error Code: AuthFailure; Request ID: null)
Nov 03, 2015 11:04:50 AM com.amazonaws.http.AmazonHttpClient parseClockSkewOffset
WARNUNG: Unable to parse clock skew offset from errmsg: The username or password is not correct (Service: AmazonEC2; Status Code: 401; Error Code: AuthFailure; Request ID: null)
Nov 03, 2015 11:04:51 AM com.amazonaws.http.AmazonHttpClient parseClockSkewOffset
WARNUNG: Unable to parse clock skew offset from errmsg: The username or password is not correct (Service: AmazonEC2; Status Code: 401; Error Code: AuthFailure; Request ID: null)
Exception in thread “main” com.amazonaws.AmazonServiceException: The username or password is not correct (Service: AmazonEC2; Status Code: 401; Error Code: AuthFailure; Request ID: null)
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1219)
at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:803)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:505)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:317)
at com.amazonaws.services.ec2.AmazonEC2Client.invoke(AmazonEC2Client.java:11901)
at com.amazonaws.services.ec2.AmazonEC2Client.describeImages(AmazonEC2Client.java:6091)
at init.main(init.java:43)

but the username and passwort are correct and if i try to use OpenNebula CLI it works fine.

can anybody please help me ?
thanks

You have to use the hashed password as shown in the oneuser show command. Could you try also adding the path to the endpoint.

ec2.setEndpoint("http://localhost:4567/");

ok i also tried the hashed password.
and as you can see in my las post, there is that line.
ec2.setEndpoint(“http://localhost:4567”);

Try adding a / after the port number

ah ! :slight_smile: sorry

even with the / there is still the same error.

i have to say that the opennebula master is outside of my LAN, so i have to use a SSH proxy in via terminal. could this be a problem (port 4567 is forwarded)?

ok. problem solved.
problem was a blocked port somewere inbetween.