OpenStack Client: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 76: Line 76:
While you can use your username and password to configure your OpenStack client (see the Get the client rc file below), it is recommended to use application credential to connect to the platform.
While you can use your username and password to configure your OpenStack client (see the Get the client rc file below), it is recommended to use application credential to connect to the platform.


On the Juno's web page left side menu, click *_Identity >> Application Credentials_*, then click *_Create Application Credentials_*. This pops up a Creation window, you need to set a Name for Credential. All other entries are optional but we recomand also seting an expiration date for the credential. Not that the credential are always linked to a user and not _project_ credential that are not linked to an account can be created.  
On the Juno's web page left side menu, '''click Identity >> Application Credentials'''''Italic text'', then click '''Create Application Credentials'''''Italic text''. This pops up a Creation window. You need to set a Name for the credential, all other entries are optional but we also recommend setting an expiration date for the credential. Note that the credentials are always linked to a ''user'' and cannot be a ''project'' credential without any owner.  


Once you are happy with the Name, click _*Create Application Credential*_
Once you are happy with the Name, click '''Create Application Credential'''''Italic text''. This pups up a window with the credential ID and its secret. You can copy that information, but downloading the <ref>clouds.yaml</ref> file is more convenient.


That file will need some minimal modification to be usable.


<div class="filename">'''File :''' clouds.yaml </div>
<syntaxhighlight lang="yaml" file="clouds.yaml">
clouds:
  OpenStack:
    auth:     
      auth_url: https://juno.calculquebec.ca:5000
     
      application_credential_id: <application id>
      application_credential_secret: <application secret>
    region_name: "RegionOne"
    interface: "public"
    identity_api_version: 3
    auth_type: "v3applicationcredential"
</syntaxhighlight>
You need to replace the <ref>OpenStack</ref> key with a unique name <ref><cred reference></ref>; it could be the project name or the credential name, you pick.
The first time you create the credentials, you will need to copy the full file here:
<syntaxhighlight lang="bash">
mkdir ~/.config/openstack/
cp clouds.yaml  ~/.config/openstack/
</syntaxhighlight>
But if you already have credential in place, only change the <ref>OpenStack</ref> key with <ref><cred reference></ref> and copy that whole block in your current  <ref>~/.config/openstack/cloud.yaml</ref> file.
Then the credential can be use by setting the <ref>OS_CLOUD</ref> env var in your session or by using the <ref>--os-cloud</ref> client flag. For example to list all the network in your project:
<syntaxhighlight lang="bash">
export OS_CLOUD=<cred reference>
openstack network list
# or
openstack --os-cloud <cred reference> network list
</syntaxhighlight>


===Get the client rc file===
===Get the client rc file===
169

edits

Navigation menu