Hi,
I've made some attempts and the working sequence is after my signature.
The ex_force_auth_version and the api version make the difference.
Thanks,
Massimo
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
auth_username = 'mcanonic'
auth_password = 'XXX' #hided
project_name = 'CCC-19/20'
auth_url = 'https://kvm.tacc.chameleoncloud.org:5000'
region_name = 'KVM@TACC'
provider = get_driver(Provider.OPENSTACK)
conn = provider(auth_username,
auth_password,ex_force_auth_url=auth_url,ex_force_auth_version='3.x_password',ex_tenant_name=project_name,ex_force_service_region=region_name,
api_version='2.1')
image_id = 'b89f851a-d32a-410c-bf75-9deb2b1c2b63'
image = conn.get_image(image_id)
flavor_id = '3'
flavor = conn.ex_get_size(flavor_id)
instance = conn.create_node(name='PracticeInstance', image=image,
size=flavor)
On 6/12/20 6:43 PM, Dan Peschman wrote:
Hi Massimo. Try omitting the /v3 from your auth URL.
On 6/12/20, 9:19 AM, "Massimo Canonico" <massimo.canon...@uniupo.it> wrote:
Notice: This email is from an external sender.
HI,
I'm trying to use Chameleon OpenStack with libcloud.
Below we can find what I did and which error I get. I just skip the
password insertion.
Not sure how can I fix it.
Could you help me?
Thanks,
Massimo
[mex@hope easycloud]$ python
Python 3.7.7 (default, Mar 13 2020, 21:39:43)
[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from libcloud.compute.types import Provider
>>> from libcloud.compute.providers import get_driver
>>> auth_username = 'mcanonic'
>>> auth_password = 'XXXXX'
>>> project_name = 'CCC-19/20'
>>> auth_url = 'https://kvm.tacc.chameleoncloud.org:5000/v3'
>>> region_name = 'KVM@TACC'
>>> provider = get_driver(Provider.OPENSTACK)
>>> conn = provider(auth_username, auth_password,
ex_force_auth_url=auth_url,ex_force_auth_version='2.0_password',ex_tenant_name=project_name,ex_force_service_region=region_name)
>>> image_id = 'b89f851a-d32a-410c-bf75-9deb2b1c2b63'
>>> image = conn.get_image(image_id)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/home/mex/.local/lib/python3.7/site-packages/libcloud/compute/drivers/openstack.py",
line 2204, in get_image
'/images/%s' % (image_id,)).object['image'])
File
"/home/mex/.local/lib/python3.7/site-packages/libcloud/common/openstack.py",
line 237, in request
raw=raw)
File
"/home/mex/.local/lib/python3.7/site-packages/libcloud/common/base.py",
line 548, in request
action = self.morph_action_hook(action)
File
"/home/mex/.local/lib/python3.7/site-packages/libcloud/common/openstack.py",
line 304, in morph_action_hook
self._populate_hosts_and_request_paths()
File
"/home/mex/.local/lib/python3.7/site-packages/libcloud/common/openstack.py",
line 338, in _populate_hosts_and_request_paths
osa = osa.authenticate(**kwargs) # may throw InvalidCreds
File
"/home/mex/.local/lib/python3.7/site-packages/libcloud/common/openstack_identity.py",
line 853, in authenticate
return self._authenticate_2_0_with_password()
File
"/home/mex/.local/lib/python3.7/site-packages/libcloud/common/openstack_identity.py",
line 878, in _authenticate_2_0_with_password
return self._authenticate_2_0_with_body(reqbody)
File
"/home/mex/.local/lib/python3.7/site-packages/libcloud/common/openstack_identity.py",
line 883, in _authenticate_2_0_with_body
method='POST')
File
"/home/mex/.local/lib/python3.7/site-packages/libcloud/common/base.py",
line 648, in request
response = responseCls(**kwargs)
File
"/home/mex/.local/lib/python3.7/site-packages/libcloud/common/base.py",
line 160, in __init__
headers=self.headers)
libcloud.common.exceptions.BaseHTTPError: <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p>