Using Libvirt to Manage CloudEOS and vEOS VM on KVM

Libvirt is an open source library which provides CloudEOS and vEOS management of Virtual Machines.

Libvirt supports many functions such as creation, update, and deletion and of VMs.

The complete Libvirt command reference can be found at http://libvirt.org/virshcmdref.html

Define a new VM

Define a domain from an XML file, by using the virsh define <vm-definition-file.xml > command. This defines the domain, but it does not start the domain.

The definition file has vm-name, CPU, memory, network connectivity, and a path to the image. The parameters can be found at https://libvirt.org/formatdomain.html. There is a sample CloudEOS and vEOS file in the example below.

Undefine the Inactive Domain

Undefine the configuration for the inactive domain by using the virsh undefine <vm-name> and specifying its domain name.

Start a previously defined or inactive domain by using the virsh start <vm-name> command.

Terminate a domain immediately by using the virsh destroy <vm-name> command

Managing Networks

The XML definition format for networks is defined at https://libvirt.org/formatnetwork.html. These commands are similar to the VM, but with a prefix 'net-' :

The virsh net-define <network-definition-file.xml> command.

The virsh net-undefine network-name command removes an inactive virtual network from the libvirt configuration.

The virsh start network-name command manually starts a virtual network that is not running.

The virsh destroy network-name command shuts down a running virtual network.