Describes how to install and activate the Virtual Edge on KVM using a cloud-init config file.

If you decide to use SR-IOV mode, enable SR-IOV on KVM. For steps, see Enable SR-IOV on KVM.
Note: SR-IOV mode is not supported if the KVM Virtual Edge is deployed with a High-Availability topology. For High-Availability deployments, ensure that SR-IOV is not enabled for that KVM Edge pair.
To run VMware Virtual Edge on KVM using the libvirt:
  1. Use gunzip to extract the qcow2 file to the image location (for example, /var/lib/libvirt/images).
  2. Create the Network pools that you are going to use for the device, using SR-IOV and OpenVswitch.

    Using SR-IOV

    The following is a sample network interface template specific to Intel X710/XL710 NIC cards using SR-IOV.

        <interface type='hostdev' managed='yes'>
            <mac address='52:54:00:79:19:3d'/>
            <driver name='vfio'/>
                <address type='pci' domain='0x0000' bus='0x83' slot='0x0a' function='0x0'/>
            <model type='virtio'/>

    Using OpenVSwitch

     <model type='virtio'/> 
     <forward mode="bridge"/> 
     <bridge name="passthrough"/> 
     <virtualport type='openvswitch'> 
     <vlan trunk='yes'> 
     <tag id='33' nativeMode='untagged'/> 
     <tag id='200'/> 
     <tag id='201'/> 
     <tag id='202'/> 
     <model type='virtio'/> 
     <forward mode="bridge"/> 
    <domain type='kvm'> 
     <memory unit='KiB'>4194304</memory> 
     <currentMemory unit='KiB'>4194304</currentMemory> 
     <vcpu placement='static'>2</vcpu> 
     <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type> 
     <boot dev='hd'/> 
    Set the CPU mode to host model to leverage all the available features on the host CPU 
     <cpu mode='host-model'> 
     <model fallback='allow'/> 
     <clock offset='utc'/> 
     Below is the location of the qcow2 disk image 
     <disk type='file' device='disk'> 
     <driver name='qemu' type='qcow2'/> 
     <source file='/var/lib/libvirt/images/edge-VC_KVM_GUEST-x86_64-2.3.0-18- R23-20161114-GA-updatable-ext4.qcow2'/> 
     <target dev='sda' bus='sata'/> 
     <address type='drive' controller='0' bus='0' target='0' unit='0'/> 
     If using cloud-init to boot up virtual edge, attach the 2nd disk as CD-ROM 
     <disk type='file' device='cdrom'> 
     <driver name='qemu' type='raw'/> 
     <source file='/home/vcadmin/cloud-init/vedge1/seed.iso'/> 
     <target dev='sdb' bus='sata'/> 
     <address type='drive' controller='1' bus='0' target='0' unit='0'/> 
     <controller type='usb' index='0'> 
     <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> 
     <controller type='pci' index='0' model='pci-root'/> 
     <controller type='sata' index='0'> 
     <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> 
     <controller type='ide' index='0'> 
     <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> 
     The first two interfaces are for the default L2 interfaces, NOTE VLAN support just for SR-IOV and OpenvSwitch  
     < interfacetype='network'>  
     < modeltype='virtio'/>  
     < sourcenetwork='LAN1'/>  
     < vlan>< tagid='#hole2_vlan#'/></ vlan>  
     < aliasname=LAN1/>  
     < addresstype='pci' domain='0x0000' bus='0x00' slot='0x12' function='0x0'/>  
     </ interface>  
     < interfacetype='network'>  
     < modeltype='virtio'/>  
     < sourcenetwork=LAN2/>  
     < vlan>< tagid='#LAN2_VLAN#'/></ vlan>  
     < aliasname='hostdev1'/>  
     < addresstype='pci' domain='0x0000' bus=' 0x00' slot='0x13' function='0x0'/>  
     </ interface>  
     The next two interfaces are for the default L3 interfaces. Note that additional 6 routed interfaces 
    are supported for a combination of 8 interfaces total  
     < interfacetype='network'>  
     < modeltype='virtio'/>  
     < sourcenetwork=WAN1/>  
     < vlan>< tagid='#hole2_vlan#'/></ vlan>  
     < aliasname=LAN1/>  
     < addresstype='pci' domain='0x0000' bus='0x00' slot='0x12' function='0x0'/>  
     </ interface>  
     < interfacetype='network'>  
     < modeltype='virtio'/>  
     < source network=LAN2/>  
     < vlan>< tag id='#LAN2_VLAN#'/></ vlan>  
     < aliasname='hostdev1'/>  
     < addresstype='pci' domain='0x0000' bus='0x00' slot='0x13' function='0x0'/>  
     </ interface>  
     <serial type='pty'> 
     <target port='0'/> 
     <console type='pty'> 
     <target type='serial' port='0'/> 
     <input type='mouse' bus='ps2'/> 
     <input type='keyboard' bus='ps2'/> 
     <graphics type='vnc' port='-1' autoport='yes' listen=''> 
     <listen type='address' address=''/> 
     <sound model='ich6'> 
     <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> 
     <model type='cirrus' vram='9216' heads='1'/> 
     <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> 
     <memballoon model='virtio'> 
     <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> 
  3. Save the domain XML file that defines the VM (for example, vedge1.xml created in step 2).
  4. Launch the VM by performing the following steps:
    1. Create VM.
      virsh define vedge1.xml
    2. Start VM.
      virsh start vedge1
    Note: vedge1 is the name of the VM defined in the <name> element of the domain XML file. Replace vedge1 with the name you specify in the <name> element.
  5. If you are using SR-IOV mode, after launching the VM, set the following on the Virtual Functions (VFs) used:
    1. Set the spoofcheck off.
      ip link set eth1 vf 0 spoofchk off
    2. Set the Trusted mode on.
      ip link set dev eth1 vf 0 trust on
    3. Set the VLAN, if required.
      ip link set eth1 vf 0 vlan 3500
    Note: The Virtual Functions configuration step is not applicable for OpenVSwitch (OVS) mode.
  6. Console into the VM.
    virsh list
    Id Name State
    25 test_vcg running
    velocloud@KVMperf2$ virsh console 25
    Connected to domain test_vcg
    Escape character is ^]

The Cloud-init already includes the activation key, which was generated while creating a new Virtual Edge on the SD-WAN Orchestrator. The Virtual Edge is configured with the config settings from the Cloud-init file. This will configure the interfaces as the Virtual Edge is powered up. Once the Virtual Edge is online, it will activate with the SD-WAN Orchestrator using the activation key. The SD-WAN Orchestrator IP address and the activation key have been defined in the Cloud-init file.