Ask Your Question
0

OpenStackSDK create instance under specific project

asked 2019-03-21 08:22:34 -0600

Aref gravatar image

updated 2019-03-21 08:23:06 -0600

I'm trying to create instances using openstacksdk python api everything is ok but even when i use:

conn2 = conn.connect_as_project(proj.name)
server = conn2.create_server(......)

the server is being created under property of admin project, not the project mentioned in proj.name i even tried project id but didn't worked.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-03-28 06:37:54 -0600

Aref gravatar image

Finally instead of:

conn2 = conn.connect_as_project(project_id)

I used:

conn2 = openstack.connection.Connection(
region_name='RegionOne',
auth=dict(
    auth_url='http://controller:5000/v3',
    username=u_name,
    password=password,
    project_id=project_id,
    user_domain_id='default'),
compute_api_version='2',
identity_interface='internal')

and it worked.

another version of my question is in stack overflow: https://stackoverflow.com/questions/5...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2019-03-21 08:22:34 -0600

Seen: 77 times

Last updated: Mar 28