[User-committee] app dev on-boarding experience report

Bonell Manjarrez, Marcela marcela.bonell.manjarrez at intel.com
Wed Jan 20 23:40:02 UTC 2016


Hi folks,

This are the workarounds I did on libcloud (openstack driver with the Neutron API) trying to fix the problems we faced (networking) on the app dev experience report:

File updated: /usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/openstack.py",


* To be able to list the security groups:

def ex_list_security_groups(self):
    """
    Get a list of Security Groups that are available.

    :rtype: ``list`` of :class:`OpenStackSecurityGroup`
    """
    return self._to_security_groups(
    # self.connection.request('/os-security-groups').object) 
    self.connection.request('/security-groups').object)



* To be able to create a security group:

def ex_create_security_group(self, name, description):
    """
    Create a new Security Group

    :param name: Name of the new Security Group
    :type  name: ``str``

    :param description: Description of the new Security Group
    :type  description: ``str``

    :rtype: :class:`OpenStackSecurityGroup`
    """
    return self._to_security_group(self.connection.request(
        #'/os-security-groups', method='POST',
        '/security-groups', method='POST',
       data={'security_group': {'name': name, 'description': description}}
    ).object['security_group'])


* To create a security rule and assign it to a group (TCP 80, 22), I did it manually thru the Rackspace panel.


So, with this I solved the problem related to security groups but it wasn’t enough... I couldn’t deploy the first app, these are my new findings:

- Despite of the fact that I had the security group ready (all_in_one_security_group), it wasn’t assign to the instance at the moment when the instance was created.

testing_instance = conn.create_node(name=instance_name,
    image=image,
    size=flavor,
    ex_keyname=keypair_name,
    ex_userdata=userdata,
    ex_security_groups=[all_in_one_security_group])


So, after the instance creation I assigned the security group manually using the Rackspace panel but the app wasn’t available at the ip assigned.
print('The Fractals app will be deployed to http://{}'.format(actual_ip_address))



- I connected to my instance thru ssh and I didn’t find the app code :(

# step-11
userdata = '''#!/usr/bin/env bashcurl -L -s https://git.openstack.org/cgit/openstack/faafo/plain/contrib/install.sh | bash -s -- \    -i faafo -i messaging -r api -r worker -r demo’''


Looks like that it wasn’t executed during the creation to the instance... 


Now, I’m moving to Shade, I only have this link: http://git.openstack.org/cgit/openstack-infra/shade in case you have more material about Shade, can you share it with me? :)
I’ll share this findings also in the libcloud maillist and I’ll keep you posted about my new journey with Shade.   


Marcela Bonell.






On 1/20/16, 2:01 PM, "Sun, Yih Leong" <yih.leong.sun at intel.com> wrote:

>Please note that there is two different api, one for Compute API and one for Neutron API.
>
>http://developer.openstack.org/api-ref-compute-v2.1.html#os-security-groups-v2.1
>/v2.1/{tenant_id}/os-security-groups
>
>http://developer.openstack.org/api-ref-networking-v2-ext.html#security_groups
>/v2.0/security-groups
>
>
>
>-----Original Message-----
>From: Tom Fifield [mailto:tom at openstack.org] 
>Sent: Sunday, January 17, 2016 8:53 PM
>To: user-committee at lists.openstack.org
>Subject: Re: [User-committee] app dev on-boarding experience report
>
>On 16/01/16 00:48, Stefano Maffulli wrote:
>> On 01/14/2016 02:29 PM, Bonell Manjarrez, Marcela wrote:
>>> >So, what I noticed is that even using openstack or rackspace driver, 
>>> >the problem is in the same file, same line, same request:
>>> >
>>> >File
>>> >"/usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/ope
>>> >nstack.py", line 1769, in ex_list_security_groups
>>> >self.connection.request('/os-security-groups').object)
>>> >
>>> >
>>> >As you can see the request uses '/os-security-groups' and in the RAX 
>>> >documentation[1] the networking requests uses '/security-groups’
>>> >that’s why libcloud fails, both drivers use the same request:
>>> >self.connection.request('/os-security-groups').object)
>> Yep, looks like a bug. Something must have changed at RAX for the 
>> security groups and nobody has updated libcloud...
>
>Data: with a quick look at the code (see eg nova/tests/functional/api_sample_tests/test_security_groups.py ), and the docs @ http://developer.openstack.org/api-ref-compute-v2.1.html#os-security-groups-v2.1,
>it seems libcloud is correct to use os-security-groups for the openstack driver.
>
>
>Regards,
>
>
>Tom


More information about the User-committee mailing list