Abstract
| Goal | Create and configure projects with secure user access and sufficient resources to support cloud user application deployment requirements. |
| Objectives |
|
| Sections |
|
| Lab |
Managing Application Projects in a Multitenant Cloud |
After completing this section, you should be able to describe the use of OpenStack domains and projects to segregate applications and users, and create projects and user environments.
The Red Hat OpenStack Platform (RHOSP) Identity service handles user and service authentication and authorization for all OpenStack activities. The service is organized by regions, then domains, and finally projects and subprojects. A region, for the purpose of this discussion, is the typical single-site Identity service (Keystone) deployment. A region contains domains, which are collections of user accounts, projects, and shared resources. Projects are collections of resources and users with roles. They provide an environment for building and deploying applications.
Domain operators comprehend project structures, including Hierarchical Multitenancy (HMT), which is commonly used by cloud providers and telcos to delegate subprojects to clients and to manage overall resources from a parent project.
Roles are covered in detail in the the section called “Providing Cloud User Access to Projects” section.
Users set environment variables to declare the overcloud Identity service URL, domain, and project to use when using the command line. Users must source the correct environment file before performing OpenStack commands. The following example shows part of the admin-rc file created by the overcloud deployment:
[user@demo ~]$ cat admin-rc
...output omitted...
export OS_USERNAME=admin
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_AUTH_TYPE=password
export OS_PASSWORD=redhatThe following is another example, for the operator1 user:
[user@demo ~]$ cat operator1-finance-rc
...output omitted...
export OS_PASSWORD=redhat
export OS_PROJECT_DOMAIN_NAME=Example
export OS_PROJECT_NAME=finance
export OS_REGION_NAME=regionOne
export OS_USERNAME=operator1
export OS_USER_DOMAIN_NAME=ExampleThe admin user is in the Default domain, and operator1 is in the Example domain.
A project is a collection of resources, such as networks, images, and instances, and belongs to a domain. Projects can be nested using the HMT feature of the Identity service. HMT allows subprojects to inherit role assignments from a parent project, although the Dashboard is not currently capable to display project nesting. Typically, project resources are not accessible to users outside of the project which owns the resources, unless the resources are explicitly shared. However, users can have roles in multiple projects, and can switch between projects as needed. Projects ensure that users have access to a single OpenStack environment at a time, to avoid interfering with other project resources.
Domain operators may assign a project for a group within an organization, a specific developer, or for one or more specific applications. To configure a project, a domain operator creates the project, applies the required quotas, and assigns users to the project with appropriate roles.
RHOSP is installed with a default domain, named Default, containing two default projects, named admin and service. The Default domain is intended only as initial access to create other domains and site-wide shared resources. The Default domain is not intended as a location for new projects. Always create a new domain, such as the Example domain in this course, and log in as a domain-scope admin in that new domain, before creating new projects.
Use the Default domain admin project to create site-wide shared resources that all projects across domains can see and use, such as flavors, images, and external networks. Red Hat recommends against launching any instances using the admin project. The admin project admin user has unlimited site-level privileges. This admin user can create domains, groups, and users, and apply site-, domain- and project-scope roles to groups and users.
Domains represent collections of projects, users, and resources; these collections are owned by only one domain. Domains define a space to isolate resources, and can only be created by the cloud administrator. The Default admin project is special, in that resources created within it are shared for site-wide use. An advantage of domains is that a user assigned the domain-scope admin role can manage the whole domain. That user manages domain resources, such as projects and users, and delegates roles. Red Hat recommends restricting the default domain for only service accounts and creating separate domains, with separate identity management back ends, for normal user accounts.
Resources, such as networks, disks, and instances, can belong to only a single domain. Resources are not shared across domains, and cannot be moved to another domain. Moving resources requires deleting them in one domain and creating them again in another.
User accounts can only belong to a single domain. However, users can be assigned roles in another domain's projects.
For example, a cloud provider hosts various customers, and each customer requires a different authentication back end. The customers' cloud resources are segregated using domains. RHOSP helps customers choose between the various authentication back ends supported by the cloud provider. Domains also help the cloud provider to host all the customers using a single OpenStack environment.
Domains cannot be created in the OpenStack Dashboard. When OpenStack recognizes that multiple domains exists, and the current user has sufficient privileges in multiple domains, the fields for assigning domains for projects becomes available.
The following steps outline the process for creating and deleting a domain using the OpenStack unified CLI.
Any user assigned a site or domain admin role can create and delete projects. Projects have resource quotas, which are configured at project creation, or modified as needed. Project quotas that are not explicitly set during project creation will use default quota settings. When a project is deleted, only the project's user assignments and some resources are removed. Project resources should be removed before the project is deleted.
To create a project, you need the domain-scope admin role. Source the identity environment file of a user with this assigned role, to have sufficient privilege when communicating with the OpenStack services.
Create the project using the openstack project create command. This command takes the project name as an argument. You can use the description option to specify a description for the project, but this is optional. The project is enabled by default, but you can use the disable option to start with the project disabled.
[user@demo ~(admin)]$openstack project create \>--description "Demo Org Project" --domain demo-org demo-project
Delete the project using the openstack project delete command. This command takes the project name or ID as an option. You can delete multiple projects at the same time with a space-separated list.
[user@demo ~(admin)]$openstack project delete \>--domain demo-org demo-project
Use the openstack project list command to list all currently available projects and verify that you deleted the project.
[user@demo ~(admin)]$ openstack project list
...output omitted...Additional information is available in the section on Project Management in the Users and Identity Management Guide for Red Hat OpenStack Platform, at https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.0/html-single/users_and_identity_management_guide/index