@flex wrote:
To play around with Cumulus VX (https://cumulusnetworks.com/cumulus-vx/), I wrote a little script to create a Cumulus VX image that can be used in VIRL. The script can be found at http://gitlab.informatik.hs-fulda.de/Sebastian.Rieger/virl-utils-hs-fulda/tree/master/create-cumulusvx-image. It expects a downloaded KVM qcow2 image of CumulusVX. The script can be cloned from the git repository named above:
root@virl:~# git clone http://gitlab.informatik.hs-fulda.de/Sebastian.Rieger/virl-utils-hs-fulda.git Cloning into 'virl-utils-hs-fulda'... remote: Counting objects: 51, done. remote: Compressing objects: 100% (51/51), done. remote: Total 51 (delta 25), reused 0 (delta 0) Unpacking objects: 100% (51/51), done. Checking connectivity... done. root@virl:~# cd virl-utils-hs-fulda/create-cumulusvx-image/ root@virl:~/virl-utils-hs-fulda/create-cumulusvx-image# ls create-cumulus-vx-image.sh dynamic-subtype-CumulusVX.json minimal-config-CumulusVX.txt root@virl:~/virl-utils-hs-fulda/create-cumulusvx-image#
After copying the CumulusVX qcow2 file the directory should look like:
root@virl:~/virl-utils-hs-fulda/create-cumulusvx-image# cp ~/Downloads/CumulusVX-2.5.3-4eb681f3df86c478.qcow2 . root@virl:~/virl-utils-hs-fulda/create-cumulusvx-image# ls -l total 1016588 -rw-r--r-- 1 root root 4015 Sep 14 20:54 create-cumulus-vx-image.sh -rw-r--r-- 1 root root 1040973824 Sep 14 20:56 CumulusVX-2.5.3-4eb681f3df86c478.qcow2 -rw-r--r-- 1 root root 544 Sep 14 20:54 dynamic-subtype-CumulusVX.json -rw-r--r-- 1 root root 120 Sep 14 20:54 minimal-config-CumulusVX.txt root@virl:~/virl-utils-hs-fulda/create-cumulusvx-image#
The script can then be executed using:
root@virl:~/virl-utils-hs-fulda/create-cumulusvx-image# sudo -s root@virl:~/virl-utils-hs-fulda/create-cumulusvx-image# chmod +x create-cumulus-vx-image.sh root@virl:~/virl-utils-hs-fulda/create-cumulusvx-image# ./create-cumulus-vx-image.sh CumulusVX-2.5.3-4eb681f3df86c478.qcow2 CumulusVX No image with a name or ID of 'CumulusVX' exists. Creating CumulusVX image... =========================================================== Injecting changes to use serial console and startup script to get switch config... ================================================================================== loop deleted : /dev/loop1 Saving CumulusVX image... =========================================================== +-----------------------------+--------------------------------------+ | Property | Value | +-----------------------------+--------------------------------------+ | Property 'config_disk_type' | disk | | Property 'hw_cdrom_type' | ide | | Property 'hw_disk_bus' | ide | | Property 'hw_vif_model' | e1000 | | Property 'release' | CumulusVX-2.5.3-4eb681f3df86c478 | | Property 'serial' | 1 | | Property 'subtype' | CumulusVX | | checksum | f537ac53756cd93cffd3dce880ff6b07 | | container_format | bare | | created_at | 2015-09-14T21:02:11 | | deleted | False | | deleted_at | None | | disk_format | qcow2 | | id | 9155f5b3-2496-4368-9c57-3e7ff1661ae2 | | is_public | True | | min_disk | 0 | | min_ram | 0 | | name | CumulusVX | | owner | 6f582ce5ab7a4ebfbd2fd1cf9359d732 | | protected | False | | size | 1040973824 | | status | active | | updated_at | 2015-09-14T21:02:15 | | virtual_size | None | +-----------------------------+--------------------------------------+ ERROR (CommandError): No flavor with a name or ID of 'CumulusVX.small' exists. Creating default flavor CumulusVX.small... =========================================================== +--------------------------------------+-----------------+-----------+------+-----------+------+-------+-------------+-----------+ | ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | +--------------------------------------+-----------------+-----------+------+-----------+------+-------+-------------+-----------+ | 820a9b9b-32b0-4a2d-8f6e-f4555a18e3e0 | CumulusVX.small | 256 | 0 | 0 | | 1 | 1.0 | True | +--------------------------------------+-----------------+-----------+------+-----------+------+-------+-------------+-----------+ Cleaning up... =========================================================== root@virl:~/virl-utils-hs-fulda/create-cumulusvx-image#
A sample for an appropriate dynamic SubType is provided together with the script http://gitlab.informatik.hs-fulda.de/Sebastian.Rieger/virl-utils-hs-fulda/blob/master/create-cumulusvx-image/dynamic-subtype-CumulusVX.json. Also, you can find a minimal configuration that can be used for the node in VM Maestro at http://gitlab.informatik.hs-fulda.de/Sebastian.Rieger/virl-utils-hs-fulda/blob/master/create-cumulusvx-image/minimal-config-CumulusVX.txt. After adding the SubType, and importing the SubTypes in VM Maestro CumulusVX nodes can be placed in a topology using the palette.
As shown in the figure, the example SubType provided with the script also uses the regular Cumulus VX interface names (swp1, swp2, ...). The script modifies the Cumulus VX image to support a serial console and also adds a startup script to inject the configuration (which is simply executed as a shell script) from VM Maestro. The sample configuration shown in the figure generates the default VIRL user user cisco with password cisco that has sudo privileges. Since dhclient in the Debian release used by Cumulus VX has an issue regarding UDP checksums, e1000 should be used for now as the vif_hw_type. After starting the topology, you can use SSH to login to the node as usual using VM Maestro:
Posts: 1
Participants: 1