Bookmark this page

Guided Exercise: Creating a Project Environment for Managing Applications and Resources

In this exercise, you will create and delete a domain and projects using the Dashboard and the OpenStack unified CLI.

Outcomes

You should be able to:

  • Create and delete domains using the OpenStack unified CLI.

  • Create and delete domains and projects using the OpenStack unified CLI.

  • Create and delete projects using the Dashboard.

As the student user on the workstation machine, use the lab command to prepare your system for this exercise.

This command ensures that all resources required for the exercise are present.

[student@workstation ~]$ lab project-manage start

Procedure 2.1. Instructions

  1. On workstation as the user student, use the OpenStack unified CLI to create the MyCorp domain. Use the /home/student/admin-rc environment file to access OpenStack as the admin user.

    1. On workstation, from the command line, source the identity environment file for the admin user to gain administrator rights.

      [student@workstation ~]$ source ~/admin-rc
      [student@workstation ~(admin)]$
    2. Create the MyCorp domain. Use My Corp Domain as the description.

      [student@workstation ~(admin)]$ openstack domain create \
      > --description "My Corp Domain" MyCorp
      +-------------+----------------------------------+
      | Field       | Value                            |
      +-------------+----------------------------------+
      | description | My Corp Domain                   |
      | enabled     | True                             |
      | id          | 8350ad8d9e7d4f3aacfdd9a2a7d9a45e |
      | name        | MyCorp                           |
      | options     | {}                               |
      | tags        | []                               |
      +-------------+----------------------------------+
    3. Verify that the MyCorp domain has been created.

      [student@workstation ~(admin)]$ openstack domain list
      +----------------------------------+------------+---------+--------------------+
      | ID                               | Name       | Enabled | Description        |
      +----------------------------------+------------+---------+--------------------+
      | 8350ad8d9e7d4f3aacfdd9a2a7d9a45e | MyCorp     | True    | My Corp Domain     |
      ...output omitted...
      +----------------------------------+------------+---------+--------------------+
  2. Create the developer1 user within the MyCorp domain, and verify it.

    1. Create the user with the openstack user create command. Use the optional --password-prompt argument to have the command prompt for the password, or --password to set the password in the command line. Notice in the output the domain_id has the same has the same ID as the MyCorp domain.

      [student@workstation ~(admin)]$ openstack user create \
      > --domain MyCorp \
      > --password redhat \
      > developer1
      +---------------------+----------------------------------+
      | Field               | Value                            |
      +---------------------+----------------------------------+
      | domain_id           | 8350ad8d9e7d4f3aacfdd9a2a7d9a45e |
      | enabled             | True                             |
      | id                  | 3c348c3a943346eba2a810776f31cd02 |
      | name                | developer1                       |
      | options             | {}                               |
      | password_expires_at | None                             |
      +---------------------+----------------------------------+
    2. Verify that the developer1 user has been created.

      [student@workstation ~(admin)]$ openstack user list --domain MyCorp
      +----------------------------------+------------+
      | ID                               | Name       |
      +----------------------------------+------------+
      | 3c348c3a943346eba2a810776f31cd02 | developer1 |
      +----------------------------------+------------+
  3. Create the sales project within the MyCorp domain, and then give developer1 the member role.

    1. Create the project with the openstack project create command.

      [student@workstation ~(admin)]$ openstack project create \
      > --domain MyCorp sales
      +-------------+----------------------------------+
      | Field       | Value                            |
      +-------------+----------------------------------+
      | description |                                  |
      | domain_id   | 8350ad8d9e7d4f3aacfdd9a2a7d9a45e |
      | enabled     | True                             |
      | id          | 22041d8b3a4e4b449dd01cf4cff5b133 |
      | is_domain   | False                            |
      | name        | sales                            |
      | options     | {}                               |
      | parent_id   | 8350ad8d9e7d4f3aacfdd9a2a7d9a45e |
      | tags        | []                               |
      +-------------+----------------------------------+
    2. Verify that the sales project has been created.

      [student@workstation ~(admin)]$ openstack project list --domain MyCorp
      +----------------------------------+---------+
      | ID                               | Name    |
      +----------------------------------+---------+
      | 22041d8b3a4e4b449dd01cf4cff5b133 | sales   |
      +----------------------------------+---------+
    3. Assign the member role to developer1 in the sales project.

      [student@workstation ~(admin)]$ openstack role add \
      > --user-domain MyCorp \
      > --user developer1 \
      > --project-domain MyCorp \
      > --project sales \
      > member
    4. Verify that the member role has been applied to the developer1 user.

      [student@workstation ~(admin)]$ openstack role assignment list \
      > --effective \
      > --names \
      > --user-domain MyCorp \
      > --user developer1
      +----------+-------------------+-------+----------------+--------+-----------+
      | Role     | User              | Group | Project        | Domain | Inherited |
      +----------+-------------------+-------+----------------+--------+-----------+
      | member   | developer1@MyCorp |       | sales@MyCorp   |        | False     |
      | reader   | developer1@MyCorp |       | sales@MyCorp   |        | False     |
      +----------+-------------------+-------+----------------+--------+-----------+
  4. Create a hierarchical project named SalesDev, use sales as the parent project, and confirm the relationship.

    1. Create the project with the openstack project create command, and use the --parent option.

      [student@workstation ~(admin)]$ openstack project create \
      > --parent sales \
      > --domain MyCorp \
      > SalesDev
      +-------------+----------------------------------+
      | Field       | Value                            |
      +-------------+----------------------------------+
      | description |                                  |
      | domain_id   | 8350ad8d9e7d4f3aacfdd9a2a7d9a45e |
      | enabled     | True                             |
      | id          | bb641dff4d64467fb27d65293db33154 |
      | is_domain   | False                            |
      | name        | SalesDev                         |
      | options     | {}                               |
      | parent_id   | 22041d8b3a4e4b449dd01cf4cff5b133 |
      | tags        | []                               |
      +-------------+----------------------------------+
    2. Verify that the SalesDev project has been created.

      [student@workstation ~(admin)]$ openstack project list --domain MyCorp
      +----------------------------------+------------+
      | ID                               | Name       |
      +----------------------------------+------------+
      | 22041d8b3a4e4b449dd01cf4cff5b133 | sales      |
      | bb641dff4d64467fb27d65293db33154 | SalesDev   |
      +----------------------------------+------------+
    3. Notice that the parent_id field has the same ID as in the previous command.

      [student@workstation ~(admin)]$ openstack project show SalesDev --domain MyCorp
      +-------------+----------------------------------+
      | Field       | Value                            |
      +-------------+----------------------------------+
      | description |                                  |
      | domain_id   | 8350ad8d9e7d4f3aacfdd9a2a7d9a45e |
      | enabled     | True                             |
      | id          | bb641dff4d64467fb27d65293db33154 |
      | is_domain   | False                            |
      | name        | SalesDev                         |
      | options     | {}                               |
      | parent_id   | 22041d8b3a4e4b449dd01cf4cff5b133 |
      | tags        | []                               |
      +-------------+----------------------------------+
  5. Delete the SalesDev project.

    1. Use the openstack project delete command with the --domain argument to delete the project.

      [student@workstation ~(admin)]$ openstack project delete \
      > --domain MyCorp \
      > SalesDev
    2. Verify that the SalesDev project has been deleted.

      [student@workstation ~(admin)]$ openstack project list --domain MyCorp
      +----------------------------------+------------+
      | ID                               | Name       |
      +----------------------------------+------------+
      | 22041d8b3a4e4b449dd01cf4cff5b133 | sales      |
      +----------------------------------+------------+
  6. Delete the MyCorp domain.

    1. Use the openstack domain set command with the --disable argument to disable the domain.

      [student@workstation ~(admin)]$ openstack domain set \
      > --disable \
      > MyCorp
    2. Delete the domain with the openstack domain delete command.

      [student@workstation ~(admin)]$ openstack domain delete MyCorp
    3. Verify that the MyCorp domain has been deleted.

      [student@workstation ~(admin)]$ openstack domain list
      +----------------------------------+------------+---------+--------------------+
      | ID                               | Name       | Enabled | Description        |
      +----------------------------------+------------+---------+--------------------+
      ...output omitted...
      | default                          | Default    | True    | The default domain |
      | f0bd72d8acfe4cd9842b476caa7bf269 | Example    | True    | Example Domain     |
      +----------------------------------+------------+---------+--------------------+

      Note

      Use the Dashboard to perform the following steps.

  7. On workstation, open Firefox and browse to http://dashboard.overcloud.example.com. Log in to the Dashboard using default as the domain, admin as the user name, and redhat as the password.

  8. Use the Dashboard to create the sales project using default project quotas.

    1. Click Project at the upper right of the window, and then click admin.

    2. Navigate to IdentityProjects and then click Create Project.

    3. Enter sales in the Name field and Sales Project in the Description field. Leave the Enabled check box selected.

      Click Create Project and then log out of the Dashboard.

Finish

On the workstation machine, use the lab command to complete this exercise. This is important to ensure that resources from previous exercises do not impact upcoming exercises.

[student@workstation ~]$ lab project-manage finish

This concludes the guided exercise.

Revision: cl110-16.1-4c76154