libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos Reategui (JIRA)" <>
Subject [jira] [Commented] (LIBCLOUD-439) Cloudstack list_nodes does not fill in image field
Date Thu, 14 Nov 2013 14:41:21 GMT


Carlos Reategui commented on LIBCLOUD-439:

Ah ok.  Looking at the list_images code for the Cloudstack driver we have most of the data
to recreate the NodeImage in the native listVirtualMachines api that is use to fulfill list_nodes.
 So how about something like this:

    image = NodeImage(
                    'hypervisor': vm['hypervisor']})

The only things missing would be format and os in extra.  Otherwise the right way is probably
to query the list of images before looping through the node with:
        if location is not None:
            args['zoneid'] =
        imgs = self._sync_request('listTemplates', **args)

then create a map with the NodeImages
        for img in imgs.get('template', []):
                    'hypervisor': img['hypervisor'],
                    'format': img['format'],
                    'os': img['ostypename']})

and finally assign it to the image with

Let me know which option you prefer and I can send a patch.

Also thinking of adding size to the node extra with the name of the size that the node is.

> Cloudstack list_nodes does not fill in image field
> --------------------------------------------------
>                 Key: LIBCLOUD-439
>                 URL:
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Compute
>    Affects Versions: 0.13.2
>         Environment: python 2.6
>            Reporter: Carlos Reategui
>            Priority: Trivial
> I made the following change but not sure if it is consistent with what other drivers
put in the image field:
> --- apache-libcloud-0.13.2/libcloud/compute/drivers/       2013-09-15 15:40:43.000000000
> +++       2013-11-14 04:05:26.000000000 +0000
> @@ -229,6 +229,7 @@
>                  public_ips=public_ips,
>                  private_ips=private_ips,
>                  driver=self,
> +                image=vm.get('templatename', None),
>                  extra={'zoneid': vm['zoneid'], }
>              )
> Another alternative could be templateid instead of templatename

This message was sent by Atlassian JIRA

View raw message