jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Teo De Las Heras <teode...@microsoft.com>
Subject RE: Example end-to-end walkthrough?
Date Sat, 07 Jan 2017 19:47:52 GMT
Thanks.  I got the same suggestion from the team that created the ARM project.  I’ve almost
got it running.  How would I figure out what parameters are needed / what can be overwritten?
 Not sure how I would have known to use -Dazurecompute-arm.endpoint.  I see it in the azurecompute-arm
project but it’s not clearly spelled out that it should be added when calling the compute
service API.

Another question on getting the project to run.  I’m getting errors below about not finding
images in default storage account and machine not found.  I think I probably need to modify
the code in the MainApp.Java, yes?
Based on what I’m reading here, http://jclouds.apache.org/start/compute/ , I think I should
modify the templateBuilder object to get around the errors below?  Just not sure what to enter.
 For example, how do I override the default location which seems to be eastasia?    The azurecompute-arm
project says I can do jclouds.regions="northeurope" but not sure where to put that.

My questions on the errors:
-could not get custom images from storage account
>Why is it looking for a custom image and why in my storage account / container?  I’m
guessing this is part of the ARM project but not sure how to override this?  templateBuilder

-image with id /subscriptions/fed7f475-6055-4e3c-8529-c1345df70589/resourceGroups/Azure_Demos/providers/Microsoft.Compute/virtualMachines/CentOSVM
for virtualmachine /subscriptions/fed7f475-6055-4e3c-8529-c1345df70589/resourceGroups/Azure_Demos/providers/Microsoft.Compute/virtualMachines/CentOSVM
was not found
>CentOSVM is a machine I created long ago.  Not sure why it’s looking for it or trying
to do anything with it.

-Multiple entries with same key
>Not sure what this means.  The only time I’ve seen key mentioned in the documentation
is in relation to SSH keys.

