Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E321A200BF7 for ; Mon, 9 Jan 2017 11:00:49 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E1B33160B3E; Mon, 9 Jan 2017 10:00:49 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 90609160B3B for ; Mon, 9 Jan 2017 11:00:48 +0100 (CET) Received: (qmail 68946 invoked by uid 500); 9 Jan 2017 10:00:47 -0000 Mailing-List: contact user-help@jclouds.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@jclouds.apache.org Delivered-To: mailing list user@jclouds.apache.org Received: (qmail 68937 invoked by uid 99); 9 Jan 2017 10:00:47 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jan 2017 10:00:47 +0000 Received: from mail-it0-f46.google.com (mail-it0-f46.google.com [209.85.214.46]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 549E51A0314 for ; Mon, 9 Jan 2017 10:00:47 +0000 (UTC) Received: by mail-it0-f46.google.com with SMTP id x2so59379521itf.1 for ; Mon, 09 Jan 2017 02:00:47 -0800 (PST) X-Gm-Message-State: AIkVDXJFKdm7/XdyMfPIScapwRbi8CNyVYnwwwfyeoNJfMHWSD2iqwDSmCuhP4KVjyzmGHpaLvTzxn9RK8Gqlg== X-Received: by 10.36.133.133 with SMTP id r127mr8027388itd.37.1483956046640; Mon, 09 Jan 2017 02:00:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.13.147 with HTTP; Mon, 9 Jan 2017 02:00:25 -0800 (PST) In-Reply-To: References: <7481800f5356b4914f5d75c6f937a2b8@qrmedia.com> <44f2e9ba7f85c80f3c6a9fb402279880@qrmedia.com> From: Ignasi Barrera Date: Mon, 9 Jan 2017 11:00:25 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Example end-to-end walkthrough? To: "user@jclouds.apache.org" Content-Type: multipart/alternative; boundary=94eb2c05bbf405c1f60545a67144 archived-at: Mon, 09 Jan 2017 10:00:50 -0000 --94eb2c05bbf405c1f60545a67144 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > > Thanks. I got the same suggestion from the team that created the ARM > project. I=E2=80=99ve almost got it running. How would I figure out wha= t > parameters are needed / what can be overwritten? Not sure how I would ha= ve > known to use -Dazurecompute-arm.endpoint. I see it in the > azurecompute-arm project but it=E2=80=99s not clearly spelled out that it= should be > added when calling the compute service API. > There are some common properties and some provider-specific ones. Unfortunately we don't have yet a page describing all the existing ones. You can find the common properties here: http://jclouds.apache.org/reference/javadoc/2.0.x/org/jclouds/Constants.htm= l The compute service specific properties here: http://jclouds.apache.org/reference/javadoc/2.0.x/org/jclouds/compute/confi= g/ComputeServiceProperties.html And each provider often has a constants class with all its particular properties. In the case of azurecompute-arm: https://github.com/jclouds/jclouds-labs/blob/master/azurecompute-arm/src/ma= in/java/org/jclouds/azurecompute/arm/config/AzureComputeProperties.java > > Another question on getting the project to run. I=E2=80=99m getting erro= rs 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? > This is an expected behaviour when you have existing virtual machines, and it is just a warning log message. The jclouds compute service has an ImageExtension that allows users to create images (or snapshots) of existing virtual machines. In Azure, those images are stored in the storage account of the virtual machine itself, and the only way to list them is to inspect the storage account of each existing VM. That's why the "listImages" operations tries to access each VM's storage account, and why you might see the warning message, if access there is denied. Under normal circumstances you can safely ignore that message. > Based on what I=E2=80=99m reading here, http://jclouds.apache.org/start/c= ompute/ > , 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 overri= de > the default location which seems to be eastasia? The azurecompute-arm > project says I can do jclouds.regions=3D"northeurope" but not sure where = to > put that. > There are two different things here. First, the "jclouds.regions" property is used to filter the regions jclouds will take into account. By default, jclouds will connect to each region and list images, VMs, etc, from all them. This can be time consuming, and probably you don't want to work with all existing regions. That property allows you to tell jclouds which regions you care about, so it does not try to connect and get information from the rest. If you don't set it, all regions will be considered by default. The other thing is about selecting the location where the VM will run. This can be set with the "templateBuilder.locationId" method, but if omitted, jclouds will select one location that is compatible with the selected image and hardware profile. AFAIK it is not the case of ARM, but some providers don't have all hardware profiles (and/or images) available in all regions, so jclouds makes sure to select a location where the selected image/hardware pair can run. > -Multiple entries with same key > > >Not sure what this means. The only time I=E2=80=99ve seen key mentioned= in the > documentation is in relation to SSH keys. > > > error: Multiple entries with same key: Standard_A0=3D{id=3DStandard_A0, > providerId=3DStandard_A0, name=3DStandard_A0, location=3D{scope=3DREGION, > id=3Dsoutheastasia, description=3DSoutheast Asia, parent=3Dazurecompute-a= rm, > iso3166Codes=3D[SG]}, processors=3D[{cores=3D1.0, speed=3D2.0}], ram=3D76= 8, > volumes=3D[{type=3DLOCAL, size=3D20480.0, bootDevice=3Dfalse, durable=3Df= alse}, > {type=3DLOCAL, size=3D1047552.0, bootDevice=3Dfalse, durable=3Dfalse}], > supportsImage=3DALWAYS_TRUE, userMetadata=3D{maxDataDiskCount=3D1}} and > Standard_A0=3D{id=3DStandard_A0, providerId=3DStandard_A0, name=3DStandar= d_A0, > location=3D{scope=3DREGION, id=3Deastasia, description=3DEast Asia, > parent=3Dazurecompute-arm, iso3166Codes=3D[HK]}, processors=3D[{cores=3D1= .0, > speed=3D2.0}], ram=3D768, volumes=3D[{type=3DLOCAL, size=3D20480.0, bootD= evice=3Dfalse, > durable=3Dfalse}, {type=3DLOCAL, size=3D1047552.0, bootDevice=3Dfalse, > durable=3Dfalse}], supportsImage=3DALWAYS_TRUE, userMetadata=3D{ > maxDataDiskCount=3D1}} > This is the first time I see this error. Do you have a complete stacktrace? HTH! > > > > > > > *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 id). > * 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=3D"https://management.azure.com/ > subscriptions/" \ > -Doauth.endpoint=3D"https://login.microsoftonline.com//oau= th2/token" > \ > -jar target/compute-basics-jar-with-dependencies.jar \ > > azurecompute-arm mygroup add > > > HTH! > > > > 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 he= lp > 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 > wrote: > > 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 wor= ks > with Maven / Java projects. Without that background, it's hard to deciph= er > 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 mygroup add > >> initializing {id=3Dazurecompute-arm, name=3DMicrosoft Azure Resource > Manager REST API, views=3D[org.jclouds.compute.ComputeServiceContext], > endpointName=3DResource Manager Endpoint ending in your Subscription Id, > identityName=3DAzure Service Principal Application Id, > credentialName=3DOptional.of(Azure Service Principal Application Password= ), > documentation=3Dhttps://msdn.microsoft.com/en-us/library/azure/dn790568.a= spx, > api=3Dinterface 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=3Doauth.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) > > > Teo > > > > -----Original Message----- > From: Andrew Phillips [mailto:aphillips@qrmedia.com] > Sent: Friday, January 6, 2017 3:25 PM > To: 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 somethin= g > that's not doing what it should? > > Also, do you have any thoughts on what we could do to make the > documentation clearer? > > ap > > > --94eb2c05bbf405c1f60545a67144 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Thanks.=C2=A0 I got= the same suggestion from the team that created the ARM project.=C2=A0 I=E2= =80=99ve almost got it running.=C2=A0 How would I figure out what parameter= s are needed / what can be overwritten?=C2=A0 Not sure how I would have known to use -Dazureco= mpute-arm.endpoint.=C2=A0 I see it in the azurecompute-arm project but it= =E2=80=99s not clearly spelled out that it should be added when calling the= compute service API.


