Deploying CVP on KVM
Once you complete these tasks, you can configure the CVP VM.
Downloading and extracting the CVP KVM tarball (.tgz archive)
- The CVP VM
- Disk images for the CVP application
- The files used to configure CVP VM.
You download the tarball to the host server that is configured for KVM. The files contained in the .tgz archive include:
|1||disk1.qcow2||VM disk image for the CVP application.|
|2||disk2.qcow2||Data disk image for the CVP application.|
|3||cvpTemplate.xml||A template for creating the XML file for libvirt domain specification.|
|4||generateXmlForKvm.py||A script for generating the CVP VM definition XML based on the XML template.|
|5||createNwBridges.py||A script for creating the network interfaces for the CVP VM.|
Complete the following steps to download and extract the CVP VM .tgz archive:
- Go to the Arista software downloads webpage and download the CVP VM tarball (cvp-<version>-kvm.tgz) to the host server set up for KVM.
Extract the tarball
The following example shows extracting the CVP KVM .tgz archive.
[arastra@kvm1 vms]# cd cvpTests [arastra@kvm1 cvpTests]# ls cvp-2018.2.2-kvm.tar [arastra@kvm1 cvpTests]#tar -xvf cvp-2018.2.2-kvm.tar addIsoToVM.py createNwBridges.py cvpTemplate.xml disk1.qcow2 disk2.qcow2 generateXmlForKvm.py
Creating Virtual Bridge and Network Interface Cards (NIC)
The second task in deploying CVP for KVM involves creating the bridges and interfaces that provide network connectivity for the CVP VM. You use the CreateNwBridges.py script you extracted in the previous task to create the required bridges and interfaces.
- Two interfaces (the cluster bridge interface and the device bridge interface).
- Single interface (the device bridge interface).
Complete the following steps to create the network interfaces for CVP KVM connectivity:
(Optional) Use the ./createNwBridges.py -help command to
view a list of all the parameters available in the script.
Note: Install the net-tools library using the yum -y install net-tools command before running the script.
Use the ./createNwBridges.py to create the device bridge (or
bridges) and interfaces needed.
The figure below shows an example of creating a single device bridge for a single-node deployment.
- (Optional) Use the brctl show command to verify that the bridges were successfully created.
(Optional) Use the ip address show command to verify that
the IP addresses have been allocated. In this example the one IP address for the
The following output is an example of verifying bridge creation and IP address allocation. In this example, a bridge br1 was created, and one IP address has been allocated for the bridge.
[arastra@kvm1 ~]# ip address show br1 6: br1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether d0:94:66:4f:56:48 brd ff:ff:ff:ff:ff:ff inet 172.31.6.78/16 brd 172.31.255.255 scope global br1 valid_lft forever preferred_lft forever inet6 fe80::d294:66ff:fe4f:5648/64 scope link valid_lft forever preferred_lft forever [arastra@kvm1 ~]# ip route show default via 172.31.0.1 dev br1 172.31.0.0/16 dev br1 proto kernel scope link src 172.31.0.1 [arastra@kvm1 ~]#
Generating the XML file that defines the CVP VM
The third task in deploying CVP for KVM involves generating the XML file that you use to define the CVP VM. You use generateXmlForKvm.py script and the cvpTemplate.xml file you extracted previously to generate the XML file you use to define the CVP VM.
The cvpTemplate.xml file is a template that defines wildcard values that are filled by the other parameters that are specified when you execute the script.
Complete the following steps to generate the XML file:
- (Optional) Use the python generateXmlForKvm.py -help command to view a list of all the parameters available in the script.
Run the python generateXmlForKvm.py script using the XML
template (cvpTemplate.xml) as one of the inputs.
Generation of XML file used to define CVP VM shows an example of an XML being generated that can be used to define a CVP VM named cvpTest. The generated XML file is named qemuout.xml.
Defining and Launching the CVP VM
The last task in deploying CVP for KVM is to define and launch the CVP VM. You use the XML file you generated in the previous task to define the CVP VM.
Complete the following steps to define and launch the CVP VM:
- Run the virsh define command to define the CVP VM (specify the generated XML file).
- Run the virsh start command to launch the newly defined CVP VM.
virsh console command to attach (connect) to the
CVP VM console.
Defining and Launching the CVP VM shows an example of the use of the commands to define and launch a CVP VM named cvpTest. The XML file used to define the CVP VM is named qemuout.xml.
You can now login as cvpadmin and complete the configuration of the CVP application. See Configuring a Single-Node CVP Instance using CVP Shell for the steps used to complete the configuration.