Hello and welcome to this presentation about using oci-kvm Network and Storage Commands
for Oracle Cloud Infrastructure.
For our objectives today, in this video we will:
Review the syntax for the oci-kvm create and the oci-kvm destroy commands used in other
videos Provide the syntax for additional oci-kvm
commands: oci-kvm create-pool, oci-kvm create-network, and oci-kvm delete-network
And we'll demonstrate use of these additional oci-kvm commands and create a KVM guest
This slide was described in another video and provides the syntax for the oci-kvm create
command and the oci-kvm destroy command.
You specify the KVM domain, or guest, that you want to create or destroy, along with
other configuration options and parameters.
This slide provides the syntax for additional oci-kvm commands that are the focus of this
video.
The oci-kvm create-pool command creates a storage pool for hosting guest virtual disks.
Pools can be created on block devices or FSS file systems.
The oci-kvm create-network command creates a libvirt network that uses an Oracle Cloud
Infrastructure VNIC.
The created network offers an IP range that is usable by KVM guests.
And the oci-kvm delete-network command deletes a libvirt network previously created by the
create-network command.
We'll now begin the demonstration portion of this video.
To demonstration use of these commands, I’ve created a KVM host from the Oracle Linux KVM
image on the Oracle Cloud Infrastructure.
Creating a KVM host instance from the KVM image is described on another video.
First I’ll run the command sudo fdisk –l to show the disk devices.
The /dev/sdc device is an unused block device which is available to be used for KVM guests.
I’m going to use the sudo oci-kvm create-pool -d /dev/sdc -n vmstore command to create a
storage pool.
This command creates a storage pool on the /dev/sdc disk and the name of the pool is
vmstore.
The create-pool command creates a libvirt storage pool on top of a disk allowing you
to use a single block disk to host several virtual guest disks.
If I run the command virsh pool-list, we see that the vmstore pool now exists.
Now I’ll run the command sudo oci-network-config –s to see network interfaces.
We see two attached vnics.
The VNIC with the address of .47 is the secondary VNIC and this is the one that is available
for KVM guests.
I’m going to use the sudo oci-kvm create-network command to create a libvirt network.
This command creates a bridged network on top of a vNIC allowing a single vNIC to be
shared among many guests.
I'm including the -n option with an argument of the .47 IP address.
This is the IP address of the secondary VNIC on the KVM host.
I'm including the -N option with an argument of kvm.
This is the name of our libvirt network.
I'm including the -B option with an argument of 192.168.200.1.
This is the IP address of the bridge to be used to build the virtual network.
I'm including the -S option with an argument of 192.168.200.128.
This is the first IP address in the virtual network address space.
I'm including the -E option with an argument of 192.168.200.245.
This is the last IP address in the virtual network address space.
And the last option in the command I'm using is -P with an argument of 24.
This is the network prefix in the virtual network address space.
The ip addr command shows the kvm0 entry with an address of 192.168.200.1.
If I run the virsh net-list command, you see the kvm network is listed.
And then I’ve prepared the command that we’re going to run and stored it into a
file so we’ll run this command.
You run this as root so it’s sudo then oci-kvm create and then the name of the domain or
guest.
I specify the vmstore pool, the kvm virtual network, and a disk size of 8 Gigs to be allocated
from the pool.
After the –V option are all the virt-install arguments.
I’ll just copy this command into the buffer and paste it.
Then we’ll run this command.
When the system prompt returns, we can run the virsh console my_guest command to view
the guest creation process.
You need to complete the installation configuration and press b to begin the installation.
After installation has completed, you can start the guest and log in.
I’ll run the fdisk –l command and we can see that the boot device is 8 Gigs as specified
in the oci-kvm create guest command.
Next I’ll run the ip addr command and you see that the network interface is on the KVM
guest.
Oracle provides an extensive number of resources which you can use to learn more about this
subject and others.
Look for additional videos on the Oracle Linux KVM image on the Oracle Linux Learning Library.
And see the education.oracle.com links for comprehensive Oracle Linux curriculum available
to support a full range of Linux administration skills for cloud, on-premise and hybrid users.
This concludes this presentation.
Thank you for watching.