There= are some common properties and some provider-specific ones. Unfortunately = we don't have yet a page describing all the existing ones.
And each p= rovider often has a constants class with all its particular properties. In = the case of azurecompute-arm:=C2=A0https://github.com/jclouds/jclo= uds-labs/blob/master/azurecompute-arm/src/main/java/org/jclouds/azurecomput= e/arm/config/AzureComputeProperties.java
=C2=A0

=


Another question on getting the project to run.=C2= =A0 I=E2=80=99m getting errors below about not finding images in default st= orage account and machine not found.=C2=A0 I think I probably need to modif= y the code in the MainApp.Java, yes?=C2=A0


This is an expected behaviour when you have existing virtua= l machines, and it is just a warning log message. The jclouds compute servi= ce has an ImageExtension that allows users to create images (or snapshots) = of existing virtual machines. In Azure, those images are stored in the stor= age account of the virtual machine itself, and the only way to list them is= to inspect the storage account of each existing VM. That's why the &qu= ot;listImages" operations tries to access each VM's storage accoun= t, and why you might see the warning message, if access there is denied. Un= der normal circumstances you can safely ignore that message.
=C2= =A0

Based on what I=E2=80=99m reading here, http://jclouds.apache.org/start/compute/ , I think I should modify= the templateBuilder object to get around the errors below?=C2=A0 Just not = sure what to enter.=C2=A0 For example, how do I override the default locati= on which seems to be eastasia?=C2=A0=C2=A0=C2=A0 The azurecompute-arm project says I can do jclouds.regions=3D"northeurope" but not sure wher= e to put that.


