In this lab, you will create and configure block-based storage structures for various application data use cases.
Outcomes
You should be able to:
Create an instance with an ephemeral disk.
Create a data volume and attach it to an instance.
Create a snapshot.
Transfer a volume and confirm that the transfer was successful.
As the student user on the workstation machine, use the lab command to prepare your system for this lab.
This command ensures that all resources required for the exercise are present.
[student@workstation ~]$ lab vmdisks-review start
Procedure 5.4. Instructions
This guided exercise is in two parts. In part 1 you use the CLI, and in part 2 you use the Dashboard.
As the operator1 user in the production project, create a new flavor called review-ephemeral with the following attributes:
| Option | Value |
|---|---|
ram
| 2048 |
disk
| 10 |
ephemeral
| 5 |
vcpus
| 2 |
public
|
On workstation, source the identity environment file for the operator1 user in the production project.
[student@workstation ~]$ source ~/operator1-production-rc
[student@workstation ~(operator1-production)]$Create a new public flavor named review-ephemeral with the resources mentioned in the table.
[student@workstation ~(operator1-production)]$openstack flavor create \>--ram 2048 \>--disk 10 \>--ephemeral 5 \>--vcpus 2 \>--public review-ephemeral -f json{ "OS-FLV-DISABLED:disabled": false, "OS-FLV-EXT-DATA:ephemeral": 5, "disk": 10, "id": "40372f9e-b379-4f87-83cd-1f10024a631a", "name": "review-ephemeral", "os-flavor-access:is_public": true, "properties": "", "ram": 2048, "rxtx_factor": 1.0, "swap": "", "vcpus": 2 }
As the developer1 user in the production project, create an instance named production-server5 using the following attributes, and attach a floating IP address.
| Option | Value |
|---|---|
flavor
|
review-ephemeral
|
image
|
rhel8
|
network
|
production-network1
|
key-name
|
example-keypair
|
Source the identity environment file for the developer1 user in the production project.
[student@workstation ~(operator1-production)]$ source ~/developer1-production-rc
[student@workstation ~(developer1-production)]$Create an instance named production-server5 using the review-ephemeral flavor.
[student@workstation ~(developer1-production)]$openstack server create \>--flavor review-ephemeral \>--image rhel8 \>--network production-network1 \>--key-name example-keypair \>--wait production-server5 -f json{ "OS-DCF:diskConfig": "MANUAL", "OS-EXT-AZ:availability_zone": "nova", "OS-EXT-STS:power_state": "Running", "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state": "active", "OS-SRV-USG:launched_at": "2020-06-17T10:15:57.000000", "OS-SRV-USG:terminated_at": null, "accessIPv4": "", "accessIPv6": "", "addresses": "production-network1=192.168.1.129", "adminPass": "ZFMiuzMke5Qg", "config_drive": "", "created": "2020-06-17T10:15:26Z", "flavor": "review-ephemeral (40372f9e-b379-4f87-83cd-1f10024a631a)", "hostId": "cf4823690c75bf7a545e0925f58e1a4f5a660c0e12171dd281502fdf", "id": "c58824e7-1dd2-49b0-9071-9c5c3095e32b", "image": "rhel8 (82ddd291-6b69-4029-b809-8901a81555e2)", "key_name": "example-keypair", "name": "production-server5", "progress": 0, "project_id": "cad5f123d8f84f3cae0d5194d52131a7", "properties": "", "security_groups": "name='default'", "status": "ACTIVE", "updated": "2020-06-17T10:15:57Z", "user_id": "b3bf...3570", "volumes_attached": "" }
Find an available floating IP address. An available floating IP address it not attached to a port.
[student@workstation ~(developer1-production)]$openstack floating ip list -f json[ { "ID": "ce4e8657-b8fa-4abb-8e98-ec4b439d9ce8", "Floating IP Address": "172.25.250.145", "Fixed IP Address": null,"Port": null,"Floating Network": "ef95203b-7c9f-46c0-b328-e51aa7729798", "Project": "cad5f123d8f84f3cae0d5194d52131a7" } ]
Attach an available floating IP address to the production-server5 instance.
[student@workstation ~(developer1-production)]$openstack server add \>floating ip production-server5 172.25.250.145
Verify that the ephemeral disk is attached to the production-server5 instance.
Log in to the instance as cloud-user, using the floating IP address.
[student@workstation ~(developer1-production)]$ ssh cloud-user@172.25.250.145
[cloud-user@production-server5 ~]$List the block devices to verify that the ephemeral disk is present.
[cloud-user@production-server5 ~]$sudo fdisk -l...output omitted... Disk/dev/vdb: 5 GiB, 5368709120 bytes, 10485760 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00000000
Verify that the ephemeral volume has already been mounted by cloud-init. Log out when complete.
[cloud-user@production-server5 ~]$df -hFilesystem Size Used Avail Use% Mounted on devtmpfs 900M 0 900M 0% /dev tmpfs 915M 0 915M 0% /dev/shm tmpfs 915M 17M 899M 2% /run tmpfs 915M 0 915M 0% /sys/fs/cgroup /dev/vda1 10G 2.0G 8.1G 20% //dev/vdb 5.0G 4.0K 5.0G 1% /mnttmpfs 183M 0 183M 0% /run/user/1001 [cloud-user@production-server5 ~]$logout[student@workstation ~(developer1-production)]$
As the developer1 user in the production project, create a 1 GB data volume named production-volume1 and attach it to production-server5.
Use the openstack volume create command to create a 1 GB data volume named production-volume1.
[student@workstation ~(developer1-production)]$openstack volume create \>--size 1 production-volume1+---------------------+---------------------------------------+ | Field | Value | +---------------------+---------------------------------------+ | attachments | [] | | availability_zone | nova | | bootable | false | | consistencygroup_id | None | | created_at | 2020-06-17T15:45:01.000000 | | description | None | | encrypted | False | | id | f276509d-5e59-4904-b24a-e6d5013e2e7a | | multiattach | False | | name | production-volume1 | | properties | | | replication_status | None | | size | 1 | | snapshot_id | None | | source_volid | None | | status | creating | | type | tripleo | | updated_at | None | | user_id | b3bf...38121e0abd2a5e89fa85f6649e76fd4| +---------------------+---------------------------------------+
Wait for the status of production-volume1 to change to available.
[student@workstation ~(developer1-production)]$openstack volume list \>-c Name -c Status+--------------------+-----------+ | Name | Status | +--------------------+-----------+ | production-volume1 | available | +--------------------+-----------+
Use the openstack server add command to attach the volume to production-server5.
[student@workstation ~ (developer1-production)]$openstack server add volume \>production-server5 production-volume1[student@workstation ~(developer1-production)]$
Use the openstack volume show command to show that the volume is attached and the status is in-use.
[student@workstation ~ (developer1-production)]$openstack volume show \>production-volume1+------------------------------+-----------------------------------------------+ | Field | Value | +------------------------------+-----------------------------------------------+ | attachments | [] | | availability_zone | nova | | bootable | false | | consistencygroup_id | None | | created_at | 2020-06-17T15:45:01.000000 | | description | None | | encrypted | False | | id | f276509d-5e59-4904-b24a-e6d5013e2e7a | | multiattach | False | | name | production-volume1 | | os-vol-tenant-attr:tenant_id | cad5f123d8f84f3cae0d5194d52131a7 | | properties | | | replication_status | None | | size | 1 | | snapshot_id | None | | source_volid | None | | status |in-use| | type | tripleo | | updated_at | 2020-06-17T15:45:01.000000 | | user_id | b3bf77638121e0abd2a5e89fa85f6649e76fd45d45a14 | | | 70bce0adcce1a5c3570 | +------------------------------+-----------------------------------------------+
As developer1 in the production project, create a snapshot of production-volume1 named production-snapshot1.
Use the openstack server remove command to detach production-volume1 from production-server1.
[student@workstation ~(developer1-production)]$openstack server remove \>volume production-server5 production-volume1
Use the openstack volume create command to create a snapshot of production-volume1 named production-snapshot1.
[student@workstation ~(developer1-production)]$openstack volume snapshot \>create --volume production-volume1 production-snapshot1+-------------+--------------------------------------+ | Field | Value | +-------------+--------------------------------------+ | created_at | 2020-06-17T16:06:48.140644 | | description | None | | id | c13da727-8cfb-4f02-bcd5-2fa156dd7e7a | | name | production-snapshot1 | | properties | | | size | 1 | | status | creating | | updated_at | None | | volume_id | f276509d-5e59-4904-b24a-e6d5013e2e7a | +-------------+--------------------------------------+
Use the Dashboard to perform the following steps.
As developer1, use the Dashboard to transfer production-volume1 to the research project.
On workstation, open Firefox and navigate to http://dashboard.overcloud.example.com. Log in to the Dashboard using Example as the domain, developer1 as the user, and redhat as the password.
In the upper-left of the window, click and ensure that the production project is selected.
Navigate to → → , locate production-volume1, click the actions menu, and select .
In the window, enter production-transfer1 for the . Click , then click , and then click . In the window, click .
In a terminal window, use the ls -l command to find the transfer credentials. Use the cat command to display the transfer credentials.
[student@workstation ~(developer1-production)]$ls -l Downloads-rw-rw-r--. 1 student student 122 Jun 17 16:44 b0a218a9-e1f4-436e-a429-dd17fd97b5f9.txt [student@workstation ~(developer1-production)]$cat \>~/Downloads/b0a218a9-e1f4-436e-a429-dd17fd97b5f9.txtTransfer Name: production-transfer1 Transfer ID: b0a218a9-e1f4-436e-a429-dd17fd97b5f9 Authorization Key: 1518b7e74c2b08a9
In the Dashboard, in the upper-left of the window, click and select the research project.
Navigate to → → .
Click . From the transfer credentials file open in the terminal window, locate the and the and fill in the appropriate fields. Click . Confirm that the volume is transferred and the status is Available.
This concludes the lab.