'Request a list of instance types and convert that list to a list of
OpenNebulaNodeSize objects.
Request a list of instance types from the OpenNebula web interface,
and issue a request to convert each XML object representation of an
instance type to an OpenNebulaNodeSize object.
:return: List of instance types.
:rtype:  ``list`` of :class:`OpenNebulaNodeSize`'

def _to_sizes(self, object):

    sizes = []
    size_id = 1
    attributes = [('name', str, None), ('ram', int, 'MEMORY'), ('cpu', float, None), ('vcpu', float, None), ('disk', str, None), ('bandwidth', float, None), ('price', float, None)]
    for element in object.findall('INSTANCE_TYPE'):
        element = self.connection.request(('/instance_type/%s' % element.attrib['name'])).object
        size_kwargs = {'id': size_id, 'driver': self}
        values = self._get_attributes_values(attributes=attributes, element=element)
        size_kwargs.update(values)
        size = OpenNebulaNodeSize(**size_kwargs)
        sizes.append(size)
        size_id += 1
    return sizes
