You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by Shital Patil <sh...@gslab.com> on 2014/04/11 06:18:13 UTC

Error while using glance

Hi,

I tried using jclouds glance labs 1.7.0 and attempted listing existing
images but it throws some exception which is exactly similar  to one
previously posted -

http://mail-archives.apache.org/mod_mbox/jclouds-notifications/201403.mbox/%3Cjclouds/jclouds-labs-openstack/pull/82/c37546349@github.com%3E

my code is
glanceApi = ContextBuilder.newBuilder(provider)
        .credentials(identity, password)

        .endpoint("http://enpoint ip/v2.0/")
        .modules(modules)
        .buildApi(GlanceApi.class);

ImageApi imageApi = glanceApi.getImageApiForZone("RegionOne");
        System.out.println(imageApi.listInDetail().concat());

I basically need image upload and download functionality from glance

Thank you

Re: Error while using glance

Posted by Shital Patil <sh...@gslab.com>.
I used curl to upload image to my devstack setup and it works perfectly
fine so there is quite possibility to have issue with jclouds glance
upload.  I need the image upload and download functionality urgently.
Please tell if any specific environment need is there for image upload and
download. I have also tried with increased JVM and eclipse memory.

Thank you


On Sat, Apr 12, 2014 at 8:16 PM, Shital Patil <sh...@gslab.com>wrote:

> Wire log just shows some random hex numbers. I thought they may be bytes
> of image being uploaded.
>  I observed stack screen but it does not show any activity when uploading
> with jclouds but when I do direct upload through horizon it enlists some
> calls to various python clients
>
> (/opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:909
> /opt/stack/glance/glance/common/client.py:411)
>
> After waiting for half an hour the status of image is still queued and not
> active
>
>
> On Fri, Apr 11, 2014 at 8:06 PM, Everett Toews <
> everett.toews@rackspace.com> wrote:
>
>> On Apr 11, 2014, at 9:11 AM, Shital Patil <sh...@gslab.com> wrote:
>>
>> > It doe not throw exception when I call upload/create image API, the
>>  call returns with image ID but when I log in to horizon the status of imge
>> over there is queuing(image is being queued)  and it never shows active
>> status. However when I upload image through horizon dashboard with create
>> image tab , it successfully gets uploaded. Why there is problem while
>> uploading through API then? Can it be problem with my devstack setup?
>>
>> That's definitely a possibility. 2 things.
>>
>> 1. You'll want to enable Logging [1] for jclouds so you can see exactly
>> how it's communicating with Glance.
>>
>> 2. You'll want to go into your DevStack screen session (screen -r stack)
>> and look at the screens that start with "g-". Those are the Glance
>> services. The output is effectively their logs.
>>
>> Between the jclouds logs and the Glance logs hopefully you'll be able to
>> work out what's wrong. See what the difference is between when you use
>> Horizon and when you use jclouds.
>>
>> HTH,
>> Everett
>>
>> [1] http://jclouds.apache.org/reference/logging/
>
>
>

Re: Error while using glance

Posted by Shital Patil <sh...@gslab.com>.
Wire log just shows some random hex numbers. I thought they may be bytes of
image being uploaded.
 I observed stack screen but it does not show any activity when uploading
with jclouds but when I do direct upload through horizon it enlists some
calls to various python clients
(/opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:909
/opt/stack/glance/glance/common/client.py:411)

After waiting for half an hour the status of image is still queued and not
active


On Fri, Apr 11, 2014 at 8:06 PM, Everett Toews
<ev...@rackspace.com>wrote:

> On Apr 11, 2014, at 9:11 AM, Shital Patil <sh...@gslab.com> wrote:
>
> > It doe not throw exception when I call upload/create image API, the
>  call returns with image ID but when I log in to horizon the status of imge
> over there is queuing(image is being queued)  and it never shows active
> status. However when I upload image through horizon dashboard with create
> image tab , it successfully gets uploaded. Why there is problem while
> uploading through API then? Can it be problem with my devstack setup?
>
> That's definitely a possibility. 2 things.
>
> 1. You'll want to enable Logging [1] for jclouds so you can see exactly
> how it's communicating with Glance.
>
> 2. You'll want to go into your DevStack screen session (screen -r stack)
> and look at the screens that start with "g-". Those are the Glance
> services. The output is effectively their logs.
>
> Between the jclouds logs and the Glance logs hopefully you'll be able to
> work out what's wrong. See what the difference is between when you use
> Horizon and when you use jclouds.
>
> HTH,
> Everett
>
> [1] http://jclouds.apache.org/reference/logging/

