# KVM ONES Deployment

## QCOW Deployment

### Download Qcow2 Package

* Work with Aviz Sales/Support contact to create an account on Aviz Networks Support Portal
* Login to <https://support.aviznetworks.com> with your account credentials
* Click on the **Downloads** section, under **ONES**, click to download **ONES Release 4.0**
* **Untar the file**&#x20;
  * ```
    tar -I pbzip2 -xf ONES-4.0.0_Full.tar.bz2
    aviz_ones/
    aviz_ones/aviz_ones.qcow2  
    aviz_ones/aviz_ones.xml  
    aviz_ones/aviz_ones.xml.back
    ```
* Navigate to aviz\_ones
* Copy **ONES Release 4.0 package (qcow2)** to KVM Hypervisor Server

### Create the VM using GUI App virt-manager

If your host server has Ubuntu Desktop and virt-manager installed you can use it to deploy the VM. Make sure you can start the Virtual Machine Manager and that it connects successfully to the local hypervisor.

<figure><img src="https://content.gitbook.com/content/cd2rizc8cOY7cJKDEOsa/blobs/dtNQiieiy79YO8NXxZPN/image.png" alt=""><figcaption></figcaption></figure>

Creating a VM with virt-manager is very straightforward, Use the following steps to deploy the ONES-Application&#x20;

* File -> New Virtual Machine -> Import existing disk image -> Forward

<figure><img src="https://content.gitbook.com/content/cd2rizc8cOY7cJKDEOsa/blobs/L5JWqWXBHUlhcajXyFbh/Screenshot%202023-07-27%20at%2010.14.23%20PM.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/cd2rizc8cOY7cJKDEOsa/blobs/ED2RhAwO7VAU4XjnvOt1/image.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/cd2rizc8cOY7cJKDEOsa/blobs/NJXRhj47EVLss7N1jV0d/Screenshot%202024-04-24%20at%201.31.38%E2%80%AFAM.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/cd2rizc8cOY7cJKDEOsa/blobs/oR6K83frs7kk20HjFxi9/Screenshot%202023-11-30%20at%204.29.26%E2%80%AFPM.png" alt=""><figcaption></figcaption></figure>

**Now the ONES Application is ready to use**

<figure><img src="https://content.gitbook.com/content/cd2rizc8cOY7cJKDEOsa/blobs/M5EB6b0TJJpfFMXhnPpV/Screenshot%202024-04-24%20at%201.17.55%E2%80%AFAM.png" alt=""><figcaption></figcaption></figure>

## Create the VM using QEMU (XML configuration)

* Create an XML configuration file from the following template using **vi**

{% code title="vi ones.xml" lineNumbers="true" %}

```html
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>ONES_VM01</name>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <vcpu placement='static'>4</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-1.5'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='writeback'/>
      <source file='/home/oper/taas_vm/ones.qcow2' />
      <target bus='virtio' dev='vda'/>
    </disk>
    <serial type='pty'>
      <source path='/dev/pts/3'/>
      <target port='0'/>
    </serial>
    <!-- Management interface eth0 -->
    <interface type='network'>
	<model type='e1000' />
        <source network='br0'/>
        <address type='pci' domain='0x0000' bus='0x00' slot='0x00' function='0x0'/>
    </interface>
   <controller type='usb' index='0'/>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </memballoon>
  </devices>
</domain>
```

{% endcode %}

{% code title="User Inputs in XML File" %}

```html
Line #2   The Name of the VM
Line #3   The amount of System Memory for the VM
Line #4   The amount of System Memory for the VM
Line #5   The number of vCPU Core for the VM
Line #25  The Path to the qcow2 VM image file
Line #35  The name of the Linux bridge on the host machine
```

{% endcode %}

* Start the VM

```html
virsh create <VM XML configuration file>

#sonic@sonic-39:~$ virsh create ones.xml 
#Domain ONES_VM01 created from ones.xml
#sonic@sonic-39:~$ 

```

{% hint style="warning" %}
If you see a permission error run the virsh command with sudo may fix the issue
{% endhint %}

* Check the VM status

```python
sonic@sonic-39:~$ virsh list
 Id    Name                           State
----------------------------------------------------
 8     ONES_VM01                      running
sonic@sonic-39:~$ 
```

### Credentials to access ONES QCOW2 VM

```
Username: aviz
Password: Aviz@123
```