There= are two different things here.

First, the "j= clouds.regions" property is used to filter the regions jclouds will ta= ke into account. By default, jclouds will connect to each region and list i= mages, VMs, etc, from all them. This can be time consuming, and probably yo= u don't want to work with all existing regions. That property allows yo= u to tell jclouds which regions you care about, so it does not try to conne= ct and get information from the rest. If you don't set it, all regions = will be considered by default.

The other thing is = about selecting the location where the VM will run. This can be set with th= e "templateBuilder.locationId" method, but if omitted, jclouds wi= ll select one location that is compatible with the selected image and hardw= are profile. AFAIK it is not the case of ARM, but some providers don't = have all hardware profiles (and/or images) available in all regions, so jcl= ouds makes sure to select a location where the selected image/hardware pair= can run.
=C2=A0

-Multiple entries with same key

>Not sure what this means.=C2=A0 The only time I= =E2=80=99ve seen key mentioned in the documentation is in relation to SSH k= eys.


error: Multiple entries with same key: Standard_A0= =3D{id=3DStandard_A0, providerId=3DStandard_A0, name=3DStandard_A0, locatio= n=3D{scope=3DREGION, id=3Dsoutheastasia, description=3DSoutheast Asia, pare= nt=3Dazurecompute-arm, iso3166Codes=3D[SG]}, processors=3D[{cores=3D1.0, speed=3D2.0}], ram=3D768, volumes=3D[{type=3DLOCAL, size=3D20480.0, bootDe= vice=3Dfalse, durable=3Dfalse}, {type=3DLOCAL, size=3D1047552.0, bootDevice= =3Dfalse, durable=3Dfalse}], supportsImage=3DALWAYS_TRUE, userMetadata=3D{<= wbr>maxDataDiskCount=3D1}} and Standard_A0=3D{id=3DStandard_A0, providerId= =3DStandard_A0, name=3DStandard_A0, location=3D{scope=3DREGION, id=3Deastasia, description= =3DEast Asia, parent=3Dazurecompute-arm, iso3166Codes=3D[HK]}, processors= =3D[{cores=3D1.0, speed=3D2.0}], ram=3D768, volumes=3D[{type=3DLOCAL, size= =3D20480.0, bootDevice=3Dfalse, durable=3Dfalse}, {type=3DLOCAL, size=3D104= 7552.0, bootDevice=3Dfalse, durable=3Dfalse}], supportsImage=3DALWAYS_TRUE, userMe= tadata=3D{maxDataDiskCount=3D1}}


