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.
Source the /home/student/operator1-research-rc credentials file to enable admin privileges, and then list the default quota for research project.
Source the /home/student/operator1-research-rc credentials file.
[student@workstation ~]$ source ~/operator1-research-rc
[student@workstation ~(operator1-research)]$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 | +-----------+-------+
Edit the quotas for the research project according to the following table and verify that the quota has been changed.
| Quota | Value |
|---|---|
| VCPUs | 5 |
| Instances | 1 |
| RAM | 8192 MB |
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)]$
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 | +-----------+-------+
As the developer1 user, launch two new instances with the default flavor. Use the values in the following table when launching the instances:
| Setting | First instance | Second instance |
|---|---|---|
| Instance name | research-server1 | research-server2 |
| Image | rhel8 | rhel8 |
| Flavor | default | default |
| Network (private) | research-network1 | research-network1 |
Source the /home/student/developer1-research-rc credentials file.
[student@workstation ~(operator1-research)]$ source ~/developer1-research-rc
[student@workstation ~(developer1-research)]$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... +-----------------------------+------------------------------------------------+
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-server2Quota exceeded for instances: Requested 1, but already used 1 of 1 instances (HTTP 403) (Request-ID: req-9bc45702-b6c2-4d6a-8c14-790340a48a30)
Use the Dashboard to perform the following steps.
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.
Set the project quotas for the research project according to the following table:
| Quota | Value |
|---|---|
| Instances | 3 |
| VCPUs | 5 |
| RAM (MB) | 8192 |
Navigate to → . Select from the list under the column for the research project.
Select the category. Enter 3 for , then verify the values for and .
Click .
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:
| Setting | Instance values |
|---|---|
| Instance Name | research-server2 |
| Image | rhel8 |
| Flavor | default |
| Network (private) | research-network1 |
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.
Navigate to → → and then click .
In the tab, enter research-server2 in the field.
In the tab, select from the list. Set to No. Click to select rhel8 as the image.
On the tab, click to select default as the flavor.
On the tab, ensure that the research-network1 network has been allocated.
Click to launch the research-server2 instance.
Navigate to → → to verify the used quota, and notice you have used 4 of 5 VCPUs.
Try to launch a new instance with the default flavor. Use the values in the following table when launching the instance:
| Setting | Instance values |
|---|---|
| Instance Name | research-server3 |
| Image | rhel8 |
| Flavor | default |
| Network (private) | research-network1 |
Navigate to → → and then click .
In the tab, enter research-server3 in the field.
On the tab, select from the list. Set the to No. Click to select rhel8 as the image.
On the 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 tab, ensure that the research-network1 network has been allocated.
Attempt to launch the instance. Note that the button is disabled, because you have reached quota limits. It is not possible to launch research-server3.
Click to return to the page.
Log out of the Dashboard by clicking the menu in the upper-right corner, then choose .
This concludes the guided exercise.