Bookmark this page

Guided Exercise: Configuring Resource Limits in Projects

In this exercise, you will set, edit, and verify project quotas by launching instances using the OpenStack unified CLI and the Dashboard.

Outcomes

You should be able to:

  • Set and edit project quotas.

  • Verify the project quotas by launching instances.

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-quotas start

Procedure 2.3. Instructions

This guided exercise is in two parts. In part 1 you use the CLI and in part 2 you use the Dashboard.

  1. Source the /home/student/operator1-research-rc credentials file to enable admin privileges, and then list the default quota for research project.

    1. Source the /home/student/operator1-research-rc credentials file.

      [student@workstation ~]$ source ~/operator1-research-rc
      [student@workstation ~(operator1-research)]$
    2. Use openstack quota show command to list the current project quotas for the research project.

      [student@workstation ~(operator1-research)]$ openstack quota show \
      > -c cores -c ram -c instances research
      +-----------+-------+
      | Field     | Value |
      +-----------+-------+
      | cores     | 20    |
      | instances | 10    |
      | ram       | 51200 |
      +-----------+-------+
  2. Edit the quotas for the research project according to the following table and verify that the quota has been changed.

    QuotaValue
    VCPUs5
    Instances1
    RAM8192 MB
    1. Modify the quotas for the research project to the values in the table above. Use the openstack quota set command with the arguments --cores, --instances, and --ram.

      [student@workstation ~(operator1-research)]$ openstack quota set \
      > --cores 5 \
      > --instances 1 \
      > --ram 8192 \
      > research
      [student@workstation ~(operator1-research)]$
    2. List the quotas for the research project, and use openstack quota show command to confirm the changes made.

      [student@workstation ~(operator1-research)]$ openstack quota show \
      > -c cores -c ram -c instances research
      +-----------+-------+
      | Field     | Value |
      +-----------+-------+
      | cores     | 5     |
      | instances | 1     |
      | ram       | 8192  |
      +-----------+-------+
  3. As the developer1 user, launch two new instances with the default flavor. Use the values in the following table when launching the instances:

    SettingFirst instanceSecond instance
    Instance nameresearch-server1research-server2
    Imagerhel8rhel8
    Flavordefaultdefault
    Network (private)research-network1research-network1
    1. Source the /home/student/developer1-research-rc credentials file.

      [student@workstation ~(operator1-research)]$ source ~/developer1-research-rc
      [student@workstation ~(developer1-research)]$
    2. Use the openstack server create command to launch the research-server1 instance using the information in the previous table.

      [student@workstation ~(developer1-research)]$ openstack server create \
      > --image rhel8 \
      > --flavor default \
      > --network research-network1 \
      > research-server1 --wait
      +-----------------------------+------------------------------------------------+
      | Field                       | Value                                          |
      +-----------------------------+------------------------------------------------+
      ...output omitted...
      | image                       | rhel8 (b33fca9a-3c85-40b3-86bf-466eeaccbf6b)   |
      ...output omitted...
      | name                        | research-server1                               |
      ...output omitted...
      +-----------------------------+------------------------------------------------+
    3. Use the openstack server create command to launch the research-server2 instance using the information in the previous table.

      [student@workstation ~(developer1-research)]$ openstack server create \
      > --image rhel8 \
      > --flavor default \
      > --network research-network1 \
      > research-server2
      Quota exceeded for instances: Requested 1, but already used 1 of 1 instances (HTTP 403) (Request-ID: req-9bc45702-b6c2-4d6a-8c14-790340a48a30)

      Note

      Use the Dashboard to perform the following steps.

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

  5. Set the project quotas for the research project according to the following table:

    QuotaValue
    Instances3
    VCPUs5
    RAM (MB)8192
    1. Navigate to IdentityProjects. Select Modify Quotas from the list under the Actions column for the research project.

    2. Select the Compute category. Enter 3 for Instances, then verify the values for VCPUs and RAM (MB).

      Click Save.

  6. As the developer1 user, verify the used quota on the dashboard. Launch a new instance with the default flavor. Use the values in the following table when launching the instance:

    SettingInstance values
    Instance Nameresearch-server2
    Imagerhel8
    Flavordefault
    Network (private)research-network1
    1. Log out as operator1, then log in to the Dashboard using Example as the domain, developer1 as the user name, and redhat as the password. Ensure that the selected project is research.

    2. Navigate to ProjectComputeInstances and then click Launch Instance.

    3. In the Details tab, enter research-server2 in the Instance Name field.

      In the Source tab, select Image from the Select Boot Source list. Set Create New Volume to No. Click to select rhel8 as the image.

      On the Flavor tab, click to select default as the flavor.

      On the Networks tab, ensure that the research-network1 network has been allocated.

    4. Click Launch Instance to launch the research-server2 instance.

    5. Navigate to ProjectComputeOverview to verify the used quota, and notice you have used 4 of 5 VCPUs.

  7. Try to launch a new instance with the default flavor. Use the values in the following table when launching the instance:

    SettingInstance values
    Instance Nameresearch-server3
    Imagerhel8
    Flavordefault
    Network (private)research-network1
    1. Navigate to ProjectComputeInstances and then click Launch Instance.

    2. In the Details tab, enter research-server3 in the Instance Name field.

      On the Source tab, select Image from the Select Boot Source list. Set the Create New Volume to No. Click to select rhel8 as the image.

      On the Flavor tab, click to select default as the flavor. Notice the warning symbol on the VCPUs column because you have used 4 out of the 5 VCPU quota.

      On the Networks tab, ensure that the research-network1 network has been allocated.

    3. Attempt to launch the instance. Note that the Launch Instance button is disabled, because you have reached quota limits. It is not possible to launch research-server3.

    4. Click Cancel to return to the Instances page.

    5. Log out of the Dashboard by clicking the developer1 menu in the upper-right corner, then choose Sign out.

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-quotas finish

This concludes the guided exercise.

Revision: cl110-16.1-4c76154