Access OpenStack

From the bastion server access the openstackclient pod:

oc rsh -n openstack openstackclient

On Control Plane verify OpenStack Services:

openstack compute service list
Sample Output
+--------------------------------------+----------------+-------------------------------------------------------------+----------+---------+-------+----------------------------+
| ID                                   | Binary         | Host                                                        | Zone     | Status  | State | Updated At                 |
+--------------------------------------+----------------+-------------------------------------------------------------+----------+---------+-------+----------------------------+
| 94ce5d73-9cd6-4ad0-83bb-0f731a9418f6 | nova-conductor | nova-cell0-conductor-0                                      | internal | enabled | up    | 2025-01-27T09:56:26.000000 |
| 801cb7ff-4b55-4535-8dab-f0a1cc12bb89 | nova-scheduler | nova-scheduler-0                                            | internal | enabled | up    | 2025-01-27T09:56:25.000000 |
| d8ba1138-06c6-4b8d-a7d8-4c123ccaa2bf | nova-conductor | nova-cell1-conductor-0                                      | internal | enabled | up    | 2025-01-27T09:56:25.000000 |
| f81bcf7c-7e7b-4f5a-8ee0-fdb7139baf09 | nova-compute   | edpm-compute-1.sandbox-nqfkf-ocp4-cluster.svc.cluster.local | nova     | enabled | up    | 2025-01-27T09:56:16.000000 |
+--------------------------------------+----------------+-------------------------------------------------------------+----------+---------+-------+----------------------------+

Verify OpenStack networks:

openstack network agent list
exit
Sample Output
+--------------------------------------+------------------------------+-------------------------------------------------------------+-------------------+-------+-------+----------------------------+
| ID                                   | Agent Type                   | Host                                                        | Availability Zone | Alive | State | Binary                     |
+--------------------------------------+------------------------------+-------------------------------------------------------------+-------------------+-------+-------+----------------------------+
| 69b4e349-8395-4259-83a2-976297b3dbf6 | OVN Controller Gateway agent | control-plane-cluster-nqfkf-2                               |                   | :-)   | UP    | ovn-controller             |
| 002c628a-a22e-4a43-b353-e35cb35c6178 | OVN Controller Gateway agent | control-plane-cluster-nqfkf-1                               |                   | :-)   | UP    | ovn-controller             |
| 54fab519-0539-4d7a-aa17-c37d5dbee853 | OVN Controller Gateway agent | control-plane-cluster-nqfkf-3                               |                   | :-)   | UP    | ovn-controller             |
| 1c2d20aa-a2cb-47ca-bda3-29e3f8dee8a3 | OVN Controller agent         | edpm-compute-1.sandbox-nqfkf-ocp4-cluster.svc.cluster.local |                   | :-)   | UP    | ovn-controller             |
| 7b027585-2587-5e20-b912-58cd97fd5763 | OVN Metadata agent           | edpm-compute-1.sandbox-nqfkf-ocp4-cluster.svc.cluster.local |                   | :-)   | UP    | neutron-ovn-metadata-agent |
+--------------------------------------+------------------------------+-------------------------------------------------------------+-------------------+-------+-------+----------------------------+

Map the Compute nodes to the Compute cell that they are connected to:

oc rsh nova-cell0-conductor-0 nova-manage cell_v2 discover_hosts --verbose

Access to the openstackclient pod

oc rsh -n openstack openstackclient

Create image and flavors

export GATEWAY=172.21.0.1
export PUBLIC_NETWORK_CIDR=172.21.0.1/24
export PRIVATE_NETWORK_CIDR=192.168.100.0/24
export PUBLIC_NET_START=172.21.0.200
export PUBLIC_NET_END=172.21.0.210
export DNS_SERVER=172.30.0.10
openstack flavor create --ram 512 --disk 1 --vcpu 1 --public tiny
curl -O -L https://github.com/cirros-dev/cirros/releases/download/0.6.2/cirros-0.6.2-x86_64-disk.img
openstack image create cirros --container-format bare --disk-format qcow2 --public --file cirros-0.6.2-x86_64-disk.img

Generate a keypair (Type ENTER 2 times):

ssh-keygen -m PEM -t rsa -b 2048 -f ~/.ssh/id_rsa_pem

Create Network and Security for the VM

openstack keypair create --public-key ~/.ssh/id_rsa_pem.pub default
openstack security group create basic
openstack security group rule create basic --protocol tcp --dst-port 22:22 --remote-ip 0.0.0.0/0
openstack security group rule create --protocol icmp basic
openstack security group rule create --protocol udp --dst-port 53:53 basic
openstack network create --external --provider-physical-network datacentre --provider-network-type flat public
openstack network create --internal private
openstack subnet create public-net \
--subnet-range $PUBLIC_NETWORK_CIDR \
--no-dhcp \
--gateway $GATEWAY \
--allocation-pool start=$PUBLIC_NET_START,end=$PUBLIC_NET_END \
--network public
openstack subnet create private-net \
--subnet-range $PRIVATE_NETWORK_CIDR \
--network private
openstack router create vrouter
openstack router set vrouter --external-gateway public
openstack router add subnet vrouter private-net

Create the Server and a Floating IP

openstack server create \
    --flavor tiny --key-name default --network private --security-group basic \
    --image cirros test-server
openstack floating ip create public --floating-ip-addres 172.21.0.205

Add the floating IP above to the new VM in the next step.

openstack server add floating ip test-server 172.21.0.205
exit

From the bastion login to the compute01 host, and access to the VM, (password is gocubsgo):

ssh -i /home/lab-user/.ssh/my-guidkey.pem cloud-user@compute01
ssh cirros@172.21.0.205
exit

Access Horizon

From the Bastion, get the Route

ROUTE=$(oc get routes horizon  -o go-template='https://{{range .status.ingress}}{{.host}}{{end}}')
echo $ROUTE
Sample Output
https://horizon-openstack.apps.86dgb.dynamic.redhatworkshops.io

Navigate to the url and log in as username admin password openstack