Re: Error while using glance

Posted by Everett Toews <ev...@RACKSPACE.COM>.
On Apr 11, 2014, at 9:11 AM, Shital Patil <sh...@gslab.com> wrote:

> It doe not throw exception when I call upload/create image API, the  call returns with image ID but when I log in to horizon the status of imge over there is queuing(image is being queued)  and it never shows active status. However when I upload image through horizon dashboard with create image tab , it successfully gets uploaded. Why there is problem while uploading through API then? Can it be problem with my devstack setup?

That’s definitely a possibility. 2 things.

1. You’ll want to enable Logging [1] for jclouds so you can see exactly how it’s communicating with Glance.

2. You’ll want to go into your DevStack screen session (screen -r stack) and look at the screens that start with “g-“. Those are the Glance services. The output is effectively their logs. 

Between the jclouds logs and the Glance logs hopefully you’ll be able to work out what’s wrong. See what the difference is between when you use Horizon and when you use jclouds.

HTH,
Everett

[1] http://jclouds.apache.org/reference/logging/

Re: Error while using glance

Posted by Shital Patil <sh...@gslab.com>.
It doe not throw exception when I call upload/create image API, the  call
returns with image ID but when I log in to horizon the status of imge over
there is queuing(image is being queued)  and it never shows active status.
However when I upload image through horizon dashboard with create image tab
, it successfully gets uploaded. Why there is problem while uploading
through API then? Can it be problem with my devstack setup?


On Fri, Apr 11, 2014 at 7:15 PM, Andrew Phillips <an...@apache.org> wrote:

> I tried with version 1.8 it lists images but when I try image upload and
>> create from ISO on my local machine its status on openstack is always
>> queued
>>
>
> Could you explain that in a little more detail? What is the
> result/exception you are getting?
>
> ap
>

Re: Error while using glance

Posted by Andrew Phillips <an...@apache.org>.
> I tried with version 1.8 it lists images but when I try image upload and
> create from ISO on my local machine its status on openstack is always queued

Could you explain that in a little more detail? What is the  
result/exception you are getting?

ap

Re: Error while using glance

Posted by Shital Patil <sh...@gslab.com>.
I tried with version 1.8 it lists images but when I try image upload and
create from ISO on my local machine its status on openstack is always queued
.
Here's the code-

private void uploadImage(){
         System.out.println("Uploading ..\n");
         //StringPayload imageData = new StringPayload("This isn't an
image!");
         File imageFile = new File("C:\\ubuntu-12.04-server-i386");
         FilePayload payload = new FilePayload(imageFile);
         ImageApi imageApi = glanceApi.getImageApiForZone("RegionOne");
         ImageDetails details = imageApi.reserve("ubuntu server",
diskFormat(DiskFormat.ISO), containerFormat(ContainerFormat.BARE));
         details = imageApi.upload(details.getId(), payload,
UpdateImageOptions.Builder.name("ubuntu server"),
UpdateImageOptions.Builder.minDisk(10));
         System.out.println("Uploaded.."+details.getName());

         Image fromListing = Iterables.getOnlyElement(imageApi.list(
ListImageOptions.Builder.name
("jclouds-live-res-test2").limit(2).containerFormat(ContainerFormat.BARE)));
         System.out.println("Image ID"+fromListing.getId());
    }


On Fri, Apr 11, 2014 at 9:57 AM, Andrew Phillips <an...@apache.org> wrote:

> I tried using jclouds glance labs 1.7.0 and attempted listing existing
>> images but it throws some exception which is exactly similar  to one
>> previously posted -
>>
>
> According to the issue [1], endpoint negotiation should be working on
> 1.8.0-SNAPSHOT. Can you try that version [2] to let us know if it works for
> you?
>
> ap
>
> [1] https://issues.apache.org/jira/browse/JCLOUDS-494
> [2] http://jclouds.apache.org/start/install/ (section "Using the daily
> builds)
>

Re: Error while using glance

Posted by Andrew Phillips <an...@apache.org>.
> I tried using jclouds glance labs 1.7.0 and attempted listing existing
> images but it throws some exception which is exactly similar  to one
> previously posted -

According to the issue [1], endpoint negotiation should be working on  
1.8.0-SNAPSHOT. Can you try that version [2] to let us know if it  
works for you?

ap

[1] https://issues.apache.org/jira/browse/JCLOUDS-494
[2] http://jclouds.apache.org/start/install/ (section "Using the daily builds)