=
This is the first time I see this error. Do you have a complete = stacktrace?


HTH!

=C2=A0

=C2=A0

=C2=A0

=C2=A0

From: Ignasi Barrera [mailto:nacx@apache.org]
Sent: Saturday, January 7, 2017 5:17 AM


To: use= r@jclouds.apache.org
Subject: Re: Example end-to-end walkthrough?

=C2=A0

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 p= ass 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 contai= ns the subscription id).
* 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 =C2=A0-Dazurecompute-arm.endpoint=3D"https://management.azure= .com/subscriptions/<Subscription-id>" \
=C2=A0 =C2=A0 -Doauth.endpoint=3D"https://login.microsoftonline.com/<= ;Tenant-id>/oauth2/token" \
=C2=A0 =C2=A0 -jar target/compute-basics-jar-with-dependencies.jar \

=C2=A0 =C2=A0 azurecompute-arm <Application-Id>= ; <Password> mygroup add


HTH!

=C2=A0

P.S. If you want to contribute or help improve the j= clouds site, you can have a look at our "How to contribute documentati= on" guide [3]. Also, it would be great if you could add, once you mana= ge to run the examples with Azure, the example command to the compute-basics README [4]. That will help other future user= s.

=C2=A0

On 6 January 2017 at 23:42, Teo De Las Heras <teodelas@microsoft= .com> wrote:

I'm getting an erro= r (below) and following up with the creators of the azurecompute-arm librar= ies.

Documentation feedback: I'd be happy to write up / contribute a 'jc= louds for dummies' page.=C2=A0 I'm sure it's easy for someone w= ho understands or works with Maven / Java projects.=C2=A0 Without that back= ground, it's hard to decipher how all the pieces work together.=C2=A0 Or maybe some additional links to relevant Maven documentation that explai= ns 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=3Dazurecompute-arm, name=3DMicrosoft Azure Resour= ce Manager REST API, views=3D[org.jclouds.compute.ComputeServiceContex= t], endpointName=3DResource Manager Endpoint ending in your Subscription Id= , identityName=3DAzure Service Principal Application Id, credentialName=3DOptional.of(Azure Service Principal Application = Password), documentation=3Dhttps://msdn.microsoft.com/= en-us/library/azure/dn790568.aspx, api=3Dinterface org.jclouds.azurecompute.arm.AzureComputeApi}
Exception in thread "main" com.google.inject.CreationExcepti= on: Guice creation errors:

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

1 error
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.google.inject.internal.Errors.= throwCreationExceptionIfErrorsExist(Errors.java:435)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.google.inject.internal.InternalInje= ctorCreator.initializeStatically(InternalInjectorCreator.java:154)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.google.inject.internal.InternalInje= ctorCreator.build(InternalInjectorCreator.java:106)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.google.inject.Guice.createInjector(= Guice.java:95)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.jclouds.ContextBuilder.buildInjecto= r(ContextBuilder.java:405)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.jclouds.ContextBuilder.buildInjecto= r(ContextBuilder.java:328)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.jclouds.ContextBuilder.buildView(Co= ntextBuilder.java:615)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.jclouds.ContextBuilder.buildView(Co= ntextBuilder.java:595)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.jclouds.examples.compute.basics.Mai= nApp.initComputeService(MainApp.java:292)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.jclouds.examples.compute.basics.Mai= nApp.main(MainApp.java:141)


Teo



-----Original Message-----
From: Andrew Phillips [mailto= :aphillips@qrmed= ia.com]
Sent: Friday, January 6, 2017= 3:25 PM
To: user@jclouds.apache.org
Subject: Re: Example end-to-e= nd 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 documentatio= n clearer?

ap

=C2=A0


--94eb2c05bbf405c1f60545a67144--