final commit of jun-19

This commit is contained in:
govardhan
2025-06-19 20:19:21 +05:30
parent bf8a451bc6
commit d43218fe31
244 changed files with 1574 additions and 4560 deletions

View File

@ -1,9 +1,9 @@
Authenticating with OpenstackSDK using Keycloak Credentials on CloudFerro Cloud[🔗](#authenticating-with-openstacksdk-using-keycloak-credentials-on-brand-name "Permalink to this headline")
Authenticating with OpenstackSDK using Keycloak Credentials on 3Engines Cloud[🔗](#authenticating-with-openstacksdk-using-keycloak-credentials-on-brand-name "Permalink to this headline")
===========================================================================================================================================================================================
If you are using OpenStackSDK to write your own script for OpenStack, the code in this tutorial will **enable the user to automatically log into your app**. When the user normally tries to log into the CloudFerro Cloud account using <https://portal.cloudferro.com/>, they have to log in manually. A screen like this appears:
If you are using OpenStackSDK to write your own script for OpenStack, the code in this tutorial will **enable the user to automatically log into your app**. When the user normally tries to log into the 3Engines Cloud account using <https://portal.3Engines.com/>, they have to log in manually. A screen like this appears:
[![register_cloudferrocloud1.png](../_images/register_cloudferrocloud1.png)](../_images/register_cloudferrocloud1.png)
[![register_3Enginescloud1.png](../_images/register_3Enginescloud1.png)](../_images/register_3Enginescloud1.png)
If they already have an account, they will be logged in after clicking on Login button. The code in this article will avoid exposing the user to such a procedure and if they had ever been authenticated to OpenStack, **the user will be able to log in with your code without even seeing the login screen**.
@ -20,11 +20,11 @@ Prerequisites[🔗](#prerequisites "Permalink to this headline")
**No. 1 Install Python and its environment**
The following article will help you install Python and **pip**, as well as **Venv**: [How to install Python virtualenv or virtualenvwrapper on CloudFerro Cloud](../cloud/How-to-install-Python-virtualenv-or-virtualenvwrapper-on-CloudFerro-Cloud.html.md).
The following article will help you install Python and **pip**, as well as **Venv**: [How to install Python virtualenv or virtualenvwrapper on 3Engines Cloud](../cloud/How-to-install-Python-virtualenv-or-virtualenvwrapper-on-3Engines-Cloud.html.md).
**No. 2 RC File**
RC file is available from the OpenStack Horizon module and serves as a source of authentication for the user. For technical details how to get it and activate, see [How To Install OpenStack and Magnum Clients for Command Line Interface to CloudFerro Cloud Horizon](../kubernetes/How-To-Install-OpenStack-and-Magnum-Clients-for-Command-Line-Interface-to-CloudFerro-Cloud-Horizon.html.md).
RC file is available from the OpenStack Horizon module and serves as a source of authentication for the user. For technical details how to get it and activate, see [How To Install OpenStack and Magnum Clients for Command Line Interface to 3Engines Cloud Horizon](../kubernetes/How-To-Install-OpenStack-and-Magnum-Clients-for-Command-Line-Interface-to-3Engines-Cloud-Horizon.html.md).
Step 1 Source Your RC File[🔗](#step-1-source-your-rc-file "Permalink to this headline")
---------------------------------------------------------------------------------------
@ -34,7 +34,7 @@ Using **Prerequisite No. 2**, download the corresponding RC file. That file can
Here are the system variables (their names all start with **OS\_**) that the **source** command will set up as well:
```
export OS_AUTH_URL=https://keystone.cloudferro.com:5000/v3
export OS_AUTH_URL=https://keystone.3Engines.com:5000/v3
export OS_INTERFACE=public
export OS_IDENTITY_API_VERSION=3
export OS_USERNAME="Your E-mail Adress"
@ -45,7 +45,7 @@ export OS_PROJECT_DOMAIN_ID="Your Domain ID"
export OS_AUTH_TYPE=v3oidcpassword
export OS_PROTOCOL=openid
export OS_DISCOVERY_ENDPOINT=https://identity.cloudferro.com/auth/realms/Creodias-new/.well-known/openid-configuration
export OS_DISCOVERY_ENDPOINT=https://identity.3Engines.com/auth/realms/Creodias-new/.well-known/openid-configuration
export OS_IDENTITY_PROVIDER=ident_creodias-new_provider
export OS_CLIENT_ID=openstack
export OS_CLIENT_SECRET=50xx4972-546x-46x9-8x72-x91x401x8x30
@ -58,14 +58,14 @@ Step 2 Create Python Code that Will Perform Keycloak Authentication Within Your
In this step you will copy the values from RC file to your Python code. For instance, variable
```
OS_DISCOVERY_ENDPOINT=https://identity.cloudferro.com/auth/realms/Creodias-new/.well-known/openid-configuration
OS_DISCOVERY_ENDPOINT=https://identity.3Engines.com/auth/realms/Creodias-new/.well-known/openid-configuration
```
from RC file will become the value of the eponymous variable in your code:
```
auth['discovery_endpoint'] = "https://identity.cloudferro.com/auth/realms/Creodias-new/.well-known/openid-configuration"
auth['discovery_endpoint'] = "https://identity.3Engines.com/auth/realms/Creodias-new/.well-known/openid-configuration"
```
@ -78,13 +78,13 @@ import os
from openstack import enable_logging
auth = {}
auth['auth_url'] = "https://keystone.cloudferro.com:5000/v3"
auth['auth_url'] = "https://keystone.3Engines.com:5000/v3"
auth['username'] = "Your E-mail Adress"
auth['password'] = os.getenv('OS_PASSWORD')
auth['project_domain_id'] = "Your Domain ID"
auth['project_name'] = "Your Project Name"
auth['project_id'] = "Your Project ID"
auth['discovery_endpoint'] = "https://identity.cloudferro.com/auth/realms/Creodias-new/.well-known/openid-configuration"
auth['discovery_endpoint'] = "https://identity.3Engines.com/auth/realms/Creodias-new/.well-known/openid-configuration"
auth['client_id'] = "openstack"
auth['identity_provider'] = 'ident_creodias-new_provider'
auth['client_secret'] = os.getenv('OS_CLIENT_SECRET')

View File

@ -1,4 +1,4 @@
Generating and authorizing Terraform using Keycloak user on CloudFerro Cloud[🔗](#generating-and-authorizing-terraform-using-keycloak-user-on-brand-name "Permalink to this headline")
Generating and authorizing Terraform using Keycloak user on 3Engines Cloud[🔗](#generating-and-authorizing-terraform-using-keycloak-user-on-brand-name "Permalink to this headline")
=====================================================================================================================================================================================
Clicking in Horizon and entering CLI commands are two main ways of using an OpenStack system. They are well suited to interactively executing one command at a time but do not scale up easily. A tool such as [Terraform, by HashiCorp corporation,](https://www.terraform.io/) provides an alternative to manual ways of introducing cascading changes. Here is how you could, say, create several instances at once:
@ -7,7 +7,7 @@ Clicking in Horizon and entering CLI commands are two main ways of using an Open
> * save them in a Terraform configuration file and
> * let Terraform automatically repeat it the prescribed number of times.
The plan is to install Terraform, get OpenStack token, enter it into the configuration file and execute. You will then be able to effectively use Terraform within the CloudFerro Cloud cloud. For instance, with Terraform you can
The plan is to install Terraform, get OpenStack token, enter it into the configuration file and execute. You will then be able to effectively use Terraform within the 3Engines Cloud cloud. For instance, with Terraform you can
> * automate creation of a multitude of virtual machines, each with their own floating IPs, DNS and network functions or
> * automate creation of Kubernetes clusters
@ -30,25 +30,25 @@ Prerequisites[🔗](#prerequisites "Permalink to this headline")
No. 1 **Account**
You need a CloudFerro Cloud hosting account with access to the Horizon interface: <https://horizon.cloudferro.com>. In particular, you will need the password for the account so have it ready in advance.
You need a 3Engines Cloud hosting account with access to the Horizon interface: <https://horizon.3Engines.com>. In particular, you will need the password for the account so have it ready in advance.
No. 2 **Installed version of Linux**
You can use your current Linux installation, however, in this article we shall start with a clean slate. Create a new VM with Ubuntu as defined in this article:
[How to create a Linux VM and access it from Linux command line on CloudFerro Cloud](../cloud/How-to-create-a-Linux-VM-and-access-it-from-Linux-command-line-on-CloudFerro-Cloud.html.md).
[How to create a Linux VM and access it from Linux command line on 3Engines Cloud](../cloud/How-to-create-a-Linux-VM-and-access-it-from-Linux-command-line-on-3Engines-Cloud.html.md).
No. 3 **Installed OpenStackClient for Linux**
To get token from the cloud, you will first need to enable access from the Ubuntu VM you just created:
[How to install OpenStackClient for Linux on CloudFerro Cloud](../openstackcli/How-to-install-OpenStackClient-for-Linux-on-CloudFerro-Cloud.html.md)
[How to install OpenStackClient for Linux on 3Engines Cloud](../openstackcli/How-to-install-OpenStackClient-for-Linux-on-3Engines-Cloud.html.md)
It will show you how to install Python, create and activate a virtual environment, and then connect to the cloud by downloading and activating the proper RC file from the CloudFerro Cloud cloud.
It will show you how to install Python, create and activate a virtual environment, and then connect to the cloud by downloading and activating the proper RC file from the 3Engines Cloud cloud.
No. 4 **Connect to the cloud via an RC file**
Another article, [How to activate OpenStack CLI access to CloudFerro Cloud cloud using one- or two-factor authentication](../accountmanagement/How-to-activate-OpenStack-CLI-access-to-CloudFerro-Cloud-cloud-using-one-or-two-factor-authentication.html.md), deals with connecting to the cloud and is covering either of the one- or two-factor authentication procedures that are enabled on your account. It also covers all the main platforms: Linux, MacOS and Windows.
Another article, [How to activate OpenStack CLI access to 3Engines Cloud cloud using one- or two-factor authentication](../accountmanagement/How-to-activate-OpenStack-CLI-access-to-3Engines-Cloud-cloud-using-one-or-two-factor-authentication.html.md), deals with connecting to the cloud and is covering either of the one- or two-factor authentication procedures that are enabled on your account. It also covers all the main platforms: Linux, MacOS and Windows.
You will use both the Python virtual environment and the downloaded RC file **after** Terraform has been installed.
@ -98,7 +98,7 @@ su eouser # Exit root mode
Step 2 Reconnect to the cloud[🔗](#step-2-reconnect-to-the-cloud "Permalink to this headline")
---------------------------------------------------------------------------------------------
Working through Prerequisites Nos. 2 and 3, you ended up being connected up to the cloud. That connection is now lost because you have switched to **root** user and back again, to the normal **eouser** for the CloudFerro Cloud cloud. Refer to **Prerequisite No. 4 Activate the RC file** to reconnect to the cloud again. The following command will act as a test:
Working through Prerequisites Nos. 2 and 3, you ended up being connected up to the cloud. That connection is now lost because you have switched to **root** user and back again, to the normal **eouser** for the 3Engines Cloud cloud. Refer to **Prerequisite No. 4 Activate the RC file** to reconnect to the cloud again. The following command will act as a test:
```
openstack flavor list
@ -210,7 +210,7 @@ terraform {
provider "openstack" {
user_name = "[email protected]"
tenant_name = "cloud_00aaa_1"
auth_url = "https://keystone.cloudferro.com:5000/v3"
auth_url = "https://keystone.3Engines.com:5000/v3"
domain_name = "cloud_00aaa_1"
token = "gAAAAABj1VTWP_CFhfKv4zWVH7avFUnHYf5J4TvuKG_Md1EdSpBIBZqTVErqVNWCnO-kYq9D7fi33aRCABadsp23-e-lrDFwyZGkfv-d83UkOTsoIuWogupmwx-3gr4wPcsikBvkAMMBD0-XMIkUONAPst6C35QnztSzZmVSeuXOJ33DaGr6yWbY-tNAOpNsk0C9c13U6ROI"
}
@ -235,7 +235,7 @@ name = "cloud_00aaa_3"
Always use the latest value of image id[🔗](#always-use-the-latest-value-of-image-id "Permalink to this headline")
-----------------------------------------------------------------------------------------------------------------
From time to time, the default images of operating systems in the CloudFerro Cloud cloud are upgraded to the new versions. As a consequence, their **image id** will change. Lets say that the image id for Ubuntu 20.04 LTS was **574fe1db-8099-4db4-a543-9e89526d20ae** at the time of writing of this article. While working through the article, you would normally take the **current** value of image id, and would use it to replace **574fe1db-8099-4db4-a543-9e89526d20ae** throughout the text.
From time to time, the default images of operating systems in the 3Engines Cloud cloud are upgraded to the new versions. As a consequence, their **image id** will change. Lets say that the image id for Ubuntu 20.04 LTS was **574fe1db-8099-4db4-a543-9e89526d20ae** at the time of writing of this article. While working through the article, you would normally take the **current** value of image id, and would use it to replace **574fe1db-8099-4db4-a543-9e89526d20ae** throughout the text.
Now, suppose you wanted to automate processes under OpenStack, perhaps using Heat, Terraform, Ansible or any other tool for OpenStack automation; if you use the value of **574fe1db-8099-4db4-a543-9e89526d20ae** for image id, it would remain **hardcoded** and once this value gets changed during the upgrade, the automated process may stop to execute.
@ -249,7 +249,7 @@ The meaning of the variables used[🔗](#the-meaning-of-the-variables-used "Perm
The meaning of the variables used is as follows:
**user\_name**
: User name with which you log in into the CloudFerro Cloud account. You can use email address here as well.
: User name with which you log in into the 3Engines Cloud account. You can use email address here as well.
**tenant\_name**
: Starts with **cloud\_00**. You can see it in the upper left corner of the Horizon window.
@ -342,4 +342,4 @@ to learn other commands Terraform can offer.
What To Do Next[🔗](#id1 "Permalink to this headline")
-----------------------------------------------------
Article [How to create a set of VMs using OpenStack Heat Orchestration on CloudFerro Cloud](../openstackcli/How-to-create-a-set-of-VMs-using-OpenStack-Heat-Orchestration-on-CloudFerro-Cloud.html.md) uses orchestration capabilities of OpenStack to automate creation of virtual machines. It is a different approach compared to Terraform but both can lead to automation under OpenStack.
Article [How to create a set of VMs using OpenStack Heat Orchestration on 3Engines Cloud](../openstackcli/How-to-create-a-set-of-VMs-using-OpenStack-Heat-Orchestration-on-3Engines-Cloud.html.md) uses orchestration capabilities of OpenStack to automate creation of virtual machines. It is a different approach compared to Terraform but both can lead to automation under OpenStack.

View File

@ -2,5 +2,5 @@
## Available Documentation
* [Authenticating with OpenstackSDK using Keycloak Credentials on CloudFerro Cloud](Authenticating-to-OpenstackSDK-using-Keycloak-Credentials-on-CloudFerro-Cloud.html.md)
* [Generating and authorizing Terraform using Keycloak user on CloudFerro Cloud](Generating-and-authorizing-Terraform-using-Keycloak-user-on-CloudFerro-Cloud.html.md)
* [Authenticating with OpenstackSDK using Keycloak Credentials on 3Engines Cloud](Authenticating-to-OpenstackSDK-using-Keycloak-Credentials-on-3Engines-Cloud.html.md)
* [Generating and authorizing Terraform using Keycloak user on 3Engines Cloud](Generating-and-authorizing-Terraform-using-Keycloak-user-on-3Engines-Cloud.html.md)