Amin Alid created LIBCLOUD-675:
----------------------------------

             Summary: KeyError exception when using a custom compute offering 
in CloudStack
                 Key: LIBCLOUD-675
                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-675
             Project: Libcloud
          Issue Type: Bug
          Components: Compute
    Affects Versions: 0.13.3, 0.14.0-beta3, 0.13.2, 0.15.0, 0.15.1
         Environment: Cloudstack, cloudify
            Reporter: Amin Alid


It seems that the {{function list_sizes(self, location=None)}} defined in 
/libcloud/compute/drivers/cloudstack.py line ~ 1084 
expects the {{sz}} dictionary object to always have the key {{'cpunumber'}} 
set, however cloudstack have custom compute offers that do not have this value 
explicitly set.

This leads python to rise the KeyError exception:
{{KeyError: 'cpunumber'}}

And makes libcloud unusable in the case when cloudstack setup have a custom 
compute offering.

Deleting the custom compute offering fixes the issue.

An example normal compute offeting:
 {
      'iscustomized': False,
      'name': 'Large',
      'created': '2014-05-17T01:03:28+0200',
      'storagetype': 'shared',
      'limitcpuuse': True,
      'cpuspeed': 2000,
      'offerha': True,
      'isvolatile': False,
      'cpunumber': 8,
      'defaultuse': False,
      'memory': 16384,
      'displaytext': 'Large',
      'issystem': False,
      'id': '6dadbc20-2020-4980-af15-5ce3c247eft5',
      'tags': 'rbd'
    }

An example of a custom compute offering
    {
      'iscustomized': True,
      'name': 'Custom',
      'created': '2014-05-25T01:11:45+0200',
      'storagetype': 'shared',
      'limitcpuuse': False,
      'tags': 'rbd',
      'offerha': True,
      'isvolatile': False,
      'displaytext': 'Create VM with customized CPU and RAM sizes',
      'issystem': False,
      'id': '30030616-26f6-4dd0-8363-e150f583edf6',
      'defaultuse': False
    }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to