Deploy the Red Hat OpenShift Virtualization operator, configure node networking, and connect a VM to an additional network.
Outcomes
Deploy the OpenShift Virtualization operator.
Configure cluster nodes with additional networks.
Prepare projects for additional networks.
Deploy virtual machines with multiple network interfaces.
If you did not reset your workstation and server machines at the end of the last chapter, then save any work you want to keep from earlier exercises on those machines, and reset them now.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command ensures that the cluster API is reachable and then creates the review-cr1 namespace.
[student@workstation ~]$ lab start review-cr1
Specifications
The Red Hat OpenShift cluster API endpoint is https://api.ocp4.example.com:6443 and the OpenShift web console is available at https://console-openshift-console.apps.ocp4.example.com.
Log in to your OpenShift cluster as the admin user with redhatocp as the password.
The oc command is available on the workstation machine.
Install the OpenShift Virtualization Operator in the openshift-cnv namespace.
Use the stable channel and configure the operator for automatic update approval.
Use the default options when creating the HyperConverged instance.
If the kubevirt-hyperconverged resource exists, then an error message is displayed.
Skip the step and continue with the exercise.
Add the orgnet=true label to the worker01 and worker02 cluster nodes.
The worker01 and worker02 cluster nodes have an ens4 network interface, which is connected to an additional network.
Create a Linux bridge named br0 on each node, and then add the ens4 interface to that bridge.
Configure the bridge interface to request an IPv4 address from DHCP.
Use the orgnet: true label to select the nodes to configure.
Create a network attachment definition resource in the review-cr1 namespace with the following characteristics:
| Parameter | Value |
|---|---|
| Project |
review-cr1
|
| Resource name |
ext-net
|
| Network type |
CNV Linux bridge
|
| Bridge |
br0
|
Create a virtual machine named web1 in the review-cr1 namespace from the Red Hat Enterprise Linux 8.0 VM template.
Use the http://utility.lab.example.com:8080/openshift4/images/helloworld.qcow2 URL for the boot source.
Add a second network interface named nic-0, which is connected to the bridge that you declared in the ext-net network attachment definition resource.
Ensure that the web1 VM is running before grading your work.
Open a web browser and log in to the OpenShift web console at https://console-openshift-console.apps.ocp4.example.com.
Log in to your OpenShift cluster as the admin user with redhatocp as the password.
Open a web browser and navigate to https://console-openshift-console.apps.ocp4.example.com.
Select and log in as the admin user with redhatocp as the password.
Install the OpenShift Virtualization operator in the openshift-cnv namespace.
Navigate to → .
Type virtualization in the search bar and then click the card.
Click . Verify the following default options, and then click :
is set to .
is set to .
is set to openshift-cnv.
is set to .
After the OpenShift Virtualization operator installation completes, click . Accept the default options and then click .
If the kubevirt-hyperconverged resource exists, then an error message is displayed.
Click and continue with the exercise.
Navigate to → and then wait for the OpenShift Virtualization operator to report the Succeeded status.
Label the nodes worker01 and worker02 with the orgnet=true label.
From the OpenShift web console, navigate to → , click the vertical ellipsis icon next to worker01, and then click .
Type orgnet=true in the field and click .
Repeat this step with the worker02 node.
On the → page, select from the drop-down menu, type orgnet in the field, and select the orgnet=true label.
Verify that the node list contains only the worker01 and worker02 nodes.
Configure a Linux bridge named br0 for each cluster node with the orgnet=true label.
The Linux bridge has the following requirements:
| Parameter | Value |
|---|---|
| Name |
br0-ens4-policy
|
| Interface name |
br0
|
| Interface type |
Bridge
|
| IPv4 |
Enabled
|
| DHCP |
Enabled
|
| Bridge port |
ens4
|
| Node selector |
orgnet=true
|
Navigate to → and click .
Complete the form with the provided specifications.
Select the checkbox to open the node selector.
Click , and type orgnet as the key and true as the value.
Click and then click to create the node network configuration policy.
Confirm that the policy is successfully configured on the nodes by verifying its status on the → page.
Wait until the node network state is 2 Available.
![]() |
Create a network attachment definition resource named ext-net in the review-cr1 namespace.
From the OpenShift web console, navigate to → , select the review-cr1 project, and then click .
Complete the form by using the following information and then click .
| Parameter | Value |
|---|---|
| Name |
ext-net
|
| Namespace |
review-cr1
|
| Network type |
CNV Linux bridge
|
| Bridge name |
br0
|
Use the Red Hat Enterprise Linux 8.0 VM template to create the web1 VM in the review-cr1 namespace.
Add a second network interface named nic-0.
Navigate to → .
Select the template and click the button.
Specify web1 as the VM name.
Select the → menu option.
Specify http://utility.lab.example.com:8080/openshift4/images/helloworld.qcow2 in the field.
Click the button.
Click the tab to display the network interfaces that are connected to the VM.
Click , complete the form by using the following information, and then click .
| Parameter | Value |
|---|---|
| Name |
nic-0
|
| Model |
virtio
|
| Network |
review-cr1/ext-net
|
| Type |
Bridge
|
Click .
Navigate to → and then wait for the web1 VM to have the Running status.
Click to open the tab for the web1 vm.
Locate the panel and confirm that the nic-0 interface on the VM has an IP address in the 192.168.51.0/24 address range.