[ 
https://issues.apache.org/jira/browse/JCLOUDS-570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14018601#comment-14018601
 ] 

Ignasi Barrera commented on JCLOUDS-570:
----------------------------------------

Do we know why the image does not appear when listing?

jclouds uses a cache to store the images. Getting the list of images can be 
quite an expensive and very time consuming operation in some providers (AWS is 
an example), and jclouds tries to minimize the time it takes to operate with 
them by storing the existing images in an internal cache.

When you use the {{TemplateBuilder}} to find an image, it uses that image cache 
to try find an image that matches the given spec. When the id is provided, it 
also tries to [find the image in the 
cache|https://github.com/jclouds/jclouds/blob/master/compute/src/main/java/org/jclouds/compute/domain/internal/TemplateBuilderImpl.java#L687].

The workaround here should be to address a couple of TODOs in the code and 
change the [findImageWithId and findHardwareWithId 
methods|https://github.com/jclouds/jclouds/blob/master/compute/src/main/java/org/jclouds/compute/domain/internal/TemplateBuilderImpl.java#L729-L746]
 to use the configured strategy to fetch the entities.

That strategy performs a single call to the provider to get the details of a 
single image/hardware. The implementation, though, is up to the provider. If 
there is no "get by id" call available, it might be generating a "list all" 
call. This is just a side effect: getting images by id might perform additional 
calls if the image is not present in the cache, but it would be the right way 
to fix it.

> Cannot instantiate server using image-id on Rackspace/Nova
> ----------------------------------------------------------
>
>                 Key: JCLOUDS-570
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-570
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-compute
>    Affects Versions: 1.7.1
>         Environment: This is using the clojure API from Pallet
>            Reporter: Antoni Batchelli
>             Fix For: 1.8.0, 1.7.4
>
>
> There is this CoreOS image that we want to provision with jclouds: 
> [70210a69-081e-4a5e-b402-3cdbabfdcddd|https://coreos.com/docs/running-coreos/cloud-providers/rackspace/]
>  . When trying to instantiate a server with this image, jclouds returns an 
> error saying the image is not found, but we are able to create such servers 
> via 
> [rackspace-supernova|http://docs.rackspace.com/servers/api/v2/cs-gettingstarted/content/section_gs_install_nova.html].
>  
> We noticed something odd that seems could be the cause: when using nova to 
> query the list of images, the above image is not listed.  But then we are 
> able to query for details of this image, and and the image is correctly found 
> and the details are available (see below). From this, it would seem like 
> jclouds is trying to verify the image-id with the list of images provided by 
> rackspace, and since this image is not listed by default, jclouds throws an 
> error.
> {code}
> [~] ➔ nova image-list
> +--------------------------------------+----------------------------------------------------------------------------------------------+--------+--------+
> | ID                                   | Name                                 
>                                                         | Status | Server |
> +--------------------------------------+----------------------------------------------------------------------------------------------+--------+--------+
> | 8a605fb2-57c5-43eb-9bd3-4f990802e478 | Arch 2014.4 (PVHVM)                  
>                                                         | ACTIVE |        |
> | 9522c27d-51d9-44ee-8eb3-fb7b14fd4042 | CentOS 5.10                          
>                                                         | ACTIVE |        |
> | 042395fc-728c-4763-86f9-9b0cacb00701 | CentOS 6.5                           
>                                                         | ACTIVE |        |
> | 592c879e-f37d-43e6-8b54-8c2d97cf04d4 | CentOS 6.5 (PVHVM)                   
>                                                         | ACTIVE |        |
> | 695ca76e-fc0d-4e36-82e0-8ed66480a999 | Debian 6.06 (Squeeze)                
>                                                         | ACTIVE |        |
> | 77e32de8-3304-44f3-b230-436d95fceb19 | Debian 7 (Wheezy) (PVHVM)            
>                                                         | ACTIVE |        |
> | 4b81c45a-90d6-4654-972c-73972b1d0aea | Fedora 19 (Schrodinger's Cat) 
> (PVHVM)                                                        | ACTIVE |     
>    |
> | c21acd84-a6c5-44df-ba7d-2483cd5b3ccb | Fedora 20 (Heisenbug) (PVHVM)        
>                                                         | ACTIVE |        |
> | e5d7ca78-a487-4d7e-9dd1-73165df3f9fd | FreeBSD 10.0                         
>                                                         | ACTIVE |        |
> | 6c031e2c-0d2c-4fa0-aadb-70265957a37d | Gentoo 14.2 (PVHVM)                  
>                                                         | ACTIVE |        |
> | 6ae8a615-57f1-4a19-83d4-e09f8ae25327 | OpenSUSE 13.1 (PVHVM)                
>                                                         | ACTIVE |        |
> | 56ad2db2-d9cd-462e-a2a4-7f3a4fc91ee8 | Red Hat Enterprise Linux 5.10        
>                                                         | ACTIVE |        |
> | d1b6eba3-aece-407c-8ef3-4488b452336b | Red Hat Enterprise Linux 6.5         
>                                                         | ACTIVE |        |
> | 271e1090-77ad-4400-a1f7-73a922aca8e2 | Red Hat Enterprise Linux 6.5 (PVHVM) 
>                                                         | ACTIVE |        |
> | dbb59b04-bd50-4eef-b05e-6a6451ef9bf2 | Scientific Linux 6.5 (PVHVM)         
>                                                         | ACTIVE |        |
> | aab63bcf-89aa-440f-b0c7-c7a1c611914b | Ubuntu 10.04 LTS (Lucid Lynx)        
>                                                         | ACTIVE |        |
> | ffa476b1-9b14-46bd-99a8-862d1d94eb7a | Ubuntu 12.04 LTS (Precise Pangolin)  
>                                                         | ACTIVE |        |
> | a4286a42-137c-46ce-a796-dbd2b12a078c | Ubuntu 12.04 LTS (Precise Pangolin) 
> (PVHVM)                                                  | ACTIVE |        |
> | 7b8abc3f-5fd2-4d02-9e9a-16d43fc7128e | Ubuntu 13.10 (Saucy Salamander)      
>                                                         | ACTIVE |        |
> | aca656d3-dd70-4d7e-a9e5-f12182871cde | Ubuntu 13.10 (Saucy Salamander) 
> (PVHVM)                                                      | ACTIVE |       
>  |
> | 5cc098a5-7286-4b96-b3a2-49f4c4f82537 | Ubuntu 14.04 LTS (Trusty Tahr)       
>                                                         | ACTIVE |        |
> | bb02b1a3-bc77-4d17-ab5b-421d89850fca | Ubuntu 14.04 LTS (Trusty Tahr) 
> (PVHVM)                                                       | ACTIVE |      
>   |
> | 59b394f6-b2e0-4f11-b7d1-7fea4abc60a0 | Vyatta Network OS 6.5R2              
>                                                         | ACTIVE |        |
> | 8f39aeb0-79d6-45eb-9505-fb0bf31556d7 | Windows Server 2008 R2 SP1           
>                                                         | ACTIVE |        |
> | 2d4ee06e-d567-47f8-b745-8d281fe5729a | Windows Server 2008 R2 SP1 (base 
> install without updates)                                    | ACTIVE |        
> |
> | 427f2199-c441-4bff-95e0-4cba19b8839d | Windows Server 2008 R2 SP1 + SQL 
> Server 2008 R2 SP2 Standard                                 | ACTIVE |        
> |
> | d1519521-bb03-42ce-b25c-34b72f10cc26 | Windows Server 2008 R2 SP1 + SQL 
> Server 2008 R2 SP2 Web                                      | ACTIVE |        
> |
> | cf44eaf2-844a-4bc5-af91-e7ceb021cac9 | Windows Server 2008 R2 SP1 + SQL 
> Server 2012 SP1 Standard                                    | ACTIVE |        
> |
> | 0d58b7da-0664-4a71-b89f-68115771a948 | Windows Server 2008 R2 SP1 + SQL 
> Server 2012 SP1 Web                                         | ACTIVE |        
> |
> | 9f8329b4-1985-4be0-b263-31e728a046fc | Windows Server 2008 R2 SP1 + 
> SharePoint 2010 Foundation with SQL Server 2008 R2 Express      | ACTIVE |    
>     |
> | fe2162fe-8d3c-4c1d-8b83-71ff09321fb2 | Windows Server 2008 R2 SP1 + 
> SharePoint 2010 Foundation with SQL Server 2008 R2 SP1 Standard | ACTIVE |    
>     |
> | c50f70fc-79ec-4c71-bd4a-a4ac8f1641e1 | Windows Server 2012                  
>                                                         | ACTIVE |        |
> | c30b4407-da75-4291-a1fb-edd8e6e037de | Windows Server 2012 (base install 
> without updates)                                           | ACTIVE |        |
> | ecd8f832-299c-4711-9763-06f81cf3058a | Windows Server 2012 + SQL Server 
> 2012 SP1 Standard                                           | ACTIVE |        
> |
> | 5906d9c5-7a3a-437f-872a-51b0db539f9b | Windows Server 2012 + SQL Server 
> 2012 SP1 Web                                                | ACTIVE |        
> |
> | 51ddbe81-9e2b-492f-a031-a3577bf1016a | Windows Server 2012 + SharePoint 
> 2013 with SQL Server 2012 SP1 Standard                      | ACTIVE |        
> |
> +--------------------------------------+----------------------------------------------------------------------------------------------+--------+--------+
> [~] ➔ nova image-show 70210a69-081e-4a5e-b402-3cdbabfdcddd
> +------------------------------------------------+--------------------------------------+
> | Property                                       | Value                      
>           |
> +------------------------------------------------+--------------------------------------+
> | OS-DCF:diskConfig                              | MANUAL                     
>           |
> | OS-EXT-IMG-SIZE:size                           | 190454169                  
>           |
> | created                                        | 2014-05-09T15:58:43Z       
>           |
> | id                                             | 
> 70210a69-081e-4a5e-b402-3cdbabfdcddd |
> | metadata auto_disk_config                      | disabled                   
>           |
> | metadata cache_in_nova                         | True                       
>           |
> | metadata com.rackspace__1__build_core          | 1                          
>           |
> | metadata com.rackspace__1__build_managed       | 0                          
>           |
> | metadata com.rackspace__1__build_rackconnect   | 0                          
>           |
> | metadata com.rackspace__1__options             | 0                          
>           |
> | metadata com.rackspace__1__platform_target     | PublicCloud                
>           |
> | metadata com.rackspace__1__release_build_date  | 2014-05-09_15-53-20        
>           |
> | metadata com.rackspace__1__release_version     | 8                          
>           |
> | metadata com.rackspace__1__source              | kickstart                  
>           |
> | metadata com.rackspace__1__visible_core        | 1                          
>           |
> | metadata com.rackspace__1__visible_managed     | 0                          
>           |
> | metadata com.rackspace__1__visible_rackconnect | 0                          
>           |
> | metadata image_type                            | base                       
>           |
> | metadata org.openstack__1__architecture        | x64                        
>           |
> | metadata org.openstack__1__os_distro           | coreos                     
>           |
> | metadata org.openstack__1__os_version          | 0                          
>           |
> | metadata os_distro                             | coreos                     
>           |
> | metadata os_type                               | linux                      
>           |
> | metadata vm_mode                               | hvm                        
>           |
> | minDisk                                        | 20                         
>           |
> | minRam                                         | 512                        
>           |
> | name                                           | CoreOS                     
>           |
> | progress                                       | 100                        
>           |
> | status                                         | ACTIVE                     
>           |
> | updated                                        | 2014-05-09T15:59:01Z       
>           |
> +------------------------------------------------+--------------------------------------+
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to