Hmm. Could you open a JIRA for this at https://issues.apache.org? I'll dig
into it.

A.

On Wed, Jul 31, 2013 at 4:44 PM, Mohan Baruwal Chhetri <
mohanbaru...@gmail.com> wrote:

> Hi,
>
> I am trying to create an instance on Ninefold using the JClouds API.
>
>         ComputeServiceContext computeServiceContext =
> ContextBuilder.newBuilder("ninefold-compute").
>                 credentials(identity, credentials).
>                 endpoint("https://api.ninefold.com/compute/v2.0";).
>                 modules(modules).
>                 overrides(p).
>                 buildView(ComputeServiceContext.class);
>         ComputeService computeService =
> computeServiceContext.getComputeService();
>
> I have changed the endpoint to point to the api version 2.0.
>
> I then create a template where I specify explicitly the imageId,
> locationId and hardwareId
>
> Template template = computeService.templateBuilder().options(tOptions).
>                 imageId("<Image-ID>").
>                 locationId("<Location-ID").
>                 hardwareId("Hardware-ID").build();
>
> However, when I try to create an image as follows:
>
>        try {
>             computeService.createNodesInGroup("mohan", 1, template);
>         } catch (RunNodesException ex) {
>
> Logger.getLogger(CloudStackSCBClient.class.getName()).log(Level.SEVERE,
> null, ex);
>         }
>
> I get an "imageId not found" exception.
>
> On examining the logs I see that the query to retrieve templates is as
> follows:
>
>
> https://api.ninefold.com/compute/v2.0?response=json&command=listTemplates&listAll=true&templatefilter=executable&apiKey=
>
> But in the CloudStackAPI, it says that we need to specify the project id
> as well in order to get details of the private templates. The above query
> retrieves only the public templates.
>
> How do I specify the CloudStack specific project id as part of my request?
> I've tried to use the CloudStackTemplateOptions where I specify the
> projectId as part of the user metadata as well as part of the properties
> that can be used to override the default properties when instantiating the
> ComputeServiceContext.
>
> I couldn't find any working example to show how to create instances on
> cloud infrastructure built using CloudStack.
>
> Any help would be appreciated.
>
> Cheers,
> Mohan
>

Reply via email to