< could not get custom images from storage account StorageService{id=/subscriptions/fed7f475-6055-4e3c-8529-c1345df70589/resourceGroups/azure_demos/providers/Microsoft.Storage/storageAccounts/azuredemosdisks998,
name=azuredemosdisks998, location=eastus, tags={}, type=Microsoft.Storage/storageAccounts,
storageServiceProperties=StorageServiceProperties{accountType=Premium_LRS, creationTime=Thu
Nov 03 07:33:34 EDT 2016, primaryEndpoints={blob=https://azuredemosdisks998.blob.core.windows.net/},
primaryLocation=eastus, provisioningState=Succeeded, secondaryEndpoints=null, secondaryLocation=null,
statusOfPrimary=Available, statusOfSecondary=null}}: request: HEAD https://azuredemosdisks998.blob.core.windows.net/system?restype=container
HTTP/1.1 failed with response: HTTP/1.1 403 Server failed to authenticate the request. Make
sure the value of Authorization header is formed correctly including the signature.
<<   matched image(eastasia/Canonical/UbuntuServer/14.04.5-LTS) hardware(Standard_A0)
>> running 1 node group(myvmlabel) location(eastasia) image(eastasia/Canonical/UbuntuServer/14.04.5-LTS)
hardwareProfile(Standard_A0) options({scriptPresent=true})
>> image with id /subscriptions/fed7f475-6055-4e3c-8529-c1345df70589/resourceGroups/Azure_Demos/providers/Microsoft.Compute/virtualMachines/CentOSVM
for virtualmachine /subscriptions/fed7f475-6055-4e3c-8529-c1345df70589/resourceGroups/Azure_Demos/providers/Microsoft.Compute/virtualMachines/CentOSVM
was not found. This might be because the image that was used to create the virtualmachine
has a new id.
error: Multiple entries with same key: Standard_A0={id=Standard_A0, providerId=Standard_A0,
name=Standard_A0, location={scope=REGION, id=southeastasia, description=Southeast Asia, parent=azurecompute-arm,
iso3166Codes=[SG]}, processors=[{cores=1.0, speed=2.0}], ram=768, volumes=[{type=LOCAL, size=20480.0,
bootDevice=false, durable=false}, {type=LOCAL, size=1047552.0, bootDevice=false, durable=false}],
supportsImage=ALWAYS_TRUE, userMetadata={maxDataDiskCount=1}} and Standard_A0={id=Standard_A0,
providerId=Standard_A0, name=Standard_A0, location={scope=REGION, id=eastasia, description=East
Asia, parent=azurecompute-arm, iso3166Codes=[HK]}, processors=[{cores=1.0, speed=2.0}], ram=768,
volumes=[{type=LOCAL, size=20480.0, bootDevice=false, durable=false}, {type=LOCAL, size=1047552.0,
bootDevice=false, durable=false}], supportsImage=ALWAYS_TRUE, userMetadata={maxDataDiskCount=1}}

From: Ignasi Barrera [mailto:nacx@apache.org]
Sent: Saturday, January 7, 2017 5:17 AM
To: user@jclouds.apache.org
Subject: Re: Example end-to-end walkthrough?

Good to see you progressed!

You're almost there. The error you are getting is because the Azure ARM provider needs some
additional configuration properties.

As you might have already seen, when creating the jclouds context you can pass a set of configuration
properties. This is done here [1] in the compute-basics example app, but jclouds also loads
them from the system properties. You could use this to pass the additional properties when
executing the jar file.

The additional properties you need to set are:

* azurecompute-arm.endpoint (because the endpoint is not fixed as it contains the subscription
* oauth.endpoint (because it is not fixed as it contains the tenant id).

You can follow the steps described in the Azure ARM README [2] to create an application you
can use for jclouds. Once you have it, you should be able to run the examples with a command
similar to:

java  -Dazurecompute-arm.endpoint="https://management.azure.com/subscriptions/<Subscription-id>"
    -Doauth.endpoint="https://login.microsoftonline.com/<Tenant-id>/oauth2/token" \
    -jar target/compute-basics-jar-with-dependencies.jar \
    azurecompute-arm <Application-Id> <Password> mygroup add


P.S. If you want to contribute or help improve the jclouds site, you can have a look at our
"How to contribute documentation" guide [3]. Also, it would be great if you could add, once
you manage to run the examples with Azure, the example command to the compute-basics README
[4]. That will help other future users.

[1] https://github.com/jclouds/jclouds-examples/blob/master/compute-basics/src/main/java/org/jclouds/examples/compute/basics/MainApp.java#L267-L271
[2] https://github.com/jclouds/jclouds-labs/tree/master/azurecompute-arm#setting-up-test-credentials
[3] https://cwiki.apache.org/confluence/display/JCLOUDS/How+to+Contribute+Documentation
[4] https://github.com/jclouds/jclouds-examples/blob/master/compute-basics/README.md

On 6 January 2017 at 23:42, Teo De Las Heras <teodelas@microsoft.com<mailto:teodelas@microsoft.com>>
I'm getting an error (below) and following up with the creators of the azurecompute-arm libraries.

Documentation feedback: I'd be happy to write up / contribute a 'jclouds for dummies' page.
 I'm sure it's easy for someone who understands or works with Maven / Java projects.  Without
that background, it's hard to decipher how all the pieces work together.  Or maybe some additional
links to relevant Maven documentation that explains what mvn install does, what pom.xml is
for, how to add dependencies (to use jclouds-labs).

Error I'm getting:
java -jar target/compute-basics-jar-with-dependencies.jar azurecompute-arm <my application
id> <mypassword> mygroup add
>> initializing {id=azurecompute-arm, name=Microsoft Azure Resource Manager REST API,
views=[org.jclouds.compute.ComputeServiceContext], endpointName=Resource Manager Endpoint
ending in your Subscription Id, identityName=Azure Service Principal Application Id, credentialName=Optional.of(Azure
Service Principal Application Password), documentation=https://msdn.microsoft.com/en-us/library/azure/dn790568.aspx,
api=interface org.jclouds.azurecompute.arm.AzureComputeApi}
Exception in thread "main" com.google.inject.CreationException: Guice creation errors:

1) No implementation for java.lang.String annotated with @com.google.inject.name.Named(value=oauth.endpoint)
was bound.
  at org.jclouds.oauth.v2.config.OAuthModule.oauthEndpoint(OAuthModule.java:63)

1 error
        at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:435)
        at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:154)
        at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106)
        at com.google.inject.Guice.createInjector(Guice.java:95)
        at org.jclouds.ContextBuilder.buildInjector(ContextBuilder.java:405)
        at org.jclouds.ContextBuilder.buildInjector(ContextBuilder.java:328)
        at org.jclouds.ContextBuilder.buildView(ContextBuilder.java:615)
        at org.jclouds.ContextBuilder.buildView(ContextBuilder.java:595)
        at org.jclouds.examples.compute.basics.MainApp.initComputeService(MainApp.java:292)
        at org.jclouds.examples.compute.basics.MainApp.main(MainApp.java:141)


-----Original Message-----
From: Andrew Phillips [mailto:aphillips@qrmedia.com<mailto:aphillips@qrmedia.com>]
Sent: Friday, January 6, 2017 3:25 PM
To: user@jclouds.apache.org<mailto:user@jclouds.apache.org>
Subject: Re: Example end-to-end walkthrough?
> I was completely confused by being directed to the github for the
> azurecompute-arm as I thought that was an example I should be
> following.

Thanks for the update! Are things working now, or is there still something that's not doing
what it should?

Also, do you have any thoughts on what we could do to make the documentation clearer?


View raw message