Hello.
Welcome to this presentation on using the Oracle network config utility to manage the
creation and attachment of secondary Virtual Network interface Cards, or VNICs, for Oracle
Cloud Infrastructure instances running Oracle Linux.
The OCI network config utility is included in the Oracle Cloud Infrastructure utilities,
or OCI utilities package.
In this demonstration we look at the oci-network-config command and how it is used to manage secondary
VNICs on an Oracle Linux instance and in the Oracle Cloud Infrastructure.
OCI Utilities uses a daemon service called ocid.service to discover and interact between
instances and the Oracle Cloud Infrastructure and its resources.
The service is not started by default, so before using OCI utilities always check to
ensure if the ocid daemon is started.
Currently we are looking at the terminal of our Oracle Linux instance, and a browser window
showing the web console for Oracle Cloud Infrastructure.
First we will look and see the VNICs provisioned for our instance in the web console.
Looking at the details page for our instance, we scroll down to Resources and select Attached
VNICs.
We see two VNICs, the primary VNIC, and also a secondary VNIC which was configured earlier
through the web console.
Clicking on the name of the secondary VNIC we can see its details page, showing its assigned
private IP address and MAC address.
The ocid.service daemon running on the instance means changes made using the command line
utility also impact the provisioning state of the VNIC in the web console.
Looking at the terminal for the instance we run the command oci-network-config show.
We see two VNICs, the names correspond to the two VNICs we saw in the web console, as
well as the IP addresses, MAC addresses.
We also see the link names, ens3 for primary VNIC and ens5 for the secondary VNIC.
For the secondary VNIC, under the State column, we see ADD, and under the Status column we
see DOWN.
The ADD state indicates the daemon service has detected the secondary VNIC in the Oracle
Cloud Infrastructure for the this instance, and it has been automatically attached to
the instance.
But it has not been configured yet and is in a Down state.
Running the command oci-network-config show --details returns more information such as
subnet address and gateway IP.
The table layout is quite full for this command, so running the command oci-network-config
show-vnics returns additional VNIC information such as the OCID value.
This is important to note as later when managing VNICs we will need the OCID value to perform
a certain task.
So clearing the screen, running the command oci-network-config show --details --output-mode=text
returns a detailed text output instead of the table format.
Running the command ip address we see the secondary VNIC ens5, in a DOWN state and without
any IP configuration.
So lets configure the VNIC on the instance with the provisioned cloud configuration we
saw in our web console.
Clearing the screen we run the command oci-network-config configure.
This synchronizes the provisioned configuration from the cloud with our instance.
Running the command oci-network-config show --details --output-mode=text now shows the
State is cleared from the previous ADD, and the Status is UP.
Clearing the screen and running the command ip address, we now see the ens5 State is UP
and an IP address configured.
Clearing the screen, now lets use the command to detach the secondary VNIC from the instance.
Note that when using this command it also deletes the secondary VNIC from the Oracle
Cloud Infrastructure as part of the process.
In order to do this we need to identify the VNIC in the command, this is done either using
the IP address, or the OCID value, we will use the OCID value here.
Remember, to display the OCID value from command line, we run the command oci-network-config
show-vnics.
Now we run the command oci-network-config detach-vnic --ocid and copy paste in the OCID
value for the secondary VNIC.
It takes a few minutes to complete.
Running again the command oci-network-config show-vnics, we now see the secondary VNIC
is deleted.
And running the command oci-network-config show --details also confirms this.
Returning to the web console, we can already see the secondary VNIC has been deleted and
is no longer listed.
Back on our terminal, we now want to create and attach the secondary VNIC again.
Clearing the screen, we run the command oci-network-config attach-vnic --name 2nd-vnic.
This will also define the name of the secondary to be 2nd-vnic when it is created.
There are a number of parameters that can be set with this command as shown here.
After a few minutes it is created and we are given the assigned IP address.
Running the command oci-network-config show-vnics, we now see the secondary VNIC is created.
But to see the configured state we run the command oci-network-config show --details
--output-mode=text.
We see the state is ADD, which tells us the VNIC is attached to our instance, but has
not been configured with it IP address information.
So lets synchronize this information like before.
First we clear the screen.
And again run the command oci-network-config configure.
Running the command oci-network-config show --details --output-mode=text, we see the State
is cleared, and Status is UP.
Clearing the screen and running the command IP address, we now see the secondary VNIC
ens5 UP and with IP address information set.
Returning to our web console we already see the new secondary VNIC is provisioned and
marked as attached, and identified with the name 2nd-vinc.
Selecting the name we view its details page.
Now lets delete the VIC from the web console and see how it reflects on the instance.
Clicking on the Delete button, we get a pop up confirmation window reminding us that route
rules may be impacted by this.
We are happy to do it, so we click OK.
We are returned to our instance details page, and scrolling down we can see the secondary
VNIC being detached.
Returning to our terminal, we run the command oci-network-config show-vnics, and can see
the seondary vnic is gone.
Running the command oci-network-config show also confirms this.
Oracle provides an extensive number of resources which you can use to learn more about this
subject and others.
Use the links here to find more content about this video, as well as Oracle Linux and using
Linux on Oracle Cloud Infrastructure.
Thats the end of the video.
Thanks for watching.